]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | @ECHO OFF |
2 | ||
3 | REM ~ Copyright 2002-2007 Rene Rivera. | |
4 | REM ~ Distributed under the Boost Software License, Version 1.0. | |
5 | REM ~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | setlocal | |
8 | goto Start | |
9 | ||
10 | ||
11 | :Set_Error | |
12 | color 00 | |
13 | goto :eof | |
14 | ||
15 | ||
16 | :Clear_Error | |
17 | ver >nul | |
18 | goto :eof | |
19 | ||
20 | ||
21 | :Error_Print | |
22 | REM Output an error message and set the errorlevel to indicate failure. | |
23 | setlocal | |
24 | ECHO ### | |
25 | ECHO ### %1 | |
26 | ECHO ### | |
27 | ECHO ### You can specify the toolset as the argument, i.e.: | |
28 | ECHO ### .\build.bat msvc | |
29 | ECHO ### | |
30 | ECHO ### Toolsets supported by this script are: borland, como, gcc, gcc-nocygwin, | |
31 | ECHO ### intel-win32, metrowerks, mingw, msvc, vc7, vc8, vc9, vc10, vc11, vc12, vc14, vc15 | |
32 | ECHO ### | |
33 | call :Set_Error | |
34 | endlocal | |
35 | goto :eof | |
36 | ||
37 | ||
38 | :Test_Path | |
39 | REM Tests for the given executable file presence in the directories in the PATH | |
40 | REM environment variable. Additionaly sets FOUND_PATH to the path of the | |
41 | REM found file. | |
42 | call :Clear_Error | |
43 | setlocal | |
44 | set test=%~$PATH:1 | |
45 | endlocal | |
46 | if not errorlevel 1 set FOUND_PATH=%~dp$PATH:1 | |
47 | goto :eof | |
48 | ||
49 | ||
50 | :Test_Option | |
51 | REM Tests whether the given string is in the form of an option: "--*" | |
52 | call :Clear_Error | |
53 | setlocal | |
54 | set test=%1 | |
55 | if not defined test ( | |
56 | call :Set_Error | |
57 | goto Test_Option_End | |
58 | ) | |
59 | set test=###%test%### | |
60 | set test=%test:"###=% | |
61 | set test=%test:###"=% | |
62 | set test=%test:###=% | |
63 | if not "-" == "%test:~1,1%" call :Set_Error | |
64 | :Test_Option_End | |
65 | endlocal | |
66 | goto :eof | |
67 | ||
68 | ||
69 | :Test_Empty | |
70 | REM Tests whether the given string is not empty | |
71 | call :Clear_Error | |
72 | setlocal | |
73 | set test=%1 | |
74 | if not defined test ( | |
75 | call :Clear_Error | |
76 | goto Test_Empty_End | |
77 | ) | |
78 | set test=###%test%### | |
79 | set test=%test:"###=% | |
80 | set test=%test:###"=% | |
81 | set test=%test:###=% | |
82 | if not "" == "%test%" call :Set_Error | |
83 | :Test_Empty_End | |
84 | endlocal | |
85 | goto :eof | |
86 | ||
87 | ||
88 | :Call_If_Exists | |
89 | if EXIST %1 call %* | |
90 | goto :eof | |
91 | ||
92 | ||
93 | :Guess_Toolset | |
94 | REM Try and guess the toolset to bootstrap the build with... | |
95 | REM Sets BOOST_JAM_TOOLSET to the first found toolset. | |
96 | REM May also set BOOST_JAM_TOOLSET_ROOT to the | |
97 | REM location of the found toolset. | |
98 | ||
99 | call :Clear_Error | |
100 | call :Test_Empty %ProgramFiles% | |
101 | if not errorlevel 1 set ProgramFiles=C:\Program Files | |
102 | ||
103 | call :Clear_Error | |
104 | if NOT "_%VS150COMNTOOLS%_" == "__" ( | |
105 | set "BOOST_JAM_TOOLSET=vc15" | |
106 | set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\" | |
107 | goto :eof) | |
108 | call :Clear_Error | |
109 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 15.0\VC\VCVARSALL.BAT" ( | |
110 | set "BOOST_JAM_TOOLSET=vc15" | |
111 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 15.0\VC\" | |
112 | goto :eof) | |
113 | call :Clear_Error | |
114 | if NOT "_%VS140COMNTOOLS%_" == "__" ( | |
115 | set "BOOST_JAM_TOOLSET=vc14" | |
116 | set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\" | |
117 | goto :eof) | |
118 | call :Clear_Error | |
119 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 14.0\VC\VCVARSALL.BAT" ( | |
120 | set "BOOST_JAM_TOOLSET=vc14" | |
121 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 14.0\VC\" | |
122 | goto :eof) | |
123 | call :Clear_Error | |
124 | if NOT "_%VS120COMNTOOLS%_" == "__" ( | |
125 | set "BOOST_JAM_TOOLSET=vc12" | |
126 | set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\" | |
127 | goto :eof) | |
128 | call :Clear_Error | |
129 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\VCVARSALL.BAT" ( | |
130 | set "BOOST_JAM_TOOLSET=vc12" | |
131 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 12.0\VC\" | |
132 | goto :eof) | |
133 | call :Clear_Error | |
134 | if NOT "_%VS110COMNTOOLS%_" == "__" ( | |
135 | set "BOOST_JAM_TOOLSET=vc11" | |
136 | set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\" | |
137 | goto :eof) | |
138 | call :Clear_Error | |
139 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\VCVARSALL.BAT" ( | |
140 | set "BOOST_JAM_TOOLSET=vc11" | |
141 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 11.0\VC\" | |
142 | goto :eof) | |
143 | call :Clear_Error | |
144 | if NOT "_%VS100COMNTOOLS%_" == "__" ( | |
145 | set "BOOST_JAM_TOOLSET=vc10" | |
146 | set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\" | |
147 | goto :eof) | |
148 | call :Clear_Error | |
149 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 10.0\VC\VCVARSALL.BAT" ( | |
150 | set "BOOST_JAM_TOOLSET=vc10" | |
151 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 10.0\VC\" | |
152 | goto :eof) | |
153 | call :Clear_Error | |
154 | if NOT "_%VS90COMNTOOLS%_" == "__" ( | |
155 | set "BOOST_JAM_TOOLSET=vc9" | |
156 | set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\" | |
157 | goto :eof) | |
158 | call :Clear_Error | |
159 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\VCVARSALL.BAT" ( | |
160 | set "BOOST_JAM_TOOLSET=vc9" | |
161 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\" | |
162 | goto :eof) | |
163 | call :Clear_Error | |
164 | if NOT "_%VS80COMNTOOLS%_" == "__" ( | |
165 | set "BOOST_JAM_TOOLSET=vc8" | |
166 | set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\" | |
167 | goto :eof) | |
168 | call :Clear_Error | |
169 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 8\VC\VCVARSALL.BAT" ( | |
170 | set "BOOST_JAM_TOOLSET=vc8" | |
171 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 8\VC\" | |
172 | goto :eof) | |
173 | call :Clear_Error | |
174 | if NOT "_%VS71COMNTOOLS%_" == "__" ( | |
175 | set "BOOST_JAM_TOOLSET=vc7" | |
176 | set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%\..\..\VC7\" | |
177 | goto :eof) | |
178 | call :Clear_Error | |
179 | if NOT "_%VCINSTALLDIR%_" == "__" ( | |
180 | REM %VCINSTALLDIR% is also set for VC9 (and probably VC8) | |
181 | set "BOOST_JAM_TOOLSET=vc7" | |
182 | set "BOOST_JAM_TOOLSET_ROOT=%VCINSTALLDIR%\VC7\" | |
183 | goto :eof) | |
184 | call :Clear_Error | |
185 | if EXIST "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" ( | |
186 | set "BOOST_JAM_TOOLSET=vc7" | |
187 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\" | |
188 | goto :eof) | |
189 | call :Clear_Error | |
190 | if EXIST "%ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\VCVARS32.BAT" ( | |
191 | set "BOOST_JAM_TOOLSET=vc7" | |
192 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio .NET\VC7\" | |
193 | goto :eof) | |
194 | call :Clear_Error | |
195 | if NOT "_%MSVCDir%_" == "__" ( | |
196 | set "BOOST_JAM_TOOLSET=msvc" | |
197 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" | |
198 | goto :eof) | |
199 | call :Clear_Error | |
200 | if EXIST "%ProgramFiles%\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" ( | |
201 | set "BOOST_JAM_TOOLSET=msvc" | |
202 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio\VC98\" | |
203 | goto :eof) | |
204 | call :Clear_Error | |
205 | if EXIST "%ProgramFiles%\Microsoft Visual C++\VC98\bin\VCVARS32.BAT" ( | |
206 | set "BOOST_JAM_TOOLSET=msvc" | |
207 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual C++\VC98\" | |
208 | goto :eof) | |
209 | call :Clear_Error | |
210 | call :Test_Path cl.exe | |
211 | if not errorlevel 1 ( | |
212 | set "BOOST_JAM_TOOLSET=msvc" | |
213 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" | |
214 | goto :eof) | |
215 | call :Clear_Error | |
216 | call :Test_Path vcvars32.bat | |
217 | if not errorlevel 1 ( | |
218 | set "BOOST_JAM_TOOLSET=msvc" | |
219 | call "%FOUND_PATH%VCVARS32.BAT" | |
220 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" | |
221 | goto :eof) | |
222 | call :Clear_Error | |
223 | if EXIST "C:\Borland\BCC55\Bin\bcc32.exe" ( | |
224 | set "BOOST_JAM_TOOLSET=borland" | |
225 | set "BOOST_JAM_TOOLSET_ROOT=C:\Borland\BCC55\" | |
226 | goto :eof) | |
227 | call :Clear_Error | |
228 | call :Test_Path bcc32.exe | |
229 | if not errorlevel 1 ( | |
230 | set "BOOST_JAM_TOOLSET=borland" | |
231 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" | |
232 | goto :eof) | |
233 | call :Clear_Error | |
234 | call :Test_Path icl.exe | |
235 | if not errorlevel 1 ( | |
236 | set "BOOST_JAM_TOOLSET=intel-win32" | |
237 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" | |
238 | goto :eof) | |
239 | call :Clear_Error | |
240 | if EXIST "C:\MinGW\bin\gcc.exe" ( | |
241 | set "BOOST_JAM_TOOLSET=mingw" | |
242 | set "BOOST_JAM_TOOLSET_ROOT=C:\MinGW\" | |
243 | goto :eof) | |
244 | call :Clear_Error | |
245 | if NOT "_%CWFolder%_" == "__" ( | |
246 | set "BOOST_JAM_TOOLSET=metrowerks" | |
247 | set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\" | |
248 | goto :eof ) | |
249 | call :Clear_Error | |
250 | call :Test_Path mwcc.exe | |
251 | if not errorlevel 1 ( | |
252 | set "BOOST_JAM_TOOLSET=metrowerks" | |
253 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\..\" | |
254 | goto :eof) | |
255 | call :Clear_Error | |
256 | call :Error_Print "Could not find a suitable toolset." | |
257 | goto :eof | |
258 | ||
259 | ||
260 | :Guess_Yacc | |
261 | REM Tries to find bison or yacc in common places so we can build the grammar. | |
262 | call :Clear_Error | |
263 | call :Test_Path yacc.exe | |
264 | if not errorlevel 1 ( | |
265 | set "YACC=yacc -d" | |
266 | goto :eof) | |
267 | call :Clear_Error | |
268 | call :Test_Path bison.exe | |
269 | if not errorlevel 1 ( | |
270 | set "YACC=bison -d --yacc" | |
271 | goto :eof) | |
272 | call :Clear_Error | |
273 | if EXIST "C:\Program Files\GnuWin32\bin\bison.exe" ( | |
274 | set "YACC=C:\Program Files\GnuWin32\bin\bison.exe" -d --yacc | |
275 | goto :eof) | |
276 | call :Clear_Error | |
277 | call :Error_Print "Could not find Yacc to build the Jam grammar." | |
278 | goto :eof | |
279 | ||
280 | ||
281 | :Start | |
282 | set BOOST_JAM_TOOLSET= | |
283 | set BOOST_JAM_ARGS= | |
284 | ||
285 | REM If no arguments guess the toolset; | |
286 | REM or if first argument is an option guess the toolset; | |
287 | REM otherwise the argument is the toolset to use. | |
288 | call :Clear_Error | |
289 | call :Test_Empty %1 | |
290 | if not errorlevel 1 ( | |
291 | call :Guess_Toolset | |
292 | if not errorlevel 1 ( goto Setup_Toolset ) else ( goto Finish ) | |
293 | ) | |
294 | ||
295 | call :Clear_Error | |
296 | call :Test_Option %1 | |
297 | if not errorlevel 1 ( | |
298 | call :Guess_Toolset | |
299 | if not errorlevel 1 ( goto Setup_Toolset ) else ( goto Finish ) | |
300 | ) | |
301 | ||
302 | call :Clear_Error | |
303 | set BOOST_JAM_TOOLSET=%1 | |
304 | shift | |
305 | goto Setup_Toolset | |
306 | ||
307 | ||
308 | :Setup_Toolset | |
309 | REM Setup the toolset command and options. This bit of code | |
310 | REM needs to be flexible enough to handle both when | |
311 | REM the toolset was guessed at and found, or when the toolset | |
312 | REM was indicated in the command arguments. | |
313 | REM NOTE: The strange multiple "if ?? == _toolset_" tests are that way | |
314 | REM because in BAT variables are subsituted only once during a single | |
315 | REM command. A complete "if ... else ..." | |
316 | REM is a single command, even though it's in multiple lines here. | |
317 | :Setup_Args | |
318 | call :Clear_Error | |
319 | call :Test_Empty %1 | |
320 | if not errorlevel 1 goto Config_Toolset | |
321 | call :Clear_Error | |
322 | call :Test_Option %1 | |
323 | if errorlevel 1 ( | |
324 | set BOOST_JAM_ARGS=%BOOST_JAM_ARGS% %1 | |
325 | shift | |
326 | goto Setup_Args | |
327 | ) | |
328 | :Config_Toolset | |
329 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_metrowerks_" goto Skip_METROWERKS | |
330 | if NOT "_%CWFolder%_" == "__" ( | |
331 | set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\" | |
332 | ) | |
333 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%Other Metrowerks Tools\Command Line Tools;%PATH%" | |
334 | set "BOOST_JAM_CC=mwcc -runtime ss -cwd include -DNT -lkernel32.lib -ladvapi32.lib -luser32.lib" | |
335 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" | |
336 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" | |
337 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" | |
338 | set "_known_=1" | |
339 | :Skip_METROWERKS | |
340 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_msvc_" goto Skip_MSVC | |
341 | if NOT "_%MSVCDir%_" == "__" ( | |
342 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" | |
343 | ) | |
344 | call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" | |
345 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
346 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
347 | ) | |
348 | set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib" | |
349 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
350 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
351 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
352 | set "_known_=1" | |
353 | :Skip_MSVC | |
354 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc7_" goto Skip_VC7 | |
355 | if NOT "_%VS71COMNTOOLS%_" == "__" ( | |
356 | set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%..\..\VC7\" | |
357 | ) | |
358 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" | |
359 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
360 | if "_%VCINSTALLDIR%_" == "__" ( | |
361 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
362 | ) ) | |
363 | set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib" | |
364 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
365 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
366 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
367 | set "_known_=1" | |
368 | :Skip_VC7 | |
369 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc8_" goto Skip_VC8 | |
370 | if NOT "_%VS80COMNTOOLS%_" == "__" ( | |
371 | set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\" | |
372 | ) | |
373 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS% | |
374 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
375 | if "_%VCINSTALLDIR%_" == "__" ( | |
376 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
377 | ) ) | |
378 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" | |
379 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
380 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
381 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
382 | set "_known_=1" | |
383 | :Skip_VC8 | |
384 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc9_" goto Skip_VC9 | |
385 | if NOT "_%VS90COMNTOOLS%_" == "__" ( | |
386 | set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\" | |
387 | ) | |
388 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS% | |
389 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
390 | if "_%VCINSTALLDIR%_" == "__" ( | |
391 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
392 | ) ) | |
393 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" | |
394 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
395 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
396 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
397 | set "_known_=1" | |
398 | :Skip_VC9 | |
399 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc10_" goto Skip_VC10 | |
400 | if NOT "_%VS100COMNTOOLS%_" == "__" ( | |
401 | set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\" | |
402 | ) | |
403 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS% | |
404 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
405 | if "_%VCINSTALLDIR%_" == "__" ( | |
406 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
407 | ) ) | |
408 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" | |
409 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
410 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
411 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
412 | set "_known_=1" | |
413 | :Skip_VC10 | |
414 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc11_" goto Skip_VC11 | |
415 | if NOT "_%VS110COMNTOOLS%_" == "__" ( | |
416 | set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\" | |
417 | ) | |
418 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS% | |
419 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
420 | if "_%VCINSTALLDIR%_" == "__" ( | |
421 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
422 | ) ) | |
423 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" | |
424 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
425 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
426 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
427 | set "_known_=1" | |
428 | :Skip_VC11 | |
429 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc12_" goto Skip_VC12 | |
430 | if NOT "_%VS120COMNTOOLS%_" == "__" ( | |
431 | set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\" | |
432 | ) | |
433 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS% | |
434 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
435 | if "_%VCINSTALLDIR%_" == "__" ( | |
436 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
437 | ) ) | |
438 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" | |
439 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
440 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
441 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
442 | set "_known_=1" | |
443 | :Skip_VC12 | |
444 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc14_" goto Skip_VC14 | |
445 | if NOT "_%VS140COMNTOOLS%_" == "__" ( | |
446 | set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\" | |
447 | ) | |
448 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS% | |
449 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
450 | if "_%VCINSTALLDIR%_" == "__" ( | |
451 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
452 | ) ) | |
453 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" | |
454 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
455 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
456 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
457 | set "_known_=1" | |
458 | :Skip_VC14 | |
459 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc15_" goto Skip_VC15 | |
460 | if NOT "_%VS150COMNTOOLS%_" == "__" ( | |
461 | set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\" | |
462 | ) | |
463 | if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS% | |
464 | if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
465 | if "_%VCINSTALLDIR%_" == "__" ( | |
466 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
467 | ) ) | |
468 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" | |
469 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
470 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
471 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
472 | set "_known_=1" | |
473 | :Skip_VC15 | |
474 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_borland_" goto Skip_BORLAND | |
475 | if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
476 | call :Test_Path bcc32.exe ) | |
477 | if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
478 | if not errorlevel 1 ( | |
479 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" | |
480 | ) ) | |
481 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
482 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%Bin;%PATH%" | |
483 | ) | |
484 | set "BOOST_JAM_CC=bcc32 -WC -w- -q -I%BOOST_JAM_TOOLSET_ROOT%Include -L%BOOST_JAM_TOOLSET_ROOT%Lib /DNT -nbootstrap" | |
485 | set "BOOST_JAM_OPT_JAM=-ejam0" | |
486 | set "BOOST_JAM_OPT_MKJAMBASE=-emkjambasejam0" | |
487 | set "BOOST_JAM_OPT_YYACC=-eyyacc0" | |
488 | set "_known_=1" | |
489 | :Skip_BORLAND | |
490 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_como_" goto Skip_COMO | |
491 | set "BOOST_JAM_CC=como -DNT" | |
492 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" | |
493 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" | |
494 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" | |
495 | set "_known_=1" | |
496 | :Skip_COMO | |
497 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_gcc_" goto Skip_GCC | |
498 | set "BOOST_JAM_CC=gcc -DNT" | |
499 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" | |
500 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" | |
501 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" | |
502 | set "_known_=1" | |
503 | :Skip_GCC | |
504 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_gcc-nocygwin_" goto Skip_GCC_NOCYGWIN | |
505 | set "BOOST_JAM_CC=gcc -DNT -mno-cygwin" | |
506 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" | |
507 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" | |
508 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" | |
509 | set "_known_=1" | |
510 | :Skip_GCC_NOCYGWIN | |
511 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_intel-win32_" goto Skip_INTEL_WIN32 | |
512 | set "BOOST_JAM_CC=icl -DNT /nologo kernel32.lib advapi32.lib user32.lib" | |
513 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" | |
514 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" | |
515 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" | |
516 | set "_known_=1" | |
517 | :Skip_INTEL_WIN32 | |
518 | if NOT "_%BOOST_JAM_TOOLSET%_" == "_mingw_" goto Skip_MINGW | |
519 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( | |
520 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" | |
521 | ) | |
522 | set "BOOST_JAM_CC=gcc -DNT" | |
523 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" | |
524 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" | |
525 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" | |
526 | set "_known_=1" | |
527 | :Skip_MINGW | |
528 | call :Clear_Error | |
529 | if "_%_known_%_" == "__" ( | |
530 | call :Error_Print "Unknown toolset: %BOOST_JAM_TOOLSET%" | |
531 | ) | |
532 | if errorlevel 1 goto Finish | |
533 | ||
534 | echo ### | |
535 | echo ### Using '%BOOST_JAM_TOOLSET%' toolset. | |
536 | echo ### | |
537 | ||
538 | set YYACC_SOURCES=yyacc.c | |
539 | set MKJAMBASE_SOURCES=mkjambase.c | |
540 | set BJAM_SOURCES= | |
541 | set BJAM_SOURCES=%BJAM_SOURCES% command.c compile.c constants.c debug.c | |
542 | set BJAM_SOURCES=%BJAM_SOURCES% execcmd.c execnt.c filent.c frames.c function.c | |
543 | set BJAM_SOURCES=%BJAM_SOURCES% glob.c hash.c hdrmacro.c headers.c jam.c | |
544 | set BJAM_SOURCES=%BJAM_SOURCES% jambase.c jamgram.c lists.c make.c make1.c | |
545 | set BJAM_SOURCES=%BJAM_SOURCES% object.c option.c output.c parse.c pathnt.c | |
546 | set BJAM_SOURCES=%BJAM_SOURCES% pathsys.c regexp.c rules.c scan.c search.c | |
547 | set BJAM_SOURCES=%BJAM_SOURCES% subst.c timestamp.c variable.c modules.c | |
548 | set BJAM_SOURCES=%BJAM_SOURCES% strings.c filesys.c builtins.c md5.c class.c | |
549 | set BJAM_SOURCES=%BJAM_SOURCES% cwd.c w32_getreg.c native.c modules/set.c | |
550 | set BJAM_SOURCES=%BJAM_SOURCES% modules/path.c modules/regex.c | |
551 | set BJAM_SOURCES=%BJAM_SOURCES% modules/property-set.c modules/sequence.c | |
552 | set BJAM_SOURCES=%BJAM_SOURCES% modules/order.c | |
553 | ||
554 | set BJAM_UPDATE= | |
555 | :Check_Update | |
556 | call :Test_Empty %1 | |
557 | if not errorlevel 1 goto Check_Update_End | |
558 | call :Clear_Error | |
559 | setlocal | |
560 | set test=%1 | |
561 | set test=###%test%### | |
562 | set test=%test:"###=% | |
563 | set test=%test:###"=% | |
564 | set test=%test:###=% | |
565 | if "%test%" == "--update" goto Found_Update | |
566 | endlocal & set BOOST_JAM_TOOLSET=%BOOST_JAM_TOOLSET% | |
567 | shift | |
568 | if not "_%BJAM_UPDATE%_" == "_update_" goto Check_Update | |
569 | :Found_Update | |
570 | endlocal & set BOOST_JAM_TOOLSET=%BOOST_JAM_TOOLSET% | |
571 | set BJAM_UPDATE=update | |
572 | :Check_Update_End | |
573 | if "_%BJAM_UPDATE%_" == "_update_" ( | |
574 | if not exist ".\bootstrap\jam0.exe" ( | |
575 | set BJAM_UPDATE= | |
576 | ) | |
577 | ) | |
578 | ||
579 | @echo ON | |
580 | @if "_%BJAM_UPDATE%_" == "_update_" goto Skip_Bootstrap | |
581 | if exist bootstrap rd /S /Q bootstrap | |
582 | md bootstrap | |
583 | @if not exist jamgram.y goto Bootstrap_GrammarPrep | |
584 | @if not exist jamgramtab.h goto Bootstrap_GrammarPrep | |
585 | @goto Skip_GrammarPrep | |
586 | :Bootstrap_GrammarPrep | |
587 | %BOOST_JAM_CC% %BOOST_JAM_OPT_YYACC% %YYACC_SOURCES% | |
588 | @if not exist ".\bootstrap\yyacc0.exe" goto Skip_GrammarPrep | |
589 | .\bootstrap\yyacc0 jamgram.y jamgramtab.h jamgram.yy | |
590 | :Skip_GrammarPrep | |
591 | @if not exist jamgram.c goto Bootstrap_GrammarBuild | |
592 | @if not exist jamgram.h goto Bootstrap_GrammarBuild | |
593 | @goto Skip_GrammarBuild | |
594 | :Bootstrap_GrammarBuild | |
595 | @echo OFF | |
596 | if "_%YACC%_" == "__" ( | |
597 | call :Guess_Yacc | |
598 | ) | |
599 | if errorlevel 1 goto Finish | |
600 | @echo ON | |
601 | %YACC% jamgram.y | |
602 | @if errorlevel 1 goto Finish | |
603 | del /f jamgram.c | |
604 | rename y.tab.c jamgram.c | |
605 | del /f jamgram.h | |
606 | rename y.tab.h jamgram.h | |
607 | :Skip_GrammarBuild | |
608 | @echo ON | |
609 | @if exist jambase.c goto Skip_Jambase | |
610 | %BOOST_JAM_CC% %BOOST_JAM_OPT_MKJAMBASE% %MKJAMBASE_SOURCES% | |
611 | @if not exist ".\bootstrap\mkjambase0.exe" goto Skip_Jambase | |
612 | .\bootstrap\mkjambase0 jambase.c Jambase | |
613 | :Skip_Jambase | |
614 | %BOOST_JAM_CC% %BOOST_JAM_OPT_JAM% %BJAM_SOURCES% | |
615 | :Skip_Bootstrap | |
616 | @if not exist ".\bootstrap\jam0.exe" goto Skip_Jam | |
617 | @set args=%* | |
618 | @echo OFF | |
619 | :Set_Args | |
620 | setlocal | |
621 | call :Test_Empty %args% | |
622 | if not errorlevel 1 goto Set_Args_End | |
623 | set test=###%args:~0,2%### | |
624 | set test=%test:"###=% | |
625 | set test=%test:###"=% | |
626 | set test=%test:###=% | |
627 | set test=%test:~0,1% | |
628 | if "-" == "%test%" goto Set_Args_End | |
629 | endlocal | |
630 | set args=%args:~1% | |
631 | goto Set_Args | |
632 | :Set_Args_End | |
633 | @echo ON | |
634 | @if "_%BJAM_UPDATE%_" == "_update_" goto Skip_Clean | |
635 | .\bootstrap\jam0 -f build.jam --toolset=%BOOST_JAM_TOOLSET% "--toolset-root=%BOOST_JAM_TOOLSET_ROOT% " %args% clean | |
636 | :Skip_Clean | |
637 | .\bootstrap\jam0 -f build.jam --toolset=%BOOST_JAM_TOOLSET% "--toolset-root=%BOOST_JAM_TOOLSET_ROOT% " %args% | |
638 | :Skip_Jam | |
639 | ||
640 | :Finish | |
641 | exit /b %ERRORLEVEL% |