* TLS 1.2 works does not work if Alpine is compiled with openssl >= 1.1.0.
[alpine.git] / build.bat
blob30455feee48774cef2f0a2a4f7f57a7e4fc4928f
1 @echo OFF
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
5 rem
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
9 rem
10 rem     http://www.apache.org/licenses/LICENSE-2.0
11 rem
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
19 goto usage
20 :blank
21 echo Must specify build command!
22 :usage
23 echo usage: BUILD cmd
24 echo   where "cmd" is one of either:
25 echo         wnt        -- Windows
26 echo         w2k        -- Windows with Win2k Kerb
27 echo         clean      -- to remove obj, lib, and exe files from source
28 goto fini
30 :wnt
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_LDAP set ALPINE_LDAP=%cd%\ldap
35 if exist "%ALPINE_LDAP%" goto yesldapwnt
36 echo NOT including LDAP functionality
37 set ldapinclude=
38 set ldaplibes=
39 goto noldapwnt
40 :yesldapwnt
41 echo including LDAP functionality
42 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
43 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
44 :noldapwnt
45 set extracflagsnq=/DWINVER=0x0501 /Zi -Od %ldapflags% -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSPCL_REMARKS=\"\\\"\\\"\"
46 set extralibes=
47 set extralibesalpine=%ldaplibes%
48 set extrarcflags="/D_PCP_WNT"
49 set extramakecommand=
50 goto buildsetup
52 :w2k
53 echo Krb5ized PC-Pine for Windows/Winsock (Win32) build sequence
54 set cclntmake=makefile.w2k
55 set alpinemake=makefile.wnt
56 if not defined ALPINE_LDAP set ALPINE_LDAP=%cd%\ldap
57 if exist "%ALPINE_LDAP%" goto yesldapw2k
58 echo NOT including LDAP functionality
59 set ldapinclude=
60 set ldaplibes=
61 goto noldapw2k
62 :yesldapw2k
63 echo including LDAP functionality
64 set ldapflags=-I\"%ALPINE_LDAP%\"\inckit -DENABLE_LDAP
65 set ldaplibes=\"%ALPINE_LDAP%\"\binaries\release\ldap32.lib
66 :noldapw2k
67 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\\\"\"
68 set extralibes="secur32.lib"
69 set extralibesalpine="secur32.lib %ldaplibes%"
70 set extrarcflags="/D_PCP_W2K"
71 set extramakecommand=
72 goto buildsetup
74 :clean
75 echo Sure you want to delete object, library and executable files?!?!
76 echo If NOT, type Ctrl-C to terminate build script NOW.  Type ENTER if you do.
77 pause
78 echo Cleaning alpine, pico, mailutil, mapi, and c-client directories
79 echo del *.pdb
80 del /Q alpine\*.pdb
81 del /Q c-client\*.pdb
82 del /Q c-client-dll\*.pdb
83 rem del /Q mailutil\*.pdb
84 rem del /Q mapi\*.pdb
85 del /Q pico\*.pdb
86 del /Q pith\*.pdb
87 del /Q regex\*.pdb
88 del /Q alpine\osdep\*.pdb
89 del /Q pico\osdep\*.pdb
90 del /Q pith\charconv\*.pdb
91 del /Q pith\osdep\*.pdb
92 echo del *.ilk
93 del /Q alpine\*.ilk
94 rem del /Q mapi\*.ilk
95 del /Q pico\*.ilk
96 del /Q pith\*.ilk
97 set alpinemake=makefile.wnt
98 set extramakecommand=clean
99 if NOT exist c-client goto nocclient
100 del /Q c-client\*
101 rmdir c-client
102 :nocclient
103 if NOT exist c-client-dll goto nocclientdll
104 del /Q c-client-dll\*
105 rmdir c-client-dll
106 :nocclientdll
107 set cclntmake=makefile.w2k
108 goto buildmailutil
110 :buildsetup
111 if not exist c-client mkdir c-client
112 if not defined ALPINE_IMAP set ALPINE_IMAP=imap
113 echo Copying imap files to c-client directory
114 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client\ > garbageout.txt
115 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client\ > garbageout.txt
116 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client\ > garbageout.txt
117 del garbageout.txt
118 if not exist c-client-dll mkdir c-client-dll
119 copy /Y "%ALPINE_IMAP%"\src\c-client\* c-client-dll\ > garbageout.txt
120 copy /Y "%ALPINE_IMAP%"\src\charset\* c-client-dll\ > garbageout.txt
121 copy /Y "%ALPINE_IMAP%"\src\osdep\nt\* c-client-dll\ > garbageout.txt
122 del garbageout.txt
123 if not exist mailutil mkdir mailutil
124 copy /Y "%ALPINE_IMAP%"\src\mailutil\* mailutil\ > garbageout.txt
125 del garbageout.txt
126 goto build
128 :build
129 set extraldflags="/DEBUG /DEBUGTYPE:CV"
130 set extracflags="%extracflagsnq%"
131 set extradllcflags="%extracflagsnq% /D_DLL"
132 goto buildcclnt
134 :buildcclnt
135 echo Building c-client...
136 cd c-client
137 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
138 if errorlevel 1 goto bogus
139 cd ..
140 goto buildmailutil
142 :buildmailutil
143 if exist mailutil goto yesbuildmailutil
144 goto nobuildmailutil
145 :yesbuildmailutil
146 echo Building mailutil
147 cd mailutil
148 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extracflags% %extramakecommand%
149 if errorlevel 1 goto bogus
150 cd ..
151 :nobuildmailutil
152 goto buildpithosd
154 :buildpithosd
155 echo Building pith-osdep...
156 cd pith\osdep
157 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
158 if errorlevel 1 goto bogus
159 cd ..\..
160 goto buildpithcc
162 :buildpithcc
163 echo Building pith-charconv...
164 cd pith\charconv
165 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
166 if errorlevel 1 goto bogus
167 cd ..\..
168 goto buildpith
170 :buildpith
171 echo Building pith...
172 cd pith
173 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
174 if errorlevel 1 goto bogus
175 cd ..
176 goto buildregex
178 :buildregex
179 echo Building regex...
180 cd regex
181 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
182 if errorlevel 1 goto bogus
183 cd ..
184 goto buildpicoosd
186 :buildpicoosd
187 echo Building pico-osdep...
188 cd pico\osdep
189 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
190 if errorlevel 1 goto bogus
191 cd ..\..
192 goto buildpico
194 :buildpico
195 echo Building pico...
196 cd pico
197 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
198 if errorlevel 1 goto bogus
199 cd ..
200 goto buildalpineosd
202 :buildalpineosd
203 echo Building alpine-osdep...
204 cd alpine\osdep
205 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
206 if errorlevel 1 goto bogus
207 cd ..\..
208 goto buildalpine
210 :buildalpine
211 echo Building alpine...
212 cd alpine
213 nmake -nologo -f %alpinemake% wnt=1 EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibesalpine% EXTRARCFLAGS=%extrarcflags% %extramakecommand%
214 if errorlevel 1 goto bogus
215 cd ..
216 goto buildcclntdll
218 :buildcclntdll
219 if NOT exist c-client-dll goto buildmapi
220 echo Building c-client-dll
221 cd c-client-dll
222 nmake -nologo -f %cclntmake% EXTRACFLAGS=%extradllcflags% %extramakecommand%
223 if errorlevel 1 goto bogus
224 cd ..
225 goto buildmapi
227 :buildmapi
228 echo Building mapi
229 cd mapi
230 nmake -nologo -f makefile EXTRACFLAGS=%extracflags% EXTRALDFLAGS=%extraldflags% EXTRALIBES=%extralibes% %extramakecommand%
231 if errorlevel 1 goto bogus
232 cd ..
234 :nobuildmapi
235 echo Alpine build complete.
236 goto fini
238 :bogus
239 echo Problems building Alpine!
241 :fini