updated to not yell about missing visual studio.
authorChris Koeritz <fred@gruntose.com>
Sun, 3 Mar 2013 17:38:56 +0000 (12:38 -0500)
committerChris Koeritz <fred@gruntose.com>
Sun, 3 Mar 2013 17:38:56 +0000 (12:38 -0500)
scripts/generator/vis_stu_vars.sh

index 1989f7566bc54d0b9165076e461a0de8e0829354..918b3de446d205605e3e559dfe41d58d0accabbd 100644 (file)
@@ -12,81 +12,92 @@ function print_usage {
   echo ""
 }
 
-chmod 755 $PRODUCTION_DIR/win32_helper/*.exe
-export PATH=$PRODUCTION_DIR/win32_helper:$PATH
-
-# we try to use the most recent compiler location, and work backwards as
-# needed for the supported range (10 = vs 2010, 9 = vs 2008, 8 = vs 2005).
-export VSxTOOLS="$VS100COMNTOOLS"
-if [ -z "$VSxTOOLS" ]; then
-  export VSxTOOLS="$VS90COMNTOOLS"
-  if [ -z "$VSxTOOLS" ]; then
-    export VSxTOOLS="$VS80COMNTOOLS"
-  fi
-fi
-
-if [ -z "$VSxTOOLS" ]; then
+if [[ "$1" =~ .*help.* ]]; then
   print_usage
-  return 33
-fi
-export VSxTOOLS="$(short_path "$VSxTOOLS" | tr "A-Z" "a-z" | sed -e 's/\\/\//g' | sed -e 's/^\(.\):/\/\1/' )"
-
-export VIS_STU_ROOT="$(echo $VSxTOOLS | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' | sed -e 's/^\(.\):/\/\1/' )"
-export VSINSTALLDIR="$VIS_STU_ROOT"
-
-export WINDIR="$(short_path "$WINDIR" | sed -e 's/\\/\//g' | sed -e 's/^\(.\):/\/\1/' )"
-
-export VCINSTALLDIR="$VSINSTALLDIR/VC"
-export VSCOMMONROOT="$VSINSTALLDIR/Common7"
-export VS_TOOLS_DIR="$VSCOMMONROOT/tools"
-export DevEnvDir="$VSCOMMONROOT/IDE"
-export MSVCDir="$VCINSTALLDIR"
-export FrameworkDir="$WINDIR/Microsoft.NET/Framework"
-export FrameworkVersion=v4.0.30319
-#old export FrameworkSDKDir="$VSINSTALLDIR/SDK/v2.0"
-
-export PLATFORM_DIR="$VCINSTALLDIR/PlatformSDK"
-if [ ! -d "$PLATFORM_DIR" ]; then
-  export PLATFORM_DIR="$(short_path "$PROGRAMFILES/Microsoft SDKs/Windows/v7.0A" | tr "A-Z" "a-z" | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' | sed -e 's/^\(.\):/\/\1/' )"
+  exit 0
 fi
-export WindowsSdkDir="$PLATFORM_DIR"
 
-#echo "path before is $PATH"
-export PATH="$DevEnvDir:$VCINSTALLDIR/BIN:$VSxTOOLS:$VSxTOOLS/bin:$FrameworkDir/$FrameworkVersion:$FrameworkDir/v3.5:$VCINSTALLDIR/VCPackages:$VSINSTALLDIR/Common7/Tools:$PLATFORM_DIR/bin:$PATH"
-#echo "path after is $PATH"
+function setup_visual_studio_variables()
+{
+  chmod 755 $PRODUCTION_DIR/win32_helper/*.exe
+  export PATH=$PRODUCTION_DIR/win32_helper:$PATH
 
-export INCLUDE="$VCINSTALLDIR/ATLMFC/INCLUDE:$VCINSTALLDIR/INCLUDE:$PLATFORM_DIR/include"
-#:$FrameworkSDKDir/include"
-
-export LIB="$VCINSTALLDIR/ATLMFC/LIB:$VCINSTALLDIR/LIB:$PLATFORM_DIR/lib"
-#:$FrameworkSDKDir/lib"
-
-# convert framework dir back or things yell like hell.
-export FrameworkDir=$(unix_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.
-
-# convert all other relevant paths back to dos form, or visual studio barfs.
-#export BUILD_SCRIPTS_DIR=$(unix_to_dos_path $BUILD_SCRIPTS_DIR)
-#export BUILDING_HIERARCHY=$(unix_to_dos_path $BUILDING_HIERARCHY)
-#export BUILDER_DIR=$(unix_to_dos_path $BUILDER_DIR)
-#export BUILD_TOP=$(unix_to_dos_path $BUILD_TOP)
-#export PRODUCTION_DIR=$(unix_to_dos_path $PRODUCTION_DIR)
-#export LOGS_DIR=$(unix_to_dos_path $LOGS_DIR)
-#export TOOL_SOURCES=$(unix_to_dos_path $TOOL_SOURCES)
-#export BINARY_DIR=$(unix_to_dos_path $BINARY_DIR)
-#export TARGETS_DIR=$(unix_to_dos_path $TARGETS_DIR)
-#export INTERMEDIATE_EXE_DIR=$(unix_to_dos_path $INTERMEDIATE_EXE_DIR)
-#export WASTE_DIR=$(unix_to_dos_path $WASTE_DIR)
-
-##############
+  # we try to use the most recent compiler location, and work backwards as
+  # needed for the supported range (10 = vs 2010, 9 = vs 2008, 8 = vs 2005).
+  export VSxTOOLS="$VS100COMNTOOLS"
+  if [ -z "$VSxTOOLS" ]; then
+    export VSxTOOLS="$VS90COMNTOOLS"
+    if [ -z "$VSxTOOLS" ]; then
+      export VSxTOOLS="$VS80COMNTOOLS"
+    fi
+  fi
+  
+  if [ -z "$VSxTOOLS" ]; then
+    return 33
+  fi
+  export VSxTOOLS="$(short_path "$VSxTOOLS" | tr "A-Z" "a-z" | sed -e 's/\\/\//g' | sed -e 's/^\(.\):/\/\1/' )"
+  
+  export VIS_STU_ROOT="$(echo $VSxTOOLS | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' | sed -e 's/^\(.\):/\/\1/' )"
+  export VSINSTALLDIR="$VIS_STU_ROOT"
+  
+  export WINDIR="$(short_path "$WINDIR" | sed -e 's/\\/\//g' | sed -e 's/^\(.\):/\/\1/' )"
+  
+  export VCINSTALLDIR="$VSINSTALLDIR/VC"
+  export VSCOMMONROOT="$VSINSTALLDIR/Common7"
+  export VS_TOOLS_DIR="$VSCOMMONROOT/tools"
+  export DevEnvDir="$VSCOMMONROOT/IDE"
+  export MSVCDir="$VCINSTALLDIR"
+  export FrameworkDir="$WINDIR/Microsoft.NET/Framework"
+  export FrameworkVersion=v4.0.30319
+  #old export FrameworkSDKDir="$VSINSTALLDIR/SDK/v2.0"
+  
+  export PLATFORM_DIR="$VCINSTALLDIR/PlatformSDK"
+  if [ ! -d "$PLATFORM_DIR" ]; then
+    export PLATFORM_DIR="$(short_path "$PROGRAMFILES/Microsoft SDKs/Windows/v7.0A" | tr "A-Z" "a-z" | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' | sed -e 's/^\(.\):/\/\1/' )"
+  fi
+  export WindowsSdkDir="$PLATFORM_DIR"
+  
+  #echo "path before is $PATH"
+  export PATH="$DevEnvDir:$VCINSTALLDIR/BIN:$VSxTOOLS:$VSxTOOLS/bin:$FrameworkDir/$FrameworkVersion:$FrameworkDir/v3.5:$VCINSTALLDIR/VCPackages:$VSINSTALLDIR/Common7/Tools:$PLATFORM_DIR/bin:$PATH"
+  #echo "path after is $PATH"
+  
+  export INCLUDE="$VCINSTALLDIR/ATLMFC/INCLUDE:$VCINSTALLDIR/INCLUDE:$PLATFORM_DIR/include"
+  #:$FrameworkSDKDir/include"
+  
+  export LIB="$VCINSTALLDIR/ATLMFC/LIB:$VCINSTALLDIR/LIB:$PLATFORM_DIR/lib"
+  #:$FrameworkSDKDir/lib"
+  
+  # convert framework dir back or things yell like hell.
+  export FrameworkDir=$(unix_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.
+  
+  # convert all other relevant paths back to dos form, or visual studio barfs.
+  #export BUILD_SCRIPTS_DIR=$(unix_to_dos_path $BUILD_SCRIPTS_DIR)
+  #export BUILDING_HIERARCHY=$(unix_to_dos_path $BUILDING_HIERARCHY)
+  #export BUILDER_DIR=$(unix_to_dos_path $BUILDER_DIR)
+  #export BUILD_TOP=$(unix_to_dos_path $BUILD_TOP)
+  #export PRODUCTION_DIR=$(unix_to_dos_path $PRODUCTION_DIR)
+  #export LOGS_DIR=$(unix_to_dos_path $LOGS_DIR)
+  #export TOOL_SOURCES=$(unix_to_dos_path $TOOL_SOURCES)
+  #export BINARY_DIR=$(unix_to_dos_path $BINARY_DIR)
+  #export TARGETS_DIR=$(unix_to_dos_path $TARGETS_DIR)
+  #export INTERMEDIATE_EXE_DIR=$(unix_to_dos_path $INTERMEDIATE_EXE_DIR)
+  #export WASTE_DIR=$(unix_to_dos_path $WASTE_DIR)
+  
+  ##############
+  
+  #echo "common tools dir is \"$VSxTOOLS\""
+  #echo cleaned windir is $WINDIR
+  #echo cleaned comn tools is $VSxTOOLS 
+  #echo root of visual studio is $VSINSTALLDIR
+  #echo platform dir is $PLATFORM_DIR
+  #echo framedir now $FrameworkDir
+  
+  ##############
+}
 
-#echo "common tools dir is \"$VSxTOOLS\""
-#echo cleaned windir is $WINDIR
-#echo cleaned comn tools is $VSxTOOLS 
-#echo root of visual studio is $VSINSTALLDIR
-#echo platform dir is $PLATFORM_DIR
-#echo framedir now $FrameworkDir
+# run the above, very nasty, function.
+setup_visual_studio_variables
 
-##############