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 echo including LIBRESSL functionality
43 set libresslflags=-I\"%ALPINE_LIBRESSL%\"\include -I\"%ALPINE_LIBRESSL%\"\include\openssl -DENABLE_WINDOWS_LIBRESSL
44 set libressllibes=\"%ALPINE_LIBRESSL%\"\x86\libcrypto-41.lib \"%ALPINE_LIBRESSL%\"\x86\libssl-43.lib \"%ALPINE_LIBRESSL%\"\x86\libtls-15.lib
45 set libresslextralibes=
47 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
48 if exist "%ALPINE_LDAP%" goto yesldapwnt
49 echo NOT including LDAP functionality
54 echo including LDAP functionality
55 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
56 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
58 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=\"\\\"\\\"\"
59 set extralibes="%libresslextralibes%"
60 set extralibesalpine="%ldaplibes% %libressllibes%"
61 set extrarcflags="/D_PCP_WNT"
66 echo Krb5ized PC-Alpine for Windows/Winsock (Win32) build sequence
67 set cclntmake=makefile.w2k
68 set alpinemake=makefile.wnt
69 if not defined ALPINE_LIBRESSL set ALPINE_LIBRESSL=%cd%\libressl
70 if exist "%ALPINE_LIBRESSL%" goto yeslibresslw2k
71 echo NOT including LIBRESSL functionality
74 set libresslextralibes="crypt32.lib"
77 echo including LIBRESSL functionality
78 set libresslflags=-I\"%ALPINE_LIBRESSL%\"\include -I\"%ALPINE_LIBRESSL%\"\include\openssl -DENABLE_WINDOWS_LIBRESSL
79 set libressllibes=\"%ALPINE_LIBRESSL%\"\x86\libcrypto-41.lib \"%ALPINE_LIBRESSL%\"\x86\libssl-43.lib \"%ALPINE_LIBRESSL%\"\x86\libtls-15.lib
80 set libresslextralibes=
82 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
83 if exist "%ALPINE_LDAP%" goto yesldapw2k
84 echo NOT including LDAP functionality
89 echo including LDAP functionality
90 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
91 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
93 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\\\"\"
94 set extralibes="secur32.lib %libresslextralibes%"
95 set extralibesalpine="secur32.lib crypt32.lib %ldaplibes% %libressllibes%"
96 set extrarcflags="/D_PCP_W2K"
101 echo Sure you want to delete object, library and executable files?!?!
102 echo If NOT, type Ctrl-C to terminate build script NOW. Type ENTER if you do.
104 echo Cleaning alpine, pico, mailutil, mapi, and c-client directories
107 del /Q c-client\*.pdb
108 del /Q c-client-dll\*.pdb
109 rem del /Q mailutil\*.pdb
110 rem del /Q mapi\*.pdb
114 del /Q alpine\osdep\*.pdb
115 del /Q pico\osdep\*.pdb
116 del /Q pith\charconv\*.pdb
117 del /Q pith\osdep\*.pdb
120 rem del /Q mapi\*.ilk
123 set alpinemake=makefile.wnt
124 set extramakecommand=clean
125 if NOT exist c-client goto nocclient
129 if NOT exist c-client-dll goto nocclientdll
130 del /Q c-client-dll\*
133 set cclntmake=makefile.w2k
137 if not exist c-client mkdir c-client
138 if not defined ALPINE_IMAP set ALPINE_IMAP=imap
139 echo Copying imap files to c-client directory
140 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client\ > garbageout.txt
141 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client\ > garbageout.txt
142 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client\ > garbageout.txt
144 rem if not exist c-client-dll mkdir c-client-dll
145 rem copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client-dll\ > garbageout.txt
146 rem copy /Y "%ALPINE_IMAP%"\src\charset\* c-client-dll\ > garbageout.txt
147 rem copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client-dll\ > garbageout.txt
148 rem del garbageout.txt
149 if not exist mailutil mkdir mailutil
150 copy /Y "%ALPINE_IMAP%"\src\mailutil\* mailutil\ > garbageout.txt
155 set extraldflags="/DEBUG /DEBUGTYPE:CV"
156 set extracflags="%extracflagsnq%"
157 set extradllcflags="%extracflagsnq% /D_DLL"
161 echo Building c-client...
163 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% EXTRALIBES=%extralibes% %extramakecommand%
164 if errorlevel 1 goto bogus
169 if exist mailutil goto yesbuildmailutil
172 echo Building mailutil
174 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% LIBRESSLLIBS="%libressllibes%" %extramakecommand%
175 if errorlevel 1 goto bogus
181 echo Building pith-osdep...
183 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
184 if errorlevel 1 goto bogus
189 echo Building pith-charconv...
191 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
192 if errorlevel 1 goto bogus
197 echo Building pith...
199 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
200 if errorlevel 1 goto bogus
205 echo Building regex...
207 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% %extramakecommand%
208 if errorlevel 1 goto bogus
213 echo Building pico-osdep...
215 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% %extramakecommand%
216 if errorlevel 1 goto bogus
221 echo Building pico...
223 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% %extramakecommand%
224 if errorlevel 1 goto bogus
229 echo Building alpine-osdep...
231 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
232 if errorlevel 1 goto bogus
237 echo Building alpine...
239 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% LIBRESSLLIBS="%libressllibes%" EXTRALIBES=%extralibesalpine% LDAPLIBS=%ldaplibes% EXTRALDFLAGS=%extraldflags% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
240 if errorlevel 1 goto bogus
245 if NOT exist c-client-dll goto buildmapi
246 echo Building c-client-dll
248 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extradllcflags% %extramakecommand%
249 if errorlevel 1 goto bogus
256 nmake -nologo -f makefile EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% LDAPLIBS=%ldaplibes% %extramakecommand%
257 if errorlevel 1 goto bogus
261 echo Alpine build complete.
265 echo Problems building Alpine!