source: main/trunk/gs-release-builder/setup-env.bat@ 36336

Last change on this file since 36336 was 36336, checked in by kjdon, 21 months ago

some files for windows release building

File size: 4.9 KB
Line 
1@echo off
2echo.
3echo ******************************
4
5set MY_HOME_DIR=C:\greenstone\gs-release-builder
6set MY_PKG_DIR=%MY_HOME_DIR%\packages
7
8echo %MY_HOME_DIR% %MY_PKG_DIR%
9
10set JAVA_HOME=%MY_PKG_DIR%\jdk8.0.302
11if not exist "%JAVA_HOME%" echo %JAVA_HOME% does not exist& goto done
12set PATH=%JAVA_HOME%\bin;%PATH%
13
14echo + Set JAVA_HOME=%JAVA_HOME% and updated PATH
15
16set PERL_HOME=%MY_PKG_DIR%\strawberry-perl-5.18\perl
17if not exist "%PERL_HOME%" echo %PERL_HOME% does not exist& goto done
18set _PERL_TOPLEVEL=%MY_PKG_DIR%\strawberry-perl-5.18
19
20set PATH=%PERL_HOME%\bin;%PERL_HOME%\site\bin;%_PERL_TOPLEVEL%\c\bin;%PATH%
21echo + Set PERL_HOME=%PERL_HOME% and updated PATH
22
23set ANT_HOME=%MY_PKG_DIR%\apache-ant-1.9.5
24if not exist "%ANT_HOME%" echo %ANT_HOME% does not exist& goto done
25set PATH=%ANT_HOME%\bin;%PATH%
26echo + Set ANT_HOME=%ANT_HOME% and updated PATH
27
28:: Setup Visual Studio
29set vslocation=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build
30if not exist "%vslocation%" echo %vslocation% does not exist& goto done
31pushd "%vslocation%"
32:: host 64bit, target 32 bit
33call vcvarsamd64_x86
34popd
35
36set "MY_HOME_DIR="
37set "MY_PKG_DIR="
38
39goto done
40::: the rest of this is old stuff
41
42:: For notes on compiling GS2 on 64 bit Win 7 see
43:: http://wiki.greenstone.org/doku.php?id=en:developer:compiling_apache&#compiling_the_apache-httpd_included_with_gs2_on_64_bit_windows_7
44
45:: The following JDK 6 is copied straight from the 32 bit Win machine into the 64 bit Win machine
46:: It was used to debug gli's GS3ServerThread's changeover to use Process.waitFor()
47::set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_13& echo @@@@@@@@@ USING JAVA 6 @@@@@@@@@
48::set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55
49set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_20
50if not exist "%JAVA_HOME%" echo %JAVA_HOME% does not exist& goto done
51set PATH=%JAVA_HOME%\bin;%PATH%
52
53echo + Set JAVA_HOME=%JAVA_HOME% and updated PATH
54
55rem set PERL_HOME=C:\Perl64
56set PERL_HOME=C:\strawberry-perl32no64\perl
57::if not exist "%PERL_HOME%" echo %PERL_HOME% does not exist& goto done
58set PATH=%PERL_HOME%\bin;%PATH%
59::set PATH=%PERL_HOME%\perl\site\bin;%PERL_HOME%\perl\bin;%PERL_HOME%\c\bin;%PATH%
60
61::echo + Set PERL_PATH=%PERL_HOME% and updated PATH
62
63set ANT_HOME=C:\apache-ant-1.9.4
64set PATH=%ANT_HOME%\bin;%PATH%
65
66
67::set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH%
68::set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;C:\Program Files (x86)\putty;C:\Windows\System32\UnxUtils\usr\local\wbin;%PATH%
69rem set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;C:\Program Files (x86)\putty;C:\Windows\System32\linuxtools;%PATH%
70
71rem echo + Set ANT_HOME=%ANT_HOME% and updated PATH
72
73
74:: Setup Visual Studio env
75:: WORKS:
76::call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
77
78:: Running VS in 64 bit mode doesn't work, need to run in 32 bit mode.
79:: For now only VS9.0 (VS2008) works
80:: call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
81
82::::::set vslocation=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools
83::::::if not exist "%vslocation%" echo %vslocation% does not exist& goto done
84::::::pushd "%vslocation%"
85::::::call vsvars32.bat
86::::::popd
87
88:: Running VS in 64 bit works for Visual Studio 12:
89set vslocation=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
90if not exist "%vslocation%" echo %vslocation% does not exist& goto done
91pushd "%vslocation%"
92call vcvarsall.bat amd64
93popd
94
95rem pushd "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC"
96rem call vcvarsall.bat amd64
97rem popd
98
99:: VS10 fails: Common Tools folder not found for VS10
100rem call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
101
102:: VS12 fails: Calling "vsvars32.bat" above produces the same error as calling
103:: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat
104:: (and possibly the same error as calling
105:: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat without passing "amd64" param)
106rem call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat"
107
108:: Error: https://groups.google.com/forum/#!topic/UniMRCP/Iybpn51UYnI
109:: http://msdn.microsoft.com/en-us/library/ff770576.aspx
110:: http://stackoverflow.com/questions/11544563/can-i-set-the-platform-toolset-from-the-command-line-when-building-with-vs2010s
111:: /p:PlatformToolset=v100
112
113
114:: If using SetEnv.cmd to set up MS SDK env (no longer needed even for compiling GS2 with debug):
115
116::call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
117:: Run with /? to see what options it takes (/x86, /x64, /ia64, /vista, /xp, /win7 and more)
118
119::set sdklocation=C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
120::if not exist "%sdklocation%" echo %sdklocation% does not exist& goto done
121::pushd "%sdklocation%"
122::call SetEnv.cmd /x64
123::popd
124
125
126:done
127echo Done
128echo ******************************
129echo.
130
Note: See TracBrowser for help on using the repository browser.