root/gsdl/trunk/makegs2.bat @ 17901

Revision 17901, 7.2 KB (checked in by max, 11 years ago)

Change some paths to Visual studio6/7.

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