first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / generator / vis_stu_vars.sh
1 #!/bin/bash
2
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.
8
9 function print_usage {
10   echo "The VS80COMNTOOLS, VS90COMNTOOLS and VS100COMNTOOLS variables are not set."
11   echo "This usually means that the Visual Studio compiler is not installed."
12   echo ""
13 }
14
15 # we try to use the most recent compiler location, and work backwards as
16 # needed for the supported range (10 = vs 2010, 9 = vs 2008, 8 = vs 2005).
17 export VSxTOOLS="$VS100COMNTOOLS"
18 if [ -z "$VSxTOOLS" ]; then
19   export VSxTOOLS="$VS90COMNTOOLS"
20   if [ -z "$VSxTOOLS" ]; then
21     export VSxTOOLS="$VS80COMNTOOLS"
22   fi
23 fi
24
25 if [ -z "$VSxTOOLS" ]; then
26   print_usage
27   return 33
28 fi
29 #echo "common tools dir is \"$VSxTOOLS\""
30 export VSxTOOLS="$(short_path "$VSxTOOLS" | tr "A-Z" "a-z" | sed -e 's/\\/\//g' | sed -e 's/^\(.\):/\/\1/' )"
31 #echo cleaned comn tools is $VSxTOOLS 
32
33 export VIS_STU_ROOT="$(echo $VSxTOOLS | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' | sed -e 's/^\(.\):/\/\1/' )"
34 export VSINSTALLDIR="$VIS_STU_ROOT"
35 #echo root of visual studio is $VSINSTALLDIR
36
37 export WINDIR="$(short_path "$WINDIR" | sed -e 's/\\/\//g' | sed -e 's/^\(.\):/\/\1/' )"
38 #echo cleaned windir is $WINDIR
39
40 #echo "prior path is $PATH"
41
42 export VCINSTALLDIR="$VSINSTALLDIR/VC"
43 export VSCOMMONROOT="$VSINSTALLDIR/Common7"
44 export VS_TOOLS_DIR="$VSCOMMONROOT/tools"
45 export DevEnvDir="$VSCOMMONROOT/IDE"
46 export MSVCDir="$VCINSTALLDIR"
47 export FrameworkDir="$WINDIR/Microsoft.NET/Framework"
48 export FrameworkVersion=v4.0.30319
49 #old export FrameworkSDKDir="$VSINSTALLDIR/SDK/v2.0"
50
51 export PLATFORM_DIR="$VCINSTALLDIR/PlatformSDK"
52 if [ ! -d "$PLATFORM_DIR" ]; then
53   export PLATFORM_DIR="$(short_path "$PROGRAMFILES/Microsoft SDKs/Windows/v7.0A" | tr "A-Z" "a-z" | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' | sed -e 's/^\(.\):/\/\1/' )"
54 fi
55 export WindowsSdkDir="$PLATFORM_DIR"
56 #echo platform dir is $PLATFORM_DIR
57
58 export PATH="$DevEnvDir:$VCINSTALLDIR/BIN:$VSxTOOLS:$VSxTOOLS/bin:$FrameworkDir/$FrameworkVersion:$FrameworkDir/v3.5:$VCINSTALLDIR/VCPackages:$VSINSTALLDIR/Common7/Tools:$PLATFORM_DIR/bin:$PATH"
59 #$FrameworkSDKDir/bin
60
61 export INCLUDE="$VCINSTALLDIR/ATLMFC/INCLUDE:$VCINSTALLDIR/INCLUDE:$PLATFORM_DIR/include"
62 #:$FrameworkSDKDir/include"
63
64 export LIB="$VCINSTALLDIR/ATLMFC/LIB:$VCINSTALLDIR/LIB:$PLATFORM_DIR/lib"
65 #:$FrameworkSDKDir/lib"
66
67 # convert framework dir back or things yell like hell.
68 export FrameworkDir="$(echo $FrameworkDir | sed -e 's/^\/\(.\)[\\\/]\(.*\)$/\1:\\\2/' | tr "/" "\\" 2>/dev/null )"
69   # the redirection of stderr to null is to get around an obnoxious cygwin
70   # warning that seems to be erroneously bitching about backslashes.
71 #echo framedir now $FrameworkDir
72
73 #echo "path now is $PATH"
74