root/gsdl/trunk/makegs2.bat @ 18090

Revision 18090, 8.2 KB (checked in by max, 11 years ago)

Add sqlite extraction support

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