3 # this file attempts to provide all of the variables needed for compiling
4 # with the microsoft visual studio compiler (dot net version). it requires
5 # one environment variable (called VSxCOMNTOOLS) be set that points at the
6 # location of the common tools in the visual studio installation.
7 # The value of x can be 80, 90 or 100.
10 echo "The VS80COMNTOOLS, VS90COMNTOOLS and VS100COMNTOOLS variables are not set."
11 echo "This usually means that the Visual Studio compiler is not installed."
15 if [[ "$1" =~ .*help.* ]]; then
20 function setup_visual_studio_variables()
22 chmod 755 $PRODUCTION_DIR/win32_helper/*.exe
23 export PATH="$(dos_to_unix_path $PRODUCTION_DIR)/win32_helper:$PATH"
25 # we try to use the most recent compiler location, and work backwards as
26 # needed for the supported range (10 = vs 2010, 9 = vs 2008, 8 = vs 2005).
27 export VSxTOOLS="$VS100COMNTOOLS"
28 if [ -z "$VSxTOOLS" ]; then
29 export VSxTOOLS="$VS90COMNTOOLS"
30 if [ -z "$VSxTOOLS" ]; then
31 export VSxTOOLS="$VS80COMNTOOLS"
35 if [ -z "$VSxTOOLS" ]; then
38 export VSxTOOLS="$(short_path "$VSxTOOLS" | tr "A-Z" "a-z" | sed -e 's/\\/\//g' )"
39 #| sed -e 's/^\(.\):/\/\1/' )"
41 export VIS_STU_ROOT="$(echo $VSxTOOLS | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' )"
42 #| sed -e 's/^\(.\):/\/\1/' )"
43 export VSINSTALLDIR="$VIS_STU_ROOT"
45 export WINDIR="$(short_path "$WINDIR" | tr A-Z a-z | sed -e 's/\\/\//g' )"
46 #| sed -e 's/^\(.\):/\/\1/' )"
48 export VCINSTALLDIR="$VSINSTALLDIR/VC"
49 export VSCOMMONROOT="$VSINSTALLDIR/Common7"
50 export VS_TOOLS_DIR="$VSCOMMONROOT/tools"
51 export DevEnvDir="$VSCOMMONROOT/IDE"
52 export MSVCDir="$VCINSTALLDIR"
53 export FrameworkDir="$WINDIR/Microsoft.NET/Framework"
54 export FrameworkVersion=v4.0.30319
55 #old export FrameworkSDKDir="$VSINSTALLDIR/SDK/v2.0"
57 export PLATFORM_DIR="$VCINSTALLDIR/PlatformSDK"
58 if [ ! -d "$PLATFORM_DIR" ]; then
60 #on hold: export PLATFORM_DIR="$(short_path "$PROGRAMFILES/Microsoft SDKs/Windows/v7.0A" | tr "A-Z" "a-z" | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' )"
61 ##| sed -e 's/^\(.\):/\/\1/' )"
63 export PLATFORM_DIR="c:\progra~2\micros~1\windows\v7.0a"
66 export WindowsSdkDir="$PLATFORM_DIR"
68 #echo "path before is $PATH"
70 for filena in "$DevEnvDir" "$VCINSTALLDIR/BIN" "$VSxTOOLS" "$VSxTOOLS/bin" "$FrameworkDir/$FrameworkVersion" "$FrameworkDir/v3.5" "$VCINSTALLDIR/VCPackages" "$VSINSTALLDIR/Common7/Tools" "$PLATFORM_DIR/bin"; do
71 export PATH="$PATH:$(dos_to_unix_path $filena)"
73 #echo "path after is $PATH"
75 export INCLUDE="$VCINSTALLDIR/ATLMFC/INCLUDE:$VCINSTALLDIR/INCLUDE:$PLATFORM_DIR/include"
76 #:$FrameworkSDKDir/include"
78 export LIB="$VCINSTALLDIR/ATLMFC/LIB:$VCINSTALLDIR/LIB:$PLATFORM_DIR/lib"
79 #:$FrameworkSDKDir/lib"
81 # convert framework dir back or things yell like hell.
82 export FrameworkDir=$(unix_to_dos_path $FrameworkDir)
83 # the redirection of stderr to null is to get around an obnoxious cygwin
84 # warning that seems to be erroneously complaining about backslashes.
86 # convert all other relevant paths back to dos form, or visual studio barfs.
87 #export BUILD_SCRIPTS_DIR=$(unix_to_dos_path $BUILD_SCRIPTS_DIR)
88 #export BUILDING_HIERARCHY=$(unix_to_dos_path $BUILDING_HIERARCHY)
89 #export BUILDER_DIR=$(unix_to_dos_path $BUILDER_DIR)
90 #export BUILD_TOP=$(unix_to_dos_path $BUILD_TOP)
91 #export PRODUCTION_DIR=$(unix_to_dos_path $PRODUCTION_DIR)
92 #export LOGS_DIR=$(unix_to_dos_path $LOGS_DIR)
93 #export TOOL_SOURCES=$(unix_to_dos_path $TOOL_SOURCES)
94 #export BINARY_DIR=$(unix_to_dos_path $BINARY_DIR)
95 #export TARGETS_DIR=$(unix_to_dos_path $TARGETS_DIR)
96 #export INTERMEDIATE_EXE_DIR=$(unix_to_dos_path $INTERMEDIATE_EXE_DIR)
97 #export WASTE_DIR=$(unix_to_dos_path $WASTE_DIR)
101 echo "calculated variables for dos/windoze builds:"
102 var VIS_STU_ROOT VSxTOOLS WINDIR VSxTOOLS VSINSTALLDIR PLATFORM_DIR FrameworkDir
107 # run the above, very nasty, function.
108 setup_visual_studio_variables