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