2 rem $Id: build.bat 14098 2005-10-03 18:54:13Z jpf@u.washington.edu $
3 rem ========================================================================
4 rem Copyright 2006-2007 University of Washington
6 rem Licensed under the Apache License, Version 2.0 (the "License");
7 rem you may not use this file except in compliance with the License.
8 rem You may obtain a copy of the License at
10 rem http://www.apache.org/licenses/LICENSE-2.0
12 rem ========================================================================
14 rem These are the default values, which we might override below
15 rem by setting them to older versions
20 if "%1"=="" goto blank
21 if "%1"=="wnt" goto wnt
22 if "%1"=="wxp" goto wxp
23 if "%1"=="w32" goto w32
24 if "%1"=="w2k" goto w2k
25 if "%1"=="clean" goto clean
26 echo Unknown build command: %1 %2 %3 %4
29 echo Must specify build command!
32 echo where "cmd" is one of either:
34 echo w32 -- Windows 32 bits (not Windows XP)
35 echo wxp -- Windows XP
36 echo w2k -- Windows with Win2k Kerb
37 echo clean -- to remove obj, lib, and exe files from source
45 set windows32build=-DWXPBUILD -D__MINGW_USE_VC2005_COMPAT
49 rem this port uses the default values for libcrypto and friends.
51 set windows32build=-DW32BITSBUILD -D__MINGW_USE_VC2005_COMPAT
54 rem this port uses the default values for libcrypto and friends.
58 echo PC-Alpine for Windows/Winsock (Win32) build sequence
59 set cclntmake=makefile.nt
60 set alpinemake=makefile.wnt
61 if not defined ALPINE_LIBRESSL set ALPINE_LIBRESSL=%cd%\libressl
62 if exist "%ALPINE_LIBRESSL%" goto yeslibresslwnt
63 echo NOT including LIBRESSL functionality
66 set libresslextralibes="crypt32.lib"
69 echo including LIBRESSL functionality
70 set libresslflags=-I\"%ALPINE_LIBRESSL%\"\include\"%BIT%\" -I\"%ALPINE_LIBRESSL%\"\include\"%BIT%\"\openssl -DENABLE_WINDOWS_LIBRESSL
71 set libressllibes=\"%ALPINE_LIBRESSL%\"\x86\libcrypto-%CRYPTO_VERSION%.lib \"%ALPINE_LIBRESSL%\"\x86\libssl-%SSL_VERSION%.lib \"%ALPINE_LIBRESSL%\"\x86\libtls-%TLS_VERSION%.lib
72 set libresslextralibes=
74 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
75 if exist "%ALPINE_LDAP%" goto yesldapwnt
76 echo NOT including LDAP functionality
81 echo including LDAP functionality
82 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
83 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
85 set extracflagsnq=/DWINVER=0x0501 /Zi -Od %ldapflags% %libresslflags% %windows32build% -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSPCL_REMARKS=\"\\\"\\\"\"
86 set extralibes="%libresslextralibes%"
87 set extralibesalpine="%ldaplibes% %libressllibes%"
88 set extrarcflags="/D_PCP_WNT"
93 echo Krb5ized PC-Alpine for Windows/Winsock (Win32) build sequence
94 set cclntmake=makefile.w2k
95 set alpinemake=makefile.wnt
96 if not defined ALPINE_LIBRESSL set ALPINE_LIBRESSL=%cd%\libressl
97 if exist "%ALPINE_LIBRESSL%" goto yeslibresslw2k
98 echo NOT including LIBRESSL functionality
101 set libresslextralibes="crypt32.lib"
104 echo including LIBRESSL functionality
105 set libresslflags=-I\"%ALPINE_LIBRESSL%\"\include -I\"%ALPINE_LIBRESSL%\"\include\openssl -DENABLE_WINDOWS_LIBRESSL
106 set libressllibes=\"%ALPINE_LIBRESSL%\"\x86\libcrypto-45.lib \"%ALPINE_LIBRESSL%\"\x86\libssl-47.lib \"%ALPINE_LIBRESSL%\"\x86\libtls-19.lib
107 set libresslextralibes=
109 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
110 if exist "%ALPINE_LDAP%" goto yesldapw2k
111 echo NOT including LDAP functionality
116 echo including LDAP functionality
117 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
118 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
120 set extracflagsnq=/DWINVER=0x0501 /Zi -Od %ldapflags% %libresslflags% -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSPCFC_WINVER=\"\\\" 2000\\\"\" -DSPCL_REMARKS=\"\\\" with krb5\\\"\"
121 set extralibes="secur32.lib %libresslextralibes%"
122 set extralibesalpine="secur32.lib crypt32.lib %ldaplibes% %libressllibes%"
123 set extrarcflags="/D_PCP_W2K"
124 set extramakecommand=
128 echo Sure you want to delete object, library and executable files?!?!
129 echo If NOT, type Ctrl-C to terminate build script NOW. Type ENTER if you do.
131 echo Cleaning alpine, pico, mailutil, mapi, and c-client directories
134 del /Q c-client\*.pdb
135 del /Q c-client-dll\*.pdb
136 rem del /Q mailutil\*.pdb
137 rem del /Q mapi\*.pdb
141 del /Q alpine\osdep\*.pdb
142 del /Q pico\osdep\*.pdb
143 del /Q pith\charconv\*.pdb
144 del /Q pith\osdep\*.pdb
147 rem del /Q mapi\*.ilk
150 set alpinemake=makefile.wnt
151 set extramakecommand=clean
152 if NOT exist c-client goto nocclient
156 if NOT exist c-client-dll goto nocclientdll
157 del /Q c-client-dll\*
160 set cclntmake=makefile.w2k
164 if not exist c-client mkdir c-client
165 if not defined ALPINE_IMAP set ALPINE_IMAP=imap
166 echo Copying imap files to c-client directory
167 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client\ > garbageout.txt
168 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client\ > garbageout.txt
169 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client\ > garbageout.txt
171 rem if not exist c-client-dll mkdir c-client-dll
172 rem copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client-dll\ > garbageout.txt
173 rem copy /Y "%ALPINE_IMAP%"\src\charset\* c-client-dll\ > garbageout.txt
174 rem copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client-dll\ > garbageout.txt
175 rem del garbageout.txt
176 if not exist mailutil mkdir mailutil
177 copy /Y "%ALPINE_IMAP%"\src\mailutil\* mailutil\ > garbageout.txt
179 if defined ALPINE_LIBRESSL del /Q libressl\x86\lib*.lib
180 if defined ALPINE_LIBRESSL del /Q alpine\lib*.dll
181 if defined ALPINE_LIBRESSL copy /Y libressl\x86\"%1%"\* libressl\x86\ > garbageout.txt
182 if defined ALPINE_LIBRESSL copy /Y alpine\DLL\"%1%"\* alpine\ > garbageout.txt
183 if defined ALPINE_LIBRESSL del garbageout.txt
187 set extraldflags="/DEBUG /DEBUGTYPE:CV"
188 set extracflags="%extracflagsnq%"
189 set extradllcflags="%extracflagsnq% /D_DLL"
193 echo Building c-client...
195 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% EXTRALIBES=%extralibes% %extramakecommand%
196 if errorlevel 1 goto bogus
201 if exist mailutil goto yesbuildmailutil
204 echo Building mailutil
206 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% LIBRESSLLIBS="%libressllibes%" %extramakecommand%
207 if errorlevel 1 goto bogus
213 echo Building pith-osdep...
215 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
216 if errorlevel 1 goto bogus
221 echo Building pith-charconv...
223 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
224 if errorlevel 1 goto bogus
229 echo Building pith...
231 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
232 if errorlevel 1 goto bogus
237 echo Building regex...
239 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% %extramakecommand%
240 if errorlevel 1 goto bogus
245 echo Building pico-osdep...
247 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% %extramakecommand%
248 if errorlevel 1 goto bogus
253 echo Building pico...
255 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% %extramakecommand%
256 if errorlevel 1 goto bogus
261 echo Building alpine-osdep...
263 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
264 if errorlevel 1 goto bogus
269 echo Building alpine...
271 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% LIBRESSLLIBS="%libressllibes%" EXTRALIBES=%extralibesalpine% LDAPLIBS=%ldaplibes% EXTRALDFLAGS=%extraldflags% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
272 if errorlevel 1 goto bogus
277 if NOT exist c-client-dll goto buildmapi
278 echo Building c-client-dll
280 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extradllcflags% %extramakecommand%
281 if errorlevel 1 goto bogus
288 nmake -nologo -f makefile EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% LDAPLIBS=%ldaplibes% %extramakecommand%
289 if errorlevel 1 goto bogus
293 echo Alpine build complete.
297 echo Problems building Alpine!