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 if "%1"=="" goto blank
15 if "%1"=="wnt" goto wnt
16 if "%1"=="w2k" goto w2k
17 if "%1"=="clean" goto clean
18 echo Unknown build command: %1 %2 %3 %4
21 echo Must specify build command!
24 echo where "cmd" is one of either:
26 echo w2k -- Windows with Win2k Kerb
27 echo clean -- to remove obj, lib, and exe files from source
31 echo PC-Alpine for Windows/Winsock (Win32) build sequence
32 set cclntmake=makefile.nt
33 set alpinemake=makefile.wnt
34 if not defined ALPINE_LIBRESSL set ALPINE_LIBRESSL=%cd%\libressl
35 if exist "%ALPINE_LIBRESSL%" goto yeslibresslwnt
36 echo NOT including LIBRESSL functionality
39 set libresslextralibes="crypt32.lib"
42 set libresslflags=-I\"%ALPINE_LIBRESSL%\"\include -DENABLE_WINDOWS_LIBRESSL -DLIBRESSL_INTERNAL
43 set libressllibes=\"%ALPINE_LIBRESSL%\"\x86\libcrypto-41.lib \"%ALPINE_LIBRESSL%\"\x86\libssl-43.lib \"%ALPINE_LIBRESSL%\"\x86\libtls-15.lib
44 set libresslextralibes=
46 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
47 if exist "%ALPINE_LDAP%" goto yesldapwnt
48 echo NOT including LDAP functionality
53 echo including LDAP functionality
54 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
55 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
57 set extracflagsnq=/DWINVER=0x0501 /Zi -Od %ldapflags% %libresslflags% -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSPCL_REMARKS=\"\\\"\\\"\"
58 set extralibes="%libresslextralibes%"
59 set extralibesalpine="%ldaplibes% %libressllibes%"
60 set extrarcflags="/D_PCP_WNT"
65 echo Krb5ized PC-Alpine for Windows/Winsock (Win32) build sequence
66 set cclntmake=makefile.w2k
67 set alpinemake=makefile.wnt
68 if not defined ALPINE_LIBRESSL set ALPINE_LIBRESSL=%cd%\libressl
69 if exist "%ALPINE_LIBRESSL%" goto yeslibresslw2k
70 echo NOT including LIBRESSL functionality
73 set libresslextralibes="crypt32.lib"
76 set libresslflags=-I\"%ALPINE_LIBRESSL%\"\include -DENABLE_WINDOWS_LIBRESSL -DLIBRESSL_INTERNAL
77 set libressllibes=\"%ALPINE_LIBRESSL%\"\x86\libcrypto-41.lib \"%ALPINE_LIBRESSL%\"\x86\libssl-43.lib \"%ALPINE_LIBRESSL%\"\x86\libtls-15.lib
78 set libresslextralibes=
80 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
81 if exist "%ALPINE_LDAP%" goto yesldapw2k
82 echo NOT including LDAP functionality
87 echo including LDAP functionality
88 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
89 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
91 set extracflagsnq=/DWINVER=0x0501 /Zi -Od %ldapflags% -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSPCFC_WINVER=\"\\\" 2000\\\"\" -DSPCL_REMARKS=\"\\\" with krb5\\\"\"
92 set extralibes="secur32.lib %libresslextralibes%"
93 set extralibesalpine="secur32.lib crypt32.lib %ldaplibes% %libressllibes%"
94 set extrarcflags="/D_PCP_W2K"
99 echo Sure you want to delete object, library and executable files?!?!
100 echo If NOT, type Ctrl-C to terminate build script NOW. Type ENTER if you do.
102 echo Cleaning alpine, pico, mailutil, mapi, and c-client directories
105 del /Q c-client\*.pdb
106 del /Q c-client-dll\*.pdb
107 rem del /Q mailutil\*.pdb
108 rem del /Q mapi\*.pdb
112 del /Q alpine\osdep\*.pdb
113 del /Q pico\osdep\*.pdb
114 del /Q pith\charconv\*.pdb
115 del /Q pith\osdep\*.pdb
118 rem del /Q mapi\*.ilk
121 set alpinemake=makefile.wnt
122 set extramakecommand=clean
123 if NOT exist c-client goto nocclient
127 if NOT exist c-client-dll goto nocclientdll
128 del /Q c-client-dll\*
131 set cclntmake=makefile.w2k
135 if not exist c-client mkdir c-client
136 if not defined ALPINE_IMAP set ALPINE_IMAP=imap
137 echo Copying imap files to c-client directory
138 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client\ > garbageout.txt
139 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client\ > garbageout.txt
140 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client\ > garbageout.txt
142 rem if not exist c-client-dll mkdir c-client-dll
143 rem copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client-dll\ > garbageout.txt
144 rem copy /Y "%ALPINE_IMAP%"\src\charset\* c-client-dll\ > garbageout.txt
145 rem copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client-dll\ > garbageout.txt
146 rem del garbageout.txt
147 if not exist mailutil mkdir mailutil
148 copy /Y "%ALPINE_IMAP%"\src\mailutil\* mailutil\ > garbageout.txt
153 set extraldflags="/DEBUG /DEBUGTYPE:CV"
154 set extracflags="%extracflagsnq%"
155 set extradllcflags="%extracflagsnq% /D_DLL"
159 echo Building c-client...
161 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
162 if errorlevel 1 goto bogus
167 if exist mailutil goto yesbuildmailutil
170 echo Building mailutil
172 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
173 if errorlevel 1 goto bogus
179 echo Building pith-osdep...
181 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
182 if errorlevel 1 goto bogus
187 echo Building pith-charconv...
189 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
190 if errorlevel 1 goto bogus
195 echo Building pith...
197 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
198 if errorlevel 1 goto bogus
203 echo Building regex...
205 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
206 if errorlevel 1 goto bogus
211 echo Building pico-osdep...
213 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
214 if errorlevel 1 goto bogus
219 echo Building pico...
221 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
222 if errorlevel 1 goto bogus
227 echo Building alpine-osdep...
229 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
230 if errorlevel 1 goto bogus
235 echo Building alpine...
237 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibesalpine% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
238 if errorlevel 1 goto bogus
243 if NOT exist c-client-dll goto buildmapi
244 echo Building c-client-dll
246 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extradllcflags% %extramakecommand%
247 if errorlevel 1 goto bogus
254 nmake -nologo -f makefile EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
255 if errorlevel 1 goto bogus
259 echo Alpine build complete.
263 echo Problems building Alpine!