From 46198a8a6081484e0e452a3a47c8bec10f254487 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 6 Apr 2012 12:22:50 -0400 Subject: [PATCH] updated a bit more for windows. getting farther, but now hosing up at our tool binaries, who do not understand the cygwin path format. --- nucleus/makefile | 5 ++--- scripts/clam/cpp/ms_manifest.sh | 4 ++-- scripts/clam/cpp/variables.def | 4 ++-- scripts/core/functions.sh | 4 ++-- scripts/generator/vis_stu_vars.sh | 17 ++++++++++++++++- scripts/generator/wrapdoze.sh | 24 ++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 scripts/generator/wrapdoze.sh diff --git a/nucleus/makefile b/nucleus/makefile index 5e5c392a..8fe1d439 100644 --- a/nucleus/makefile +++ b/nucleus/makefile @@ -41,13 +41,12 @@ if [ $$? -ne 0 ]; then \ echo build failure while copying paths initialization file.; \ exit 1; \ fi; \ -echo cmd is: $(CLAM_BIN)/value_tagger$(EXE_END) $(PRODUCTION_DIR)/codescan.ini; \ -$(CLAM_BIN)/value_tagger$(EXE_END) $(PRODUCTION_DIR)/codescan.ini; \ +bash $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(CLAM_BIN)/value_tagger$(EXE_END) $(PRODUCTION_DIR)/codescan.ini; \ if [ $$? -ne 0 ]; then \ echo build failure during value tagging.; \ exit 1; \ fi; \ -$(CLAM_BIN)/write_build_config$(EXE_END); \ +bash $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(CLAM_BIN)/write_build_config$(EXE_END); \ if [ $$? -ne 0 ]; then \ echo build failure while writing config.; \ exit 1; \ diff --git a/scripts/clam/cpp/ms_manifest.sh b/scripts/clam/cpp/ms_manifest.sh index 7ee8844c..a752837c 100755 --- a/scripts/clam/cpp/ms_manifest.sh +++ b/scripts/clam/cpp/ms_manifest.sh @@ -8,10 +8,10 @@ if [ -z "$WIN32_MANIFEST_FILE" ]; then fi error_val=0 if [ -f "$basename.manifest" -a -f "$basename" ]; then - mt -manifest $basename.manifest $WIN32_MANIFEST_FILE -outputresource:$basename\;$where >/dev/null + bash $BUILD_SCRIPTS_DIR/wrapdoze.sh mt -manifest $basename.manifest $WIN32_MANIFEST_FILE -outputresource:$basename\;$where >/dev/null error_val=$? elif [ -f "$basename" ]; then - mt -manifest $WIN32_MANIFEST_FILE -outputresource:$basename\;$where >/dev/null + bash $BUILD_SCRIPTS_DIR/wrapdoze.sh mt -manifest $WIN32_MANIFEST_FILE -outputresource:$basename\;$where >/dev/null error_val=$? else echo skipping manifest generation for $basename. diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index 4a36911b..41030be7 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -672,8 +672,8 @@ ifeq "$(COMPILER)" "VISUAL_CPP" export PDB_DIR = $(TARGETS_DIR) # set these way up here so we can override them later. - CC = $(COMPILER_ROOT_DIR)/bin/cl - LINK_TOOL = $(COMPILER_ROOT_DIR)/bin/link + CC = bash $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/bin/cl + LINK_TOOL = bash $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/bin/link # This is needed to protect against the use of 64-bit time_t structure # on windows. We are casting to time_t from a 32-bit structure. diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 20bb0475..aa8ac204 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -156,10 +156,10 @@ if [ -z "$skip_all" ]; then sudo /etc/init.d/alsasound restart } - # switches from a /X/path form to an X:/ form. + # switches from a /X/path form to an X:/ form. this also processes cygwin paths. function msys_to_dos_path() { # we always remove dos slashes in favor of forward slashes. - echo "$1" | sed -e 's/\\/\//g' | sed -e 's/\/\([a-zA-Z]\)\/\(.*\)/\1:\/\2/' + echo "$1" | sed -e 's/\\/\//g' | sed -e 's/\/cygdrive//' | sed -e 's/\/\([a-zA-Z]\)\/\(.*\)/\1:\/\2/' } # switches from an X:/ form to an /X/path form. diff --git a/scripts/generator/vis_stu_vars.sh b/scripts/generator/vis_stu_vars.sh index a4de1dca..f2f1006e 100644 --- a/scripts/generator/vis_stu_vars.sh +++ b/scripts/generator/vis_stu_vars.sh @@ -62,10 +62,25 @@ export LIB="$VCINSTALLDIR/ATLMFC/LIB:$VCINSTALLDIR/LIB:$PLATFORM_DIR/lib" #:$FrameworkSDKDir/lib" # convert framework dir back or things yell like hell. -export FrameworkDir="$(echo $FrameworkDir | sed -e 's/^\/\(.\)[\\\/]\(.*\)$/\1:\\\2/' | tr "/" "\\" 2>/dev/null )" +export FrameworkDir=$(msys_to_dos_path $FrameworkDir) # the redirection of stderr to null is to get around an obnoxious cygwin # warning that seems to be erroneously bitching about backslashes. +# mark this as executable because we will need it. +#chmod 755 $FEISTY_MEOW_SCRIPTS/generator/wrapdoze.sh + +# convert all other relevant paths back to dos form, or visual studio barfs. +#export BUILD_SCRIPTS_DIR=$(msys_to_dos_path $BUILD_SCRIPTS_DIR) +#export BUILDING_HIERARCHY=$(msys_to_dos_path $BUILDING_HIERARCHY) +#export BUILDER_DIR=$(msys_to_dos_path $BUILDER_DIR) +#export BUILD_TOP=$(msys_to_dos_path $BUILD_TOP) +#export PRODUCTION_DIR=$(msys_to_dos_path $PRODUCTION_DIR) +#export LOGS_DIR=$(msys_to_dos_path $LOGS_DIR) +#export TOOL_SOURCES=$(msys_to_dos_path $TOOL_SOURCES) +#export BINARY_DIR=$(msys_to_dos_path $BINARY_DIR) +#export TARGETS_DIR=$(msys_to_dos_path $TARGETS_DIR) +#export INTERMEDIATE_EXE_DIR=$(msys_to_dos_path $INTERMEDIATE_EXE_DIR) +#export WASTE_DIR=$(msys_to_dos_path $WASTE_DIR) ############## diff --git a/scripts/generator/wrapdoze.sh b/scripts/generator/wrapdoze.sh new file mode 100644 index 00000000..99d610ca --- /dev/null +++ b/scripts/generator/wrapdoze.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" + +declare -a commands=() + +for i in "$@"; do + # we only mess with the command line on windows. + if [ "$OS" == "Windows_NT" ]; then + commands+=($(msys_to_dos_path $i)) + else + commands+=("$i") + fi +done + +# echo commands are now: +# for i in "${commands[@]}"; do +# echo $i +# done + +# now actually run the possibly chewed command. +"${commands[@]}" + + -- 2.34.1