[17900] | 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 |
|
---|
[17901] | 77 | :: Visual Studio 2003 \ VS7
|
---|
[17900] | 78 | 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"
|
---|
| 79 |
|
---|
[17901] | 80 | :: Visual Studio 6 \ VS6
|
---|
[17900] | 81 | IF 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 |
|
---|
| 84 | IF %VCVARS%=="" GOTO ENDNOVCVARS32
|
---|
| 85 |
|
---|
| 86 | :CALLVCVARS
|
---|
| 87 | call %VCVARS%
|
---|
| 88 | echo.
|
---|
| 89 | echo.
|
---|
| 90 | echo.
|
---|
| 91 | rem Ask the user what to compile
|
---|
| 92 | echo What do you want to compile?
|
---|
| 93 | echo.
|
---|
| 94 | echo 1. Local library only
|
---|
| 95 | echo 2. Web library only
|
---|
| 96 | echo 3. Both
|
---|
| 97 | echo 4. Quit
|
---|
| 98 | echo.
|
---|
| 99 | echo 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
|
---|
| 109 | nmake /f win32.mak
|
---|
| 110 | GOTO ENDOK
|
---|
| 111 |
|
---|
| 112 | :WITHLOCALLIB
|
---|
| 113 | nmake /f win32.mak LOCAL_LIBRARY=1
|
---|
| 114 | GOTO ENDOK
|
---|
| 115 |
|
---|
| 116 | :WITHBOTH
|
---|
| 117 | nmake /f win32.mak
|
---|
| 118 | nmake /f win32.mak LOCAL_LIBRARY=1
|
---|
| 119 | GOTO ENDOK
|
---|
| 120 |
|
---|
| 121 | :NEEDUNZIP
|
---|
| 122 | echo.
|
---|
| 123 | echo /!\ Error /!\ - Some or all the packages are not properly extracted.
|
---|
| 124 | echo.
|
---|
| 125 | echo If you wish to compile Greenstone 2 you need to unzip the required packages now.
|
---|
| 126 | echo.
|
---|
| 127 | rem Ask to Unzip the packages now otherwise quit
|
---|
| 128 | echo 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
|
---|
| 135 | echo.
|
---|
| 136 | echo /!\ Error /!\ - Winbin has not been found.
|
---|
| 137 | echo This is required to get the conversion tools used for importing different types of files.
|
---|
| 138 | echo For more info please visit this page
|
---|
| 139 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
|
---|
| 140 | GOTO END
|
---|
| 141 |
|
---|
| 142 | :ENDNOUNZIP
|
---|
| 143 | echo.
|
---|
| 144 | echo /!\ Error /!\ - unzip.exe has not been found.
|
---|
| 145 | echo This is required to extract the packages required for compilation.
|
---|
| 146 | echo This tool is part of the Winbin folder, more info on this web page:
|
---|
| 147 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
|
---|
| 148 | GOTO END
|
---|
| 149 |
|
---|
| 150 | :ENDNOWINPACK
|
---|
| 151 | echo.
|
---|
| 152 | echo /!\ Error /!\ - Windows packages are missing.
|
---|
| 153 | echo Some required packages are missing in .\common-src\packages\windows\
|
---|
| 154 | echo Please go to this page for more information on how to get everything:
|
---|
| 155 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
|
---|
| 156 | GOTO END
|
---|
| 157 |
|
---|
| 158 | :ENDNOICONV
|
---|
| 159 | echo.
|
---|
| 160 | echo /!\ Error /!\ - Indexers are missing.
|
---|
| 161 | echo Some required packages are missing in .\common-src\indexers\packages\windows\
|
---|
| 162 | echo Please go to this page for more information on how to get everything:
|
---|
| 163 | echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
|
---|
| 164 | GOTO END
|
---|
| 165 |
|
---|
| 166 | :ENDNOVCVARS32
|
---|
| 167 | echo.
|
---|
| 168 | echo /!\ Error /!\ - Not able to find 'vcvars32.bat'.
|
---|
| 169 | echo You need Visual Studio to compile the source code but we were
|
---|
| 170 | echo unable to find the file vcvars32.bat in your system.
|
---|
| 171 | echo.
|
---|
| 172 | echo Please edit this bat file and manually set the full path to
|
---|
| 173 | echo vcvars32.bat then run this script again.
|
---|
| 174 | GOTO END
|
---|
| 175 |
|
---|
| 176 | :ENDOK
|
---|
| 177 | echo.
|
---|
| 178 | echo Done!
|
---|
| 179 | echo.
|
---|
| 180 | echo This program is free software; you can redistribute it and/or
|
---|
| 181 | echo modify it under the terms of the GNU General Public License
|
---|
| 182 | echo as published by the Free Software Foundation; either version 2
|
---|
| 183 | echo of the License, or (at your option) any later version.
|
---|
| 184 | echo.
|
---|
| 185 | echo This program is distributed in the hope that it will be useful,
|
---|
| 186 | echo but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 187 | echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 188 | echo GNU General Public License for more details.
|
---|
| 189 | echo.
|
---|
| 190 | GOTO END
|
---|
| 191 |
|
---|
| 192 | :END |
---|