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