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