1 | @echo off
|
---|
2 | pushd "%CD%"
|
---|
3 | CD /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"
|
---|
8 | set VCVARS=
|
---|
9 |
|
---|
10 | :: Path to Microsoft Platform SDK's SetEnv.cmd -- You can set this variable manually if needed
|
---|
11 | ::e.g. set SDK_ENV="C:\Program Files\Microsoft Platform SDK\SetEnv.Cmd"
|
---|
12 | set SDK_ENV=
|
---|
13 |
|
---|
14 |
|
---|
15 | rem Checking for Winbin and Unzip utility
|
---|
16 | IF NOT EXIST .\bin\windows\*.* GOTO ENDNOWINBIN
|
---|
17 | IF NOT EXIST .\bin\windows\choice.exe GOTO ENDNOWINBIN
|
---|
18 |
|
---|
19 |
|
---|
20 | echo.
|
---|
21 | echo.
|
---|
22 | echo #### # ###
|
---|
23 | echo ## # #
|
---|
24 | echo # ### ## ## ### ### ### ## ### ## #
|
---|
25 | echo # # # #### #### # # ## # # # # # #### ##
|
---|
26 | echo ## # # # # # # # # # # # # # ##
|
---|
27 | echo #### # ### ### # # ### ## ## # # ### ####
|
---|
28 | echo (C) 2008, New Zealand Digital Library Project
|
---|
29 | echo.
|
---|
30 | echo.
|
---|
31 | echo.
|
---|
32 |
|
---|
33 |
|
---|
34 | rem Checking for existance of the packages extracted / zipped
|
---|
35 | IF NOT EXIST .\common-src\packages\windows\crypt\crypt\nul IF NOT EXIST .\common-src\packages\windows\crypt\crypt.zip GOTO ENDNOWINPACK
|
---|
36 |
|
---|
37 | IF NOT EXIST .\common-src\packages\windows\expat\expat\nul IF NOT EXIST .\common-src\packages\windows\expat\expat.zip GOTO ENDNOWINPACK
|
---|
38 |
|
---|
39 | :: IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm\nul IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm.zip GOTO ENDNOWINPACK
|
---|
40 |
|
---|
41 | IF NOT EXIST .\common-src\packages\windows\stlport\stlport\nul IF NOT EXIST .\common-src\packages\windows\stlport\stlport.zip GOTO ENDNOWINPACK
|
---|
42 |
|
---|
43 | IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv\nul IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv.zip GOTO ENDNOICONV
|
---|
44 |
|
---|
45 | IF NOT EXIST .\common-src\packages\sqlite\sqlite* IF NOT EXIST .\common-src\packages\sqlite\sqlite*.tar.gz GOTO ENDNOSQLITE
|
---|
46 |
|
---|
47 | rem Ask the user to extract now or to directly compile
|
---|
48 | echo Do you want to extract the required packages (Recommended)? This will be the default action in 10 seconds.
|
---|
49 | .\bin\windows\choice.exe /T:Y,10 /C:YN
|
---|
50 | IF errorlevel 2 GOTO COMPILE
|
---|
51 | IF errorlevel 1 GOTO UNZIP
|
---|
52 | IF errorlevel 0 GOTO END
|
---|
53 |
|
---|
54 |
|
---|
55 | :UNZIP
|
---|
56 | IF NOT EXIST .\bin\windows\unzip.exe GOTO ENDNOUNZIP
|
---|
57 | IF NOT EXIST .\bin\windows\gunzip.exe GOTO ENDNOUNZIP
|
---|
58 | IF NOT EXIST .\bin\windows\tar.exe GOTO ENDNOUNZIP
|
---|
59 |
|
---|
60 | rem Extracting the packages
|
---|
61 | IF 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\
|
---|
62 |
|
---|
63 | IF 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\
|
---|
64 |
|
---|
65 | IF 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\
|
---|
66 |
|
---|
67 | IF 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\
|
---|
68 |
|
---|
69 | IF 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\
|
---|
70 |
|
---|
71 | IF EXIST .\common-src\packages\sqlite\sqlite*.tar.gz .\bin\windows\gunzip.exe -cd .\common-src\packages\sqlite\sqlite*.tar.gz | .\bin\windows\tar.exe xv --directory=./common-src/packages/sqlite
|
---|
72 |
|
---|
73 |
|
---|
74 | echo.
|
---|
75 | echo.
|
---|
76 | :COMPILE
|
---|
77 |
|
---|
78 | rem Last check if all the packages have been extracted prior compilation
|
---|
79 | IF NOT EXIST .\common-src\packages\windows\crypt\crypt\*.* GOTO NEEDUNZIP
|
---|
80 | IF NOT EXIST .\common-src\packages\windows\expat\expat\*.* GOTO NEEDUNZIP
|
---|
81 | :: IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm\*.* GOTO NEEDUNZIP
|
---|
82 | IF NOT EXIST .\common-src\packages\windows\stlport\stlport\*.* GOTO NEEDUNZIP
|
---|
83 | IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv\*.* GOTO NEEDUNZIP
|
---|
84 | IF NOT EXIST .\common-src\packages\sqlite\sqlite* GOTO NEEDUNZIP
|
---|
85 |
|
---|
86 | rem Check some known paths to VCVARS32.BAT
|
---|
87 | :: if the user has set VCVARS32 don't look in the default places at all
|
---|
88 | IF NOT %VCVARS%=="" echo ******* VCVARS set, checking for MS Platform SDK...& GOTO SET_SDK
|
---|
89 |
|
---|
90 | :: Visual Studio 2005 Pro --- NOT READY YET
|
---|
91 | IF EXIST "%programfiles%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" set VCVARS="%programfiles%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
|
---|
92 |
|
---|
93 | :: Visual Studio 2003 \ VS7
|
---|
94 | IF %VCVARS%=="" IF EXIST "%programfiles%\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat" set VCVARS="%programfiles%\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
|
---|
95 |
|
---|
96 | :: Visual Studio 6 \ VS6
|
---|
97 | IF %VCVARS%=="" IF EXIST "%programfiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT" set VCVARS="%programfiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
|
---|
98 |
|
---|
99 | IF %VCVARS%=="" GOTO ENDNOVCVARS32
|
---|
100 | :: Now VCVARS has been set so it can be used when we need it
|
---|
101 |
|
---|
102 | :SET_SDK
|
---|
103 | rem Check known path(s) to SetEnv.cmd
|
---|
104 | :: if the user has set SDK_ENV don't look in the default places at all
|
---|
105 | IF NOT %SDK_ENV%=="" GOTO CALL_SDK
|
---|
106 |
|
---|
107 | IF EXIST "%programfiles%\Microsoft Platform SDK\SetEnv.cmd" set SDK_ENV="%programfiles%\Microsoft Platform SDK\SetEnv.cmd"
|
---|
108 |
|
---|
109 | IF %SDK_ENV%=="" GOTO ENDNOSDKENV
|
---|
110 |
|
---|
111 | :CALL_SDK
|
---|
112 | call %SDK_ENV%
|
---|
113 | echo.
|
---|
114 | echo.
|
---|
115 |
|
---|
116 | call %VCVARS%
|
---|
117 | echo.
|
---|
118 | echo.
|
---|
119 |
|
---|
120 | :PROMPT
|
---|
121 | echo.
|
---|
122 | rem Ask the user what to compile
|
---|
123 | echo What do you want to compile?
|
---|
124 | echo.
|
---|
125 | echo 1. Local library only
|
---|
126 | echo 2. Web library only
|
---|
127 | echo 3. Both
|
---|
128 | echo 4. Apache local library (needs Microsoft Platform SDK)
|
---|
129 | echo 5. Quit
|
---|
130 | echo.
|
---|
131 | echo Please choose a number from the menu. Otherwise both libraries will be compiled in 15 seconds.
|
---|
132 | .\bin\windows\choice.exe /N /T:3,15 /C:12345
|
---|
133 | IF errorlevel 5 GOTO END
|
---|
134 | IF errorlevel 4 GOTO WITHAPACHE
|
---|
135 | IF errorlevel 3 GOTO WITHBOTH
|
---|
136 | IF errorlevel 2 GOTO WITHOUTLOCALLIB
|
---|
137 | IF errorlevel 1 GOTO WITHLOCALLIB
|
---|
138 | IF errorlevel 0 GOTO END
|
---|
139 |
|
---|
140 |
|
---|
141 | :WITHAPACHE
|
---|
142 | :: Only compile up the Apache web server if we're asked to
|
---|
143 |
|
---|
144 | :: Now unpack the custom GS2 apache web server tar.gz file
|
---|
145 | IF NOT EXIST .\runtime-src\packages\apache-httpd\httpd-2.2.11\nul .\bin\windows\gunzip.exe -cd .\runtime-src\packages\apache-httpd\httpd-*.tar.gz | .\bin\windows\tar.exe xv --directory=./runtime-src/packages/apache-httpd
|
---|
146 |
|
---|
147 | nmake /f win32.mak APACHE_HTTPD=1
|
---|
148 | GOTO ENDOK
|
---|
149 |
|
---|
150 |
|
---|
151 | :WITHOUTLOCALLIB
|
---|
152 | echo.
|
---|
153 | echo.
|
---|
154 | nmake /f win32.mak
|
---|
155 | GOTO ENDOK
|
---|
156 |
|
---|
157 | :WITHLOCALLIB
|
---|
158 | echo.
|
---|
159 | echo.
|
---|
160 | nmake /f win32.mak LOCAL_LIBRARY=1
|
---|
161 | GOTO ENDOK
|
---|
162 |
|
---|
163 | :WITHBOTH
|
---|
164 | echo.
|
---|
165 | echo.
|
---|
166 | nmake /f win32.mak
|
---|
167 | nmake /f win32.mak LOCAL_LIBRARY=1
|
---|
168 | GOTO ENDOK
|
---|
169 |
|
---|
170 | :NEEDUNZIP
|
---|
171 | echo.
|
---|
172 | echo /!\ Error /!\ - Some or all the packages are not properly extracted.
|
---|
173 | echo.
|
---|
174 | echo If you wish to compile Greenstone 2 you need to unzip the required packages now.
|
---|
175 | echo.
|
---|
176 | rem Ask to Unzip the packages now otherwise quit
|
---|
177 | echo Do you want to unzip these required packages now? This will be the default action in 10 seconds.
|
---|
178 | .\bin\windows\choice.exe /T:Y,10 /c:YN
|
---|
179 | IF errorlevel 2 GOTO END
|
---|
180 | IF errorlevel 1 GOTO UNZIP
|
---|
181 | IF errorlevel 0 GOTO END
|
---|
182 |
|
---|
183 | :ENDNOWINBIN
|
---|
184 | echo.
|
---|
185 | echo /!\ Error /!\ - Winbin has not been found.
|
---|
186 | echo This is required to get the conversion tools used for importing different types of files.
|
---|
187 | echo For more info please visit this page
|
---|
188 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
|
---|
189 | GOTO END
|
---|
190 |
|
---|
191 | :ENDNOUNZIP
|
---|
192 | echo.
|
---|
193 | echo /!\ Error /!\ - Extacting tools are missing.
|
---|
194 | echo They are required to extract all packages needed for compilation.
|
---|
195 | echo These tools are contained in the Winbin folder, more info on this web page:
|
---|
196 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
|
---|
197 | GOTO END
|
---|
198 |
|
---|
199 | :ENDNOWINPACK
|
---|
200 | echo.
|
---|
201 | echo /!\ Error /!\ - Windows packages are missing.
|
---|
202 | echo Some required packages are missing in .\common-src\packages\windows\
|
---|
203 | echo Please go to this page for more information on how to get everything:
|
---|
204 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
|
---|
205 | GOTO END
|
---|
206 |
|
---|
207 | :ENDNOSQLITE
|
---|
208 | echo.
|
---|
209 | echo /!\ Error /!\ - SQLite is missing.
|
---|
210 | echo Some required packages are missing in .\common-src\packages\sqlite\
|
---|
211 | echo Please go to this page for more information on how to get everything:
|
---|
212 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
|
---|
213 | GOTO END
|
---|
214 |
|
---|
215 | :ENDNOICONV
|
---|
216 | echo.
|
---|
217 | echo /!\ Error /!\ - Indexers are missing.
|
---|
218 | echo Some required packages are missing in .\common-src\indexers\packages\windows\
|
---|
219 | echo Please go to this page for more information on how to get everything:
|
---|
220 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
|
---|
221 | GOTO END
|
---|
222 |
|
---|
223 | :ENDNOVCVARS32
|
---|
224 | echo.
|
---|
225 | echo /!\ Error /!\ - Not able to find 'vcvars32.bat'.
|
---|
226 | echo You need Visual Studio to compile the source code but we were
|
---|
227 | echo unable to find the file vcvars32.bat in your system.
|
---|
228 | echo.
|
---|
229 | echo Please edit this bat file and manually set the full path to
|
---|
230 | echo vcvars32.bat then run this script again.
|
---|
231 | GOTO END
|
---|
232 |
|
---|
233 | :ENDNOSDKENV
|
---|
234 | echo.
|
---|
235 | echo /!\ Error /!\ - Not able to find 'SetEnv.cmd'.
|
---|
236 | echo We were unable to find the SDK file SetEnv.cmd on your system.
|
---|
237 | echo You need Microsoft Platform SDK (which is available for free) to compile
|
---|
238 | echo up the Apache web server. You also need it if you're working with
|
---|
239 | echo Microsoft Visual Studio 8 or higher.
|
---|
240 | echo.
|
---|
241 | echo If you already have it installed, please edit the makegs2.bat file and
|
---|
242 | echo manually set the full path to SetEnv.cmd, then run this script again.
|
---|
243 | echo If you have an older version of Visual Studio, then you do not need the
|
---|
244 | echo Platform SDK and can compile the Web and/or Local libraries up from the
|
---|
245 | echo DOS command prompt using:
|
---|
246 | echo nmake /f win32.mak
|
---|
247 | echo and/or
|
---|
248 | echo nmake /f win32.mak LOCAL_LIBRARY=1
|
---|
249 | GOTO END
|
---|
250 |
|
---|
251 | :ENDOK
|
---|
252 | echo.
|
---|
253 | echo Done!
|
---|
254 | echo.
|
---|
255 | echo This program is free software; you can redistribute it and/or
|
---|
256 | echo modify it under the terms of the GNU General Public License
|
---|
257 | echo as published by the Free Software Foundation; either version 2
|
---|
258 | echo of the License, or (at your option) any later version.
|
---|
259 | echo.
|
---|
260 | echo This program is distributed in the hope that it will be useful,
|
---|
261 | echo but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
262 | echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
263 | echo GNU General Public License for more details.
|
---|
264 | echo.
|
---|
265 | GOTO END
|
---|
266 |
|
---|
267 | :END
|
---|
268 | popd |
---|