source: gsdl/trunk/makegs2.bat@ 18034

Last change on this file since 18034 was 18034, checked in by max, 15 years ago

No VS2005 since it is not very stable yet.

File size: 7.4 KB
Line 
1@echo off
2pushd "%CD%"
3CD /D "%~dp0"
4
5
6:: Path to VCVARS32.bat -- You can set this variable manually if needed
7:: e.g. set VCVARS="C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
8set VCVARS=""
9
10
11
12
13rem Checking for Winbin and Unzip utility
14IF NOT EXIST .\bin\windows\*.* GOTO ENDNOWINBIN
15IF NOT EXIST .\bin\windows\choice.exe GOTO ENDNOWINBIN
16
17
18echo.
19echo.
20echo #### # ###
21echo ## # #
22echo # ### ## ## ### ### ### ## ### ## #
23echo # # # #### #### # # ## # # # # # #### ##
24echo ## # # # # # # # # # # # # # ##
25echo #### # ### ### # # ### ## ## # # ### ####
26echo (C) 2009, New Zealand Digital Library Project
27echo.
28echo.
29echo.
30
31
32rem Checking for existance of the packages extracted / zipped
33IF NOT EXIST .\common-src\packages\windows\crypt\crypt\*.* IF NOT EXIST .\common-src\packages\windows\crypt\crypt.zip GOTO ENDNOWINPACK
34
35IF NOT EXIST .\common-src\packages\windows\expat\expat\*.* IF NOT EXIST .\common-src\packages\windows\expat\expat.zip GOTO ENDNOWINPACK
36
37IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm\*.* IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm.zip GOTO ENDNOWINPACK
38
39IF NOT EXIST .\common-src\packages\windows\stlport\stlport\*.* IF NOT EXIST .\common-src\packages\windows\stlport\stlport.zip GOTO ENDNOWINPACK
40
41IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv\*.* IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv.zip GOTO ENDNOICONV
42
43rem Ask the user to extract now or to directly compile
44echo Do you want to unzip the required packages (Recommended)? This will be the default action in 10 seconds.
45.\bin\windows\choice.exe /T:Y,10 /C:YN
46 IF errorlevel 2 GOTO COMPILE
47 IF errorlevel 1 GOTO UNZIP
48 IF errorlevel 0 GOTO END
49
50
51:UNZIP
52IF NOT EXIST .\bin\windows\unzip.exe GOTO ENDNOUNZIP
53
54rem Extracting the packages
55IF EXIST .\common-src\packages\windows\crypt\crypt.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\crypt\crypt.zip -d .\common-src\packages\windows\crypt\
56
57IF EXIST .\common-src\packages\windows\expat\expat.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\expat\expat.zip -d .\common-src\packages\windows\expat\
58
59IF EXIST .\common-src\packages\windows\gdbm\gdbm.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\gdbm\gdbm.zip -d .\common-src\packages\windows\gdbm\
60
61IF EXIST .\common-src\packages\windows\stlport\stlport.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\stlport\stlport.zip -d .\common-src\packages\windows\stlport\
62
63IF EXIST .\common-src\indexers\packages\windows\iconv\iconv.zip .\bin\windows\unzip.exe -o .\common-src\indexers\packages\windows\iconv\iconv.zip -d .\common-src\indexers\packages\windows\iconv\
64echo.
65echo.
66:COMPILE
67
68rem Last check if all the packages have been extracted prior compilation
69IF NOT EXIST .\common-src\packages\windows\crypt\crypt\*.* GOTO NEEDUNZIP
70IF NOT EXIST .\common-src\packages\windows\expat\expat\*.* GOTO NEEDUNZIP
71IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm\*.* GOTO NEEDUNZIP
72IF NOT EXIST .\common-src\packages\windows\stlport\stlport\*.* GOTO NEEDUNZIP
73IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv\*.* GOTO NEEDUNZIP
74
75rem Check some known paths to VCVARS32.BAT
76:: if the user has set VCVARS32 don't look in the default places at all
77IF NOT %VCVARS%=="" GOTO CALLVCVARS
78
79:: Visual Studio 2005 Pro --- NOT READY YET
80::IF EXIST "%programfiles%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" set VCVARS="%programfiles%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
81
82:: Visual Studio 2003 \ VS7
83IF EXIST "%programfiles%\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat" set VCVARS="%programfiles%\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
84
85:: Visual Studio 6 \ VS6
86IF EXIST "%programfiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT" set VCVARS="%programfiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
87
88
89IF %VCVARS%=="" GOTO ENDNOVCVARS32
90
91:CALLVCVARS
92call %VCVARS%
93echo.
94echo.
95echo.
96rem Ask the user what to compile
97echo What do you want to compile?
98echo.
99echo 1. Local library only
100echo 2. Web library only
101echo 3. Both
102echo 4. Quit
103echo.
104echo Please choose a number from the menu. Otherwise both libraries will be compiled in 15 seconds.
105.\bin\windows\choice.exe /N /T:3,15 /C:1234
106 IF errorlevel 4 GOTO END
107 IF errorlevel 3 GOTO WITHBOTH
108 IF errorlevel 2 GOTO WITHOUTLOCALLIB
109 IF errorlevel 1 GOTO WITHLOCALLIB
110 IF errorlevel 0 GOTO END
111
112
113:WITHOUTLOCALLIB
114nmake /f win32.mak
115GOTO ENDOK
116
117:WITHLOCALLIB
118nmake /f win32.mak LOCAL_LIBRARY=1
119GOTO ENDOK
120
121:WITHBOTH
122nmake /f win32.mak
123nmake /f win32.mak LOCAL_LIBRARY=1
124GOTO ENDOK
125
126:NEEDUNZIP
127echo.
128echo /!\ Error /!\ - Some or all the packages are not properly extracted.
129echo.
130echo If you wish to compile Greenstone 2 you need to unzip the required packages now.
131echo.
132rem Ask to Unzip the packages now otherwise quit
133echo Do you want to unzip these required packages now? This will be the default action in 10 seconds.
134.\bin\windows\choice.exe /T:Y,10 /c:YN
135 IF errorlevel 2 GOTO END
136 IF errorlevel 1 GOTO UNZIP
137 IF errorlevel 0 GOTO END
138
139:ENDNOWINBIN
140echo.
141echo /!\ Error /!\ - Winbin has not been found.
142echo This is required to get the conversion tools used for importing different types of files.
143echo For more info please visit this page
144echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
145GOTO END
146
147:ENDNOUNZIP
148echo.
149echo /!\ Error /!\ - unzip.exe has not been found.
150echo This is required to extract the packages required for compilation.
151echo This tool is part of the Winbin folder, more info on this web page:
152echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
153GOTO END
154
155:ENDNOWINPACK
156echo.
157echo /!\ Error /!\ - Windows packages are missing.
158echo Some required packages are missing in .\common-src\packages\windows\
159echo Please go to this page for more information on how to get everything:
160echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
161GOTO END
162
163:ENDNOICONV
164echo.
165echo /!\ Error /!\ - Indexers are missing.
166echo Some required packages are missing in .\common-src\indexers\packages\windows\
167echo Please go to this page for more information on how to get everything:
168echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
169GOTO END
170
171:ENDNOVCVARS32
172echo.
173echo /!\ Error /!\ - Not able to find 'vcvars32.bat'.
174echo You need Visual Studio to compile the source code but we were
175echo unable to find the file vcvars32.bat in your system.
176echo.
177echo Please edit this bat file and manually set the full path to
178echo vcvars32.bat then run this script again.
179GOTO END
180
181:ENDOK
182echo.
183echo Done!
184echo.
185echo This program is free software; you can redistribute it and/or
186echo modify it under the terms of the GNU General Public License
187echo as published by the Free Software Foundation; either version 2
188echo of the License, or (at your option) any later version.
189echo.
190echo This program is distributed in the hope that it will be useful,
191echo but WITHOUT ANY WARRANTY; without even the implied warranty of
192echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
193echo GNU General Public License for more details.
194echo.
195GOTO END
196
197:END
198popd
Note: See TracBrowser for help on using the repository browser.