1 | @ECHO OFF |
---|
2 | |
---|
3 | REM ~ Copyright 2002-2005 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 | REM NOTE: The "setlocal & endlocal" construct is used to reset the errorlevel to 0. |
---|
11 | REM NOTE: The "set _error_=" construct is used to set the errorlevel to 1 |
---|
12 | |
---|
13 | :Error_Print |
---|
14 | REM Output an error message and set the errorlevel to indicate failure. |
---|
15 | setlocal |
---|
16 | ECHO ### |
---|
17 | ECHO ### %1 |
---|
18 | ECHO ### |
---|
19 | ECHO ### You can specify the toolset as the argument, i.e.: |
---|
20 | ECHO ### .\build.bat msvc |
---|
21 | ECHO ### |
---|
22 | ECHO ### Toolsets supported by this script are: borland, como, gcc, gcc-nocygwin, intel-win32, metrowerks, mingw, msvc, vc7, vc8 |
---|
23 | ECHO ### |
---|
24 | set _error_= |
---|
25 | endlocal |
---|
26 | goto :eof |
---|
27 | |
---|
28 | :Test_Path |
---|
29 | REM Tests for the given file(executable) presence in the directories in the PATH |
---|
30 | REM environment variable. Additionaly sets FOUND_PATH to the path of the |
---|
31 | REM found file. |
---|
32 | setlocal & endlocal |
---|
33 | setlocal |
---|
34 | set test=%~$PATH:1 |
---|
35 | endlocal |
---|
36 | if not errorlevel 1 set FOUND_PATH=%~dp$PATH:1 |
---|
37 | goto :eof |
---|
38 | |
---|
39 | :Test_Option |
---|
40 | REM Tests wether the given string is in the form of an option: "-*" |
---|
41 | setlocal & endlocal |
---|
42 | setlocal |
---|
43 | set test=%1 |
---|
44 | set test=###%test%### |
---|
45 | set test=%test:"###=% |
---|
46 | set test=%test:###"=% |
---|
47 | set test=%test:###=% |
---|
48 | if not [-] == [%test:~0,1%] set _error_= |
---|
49 | endlocal |
---|
50 | goto :eof |
---|
51 | |
---|
52 | :Guess_Toolset |
---|
53 | REM Try and guess the toolset to bootstrap the build with... |
---|
54 | REM Sets BOOST_JAM_TOOLSET to the first found toolset. |
---|
55 | REM May also set BOOST_JAM_TOOLSET_ROOT to the |
---|
56 | REM location of the found toolset. |
---|
57 | |
---|
58 | if "_%ProgramFiles%_" == "__" set ProgramFiles=C:\Program Files |
---|
59 | |
---|
60 | setlocal & endlocal |
---|
61 | if NOT "_%VS80COMNTOOLS%_" == "__" ( |
---|
62 | set "BOOST_JAM_TOOLSET=vc8" |
---|
63 | set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\" |
---|
64 | goto :eof) |
---|
65 | setlocal & endlocal |
---|
66 | if EXIST "%ProgramFiles%\Microsoft Visual Studio 8\VC\bin\VCVARS32.BAT" ( |
---|
67 | set "BOOST_JAM_TOOLSET=vc8" |
---|
68 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 8\VC\" |
---|
69 | goto :eof) |
---|
70 | setlocal & endlocal |
---|
71 | if NOT "_%VS71COMNTOOLS%_" == "__" ( |
---|
72 | set "BOOST_JAM_TOOLSET=vc7" |
---|
73 | set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%\..\..\VC7\" |
---|
74 | goto :eof) |
---|
75 | setlocal & endlocal |
---|
76 | if NOT "_%VCINSTALLDIR%_" == "__" ( |
---|
77 | set "BOOST_JAM_TOOLSET=vc7" |
---|
78 | set "BOOST_JAM_TOOLSET_ROOT=%VCINSTALLDIR%\VC7\" |
---|
79 | goto :eof) |
---|
80 | setlocal & endlocal |
---|
81 | if EXIST "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" ( |
---|
82 | set "BOOST_JAM_TOOLSET=vc7" |
---|
83 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\" |
---|
84 | goto :eof) |
---|
85 | setlocal & endlocal |
---|
86 | if EXIST "%ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\VCVARS32.BAT" ( |
---|
87 | set "BOOST_JAM_TOOLSET=vc7" |
---|
88 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio .NET\VC7\" |
---|
89 | goto :eof) |
---|
90 | setlocal & endlocal |
---|
91 | if NOT "_%MSVCDir%_" == "__" ( |
---|
92 | set "BOOST_JAM_TOOLSET=msvc" |
---|
93 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" |
---|
94 | goto :eof) |
---|
95 | setlocal & endlocal |
---|
96 | if EXIST "%ProgramFiles%\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" ( |
---|
97 | set "BOOST_JAM_TOOLSET=msvc" |
---|
98 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio\VC98\" |
---|
99 | goto :eof) |
---|
100 | setlocal & endlocal |
---|
101 | if EXIST "%ProgramFiles%\Microsoft Visual C++\VC98\bin\VCVARS32.BAT" ( |
---|
102 | set "BOOST_JAM_TOOLSET=msvc" |
---|
103 | set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual C++\VC98\" |
---|
104 | goto :eof) |
---|
105 | setlocal & endlocal |
---|
106 | call :Test_Path cl.exe |
---|
107 | if not errorlevel 1 ( |
---|
108 | set "BOOST_JAM_TOOLSET=msvc" |
---|
109 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" |
---|
110 | goto :eof) |
---|
111 | setlocal & endlocal |
---|
112 | call :Test_Path vcvars32.bat |
---|
113 | if not errorlevel 1 ( |
---|
114 | set "BOOST_JAM_TOOLSET=msvc" |
---|
115 | call "%FOUND_PATH%VCVARS32.BAT" |
---|
116 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" |
---|
117 | goto :eof) |
---|
118 | setlocal & endlocal |
---|
119 | if EXIST "C:\Borland\BCC55\Bin\bcc32.exe" ( |
---|
120 | set "BOOST_JAM_TOOLSET=borland" |
---|
121 | set "BOOST_JAM_TOOLSET_ROOT=C:\Borland\BCC55\" |
---|
122 | goto :eof) |
---|
123 | setlocal & endlocal |
---|
124 | call :Test_Path bcc32.exe |
---|
125 | if not errorlevel 1 ( |
---|
126 | set "BOOST_JAM_TOOLSET=borland" |
---|
127 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" |
---|
128 | goto :eof) |
---|
129 | setlocal & endlocal |
---|
130 | call :Test_Path icl.exe |
---|
131 | if not errorlevel 1 ( |
---|
132 | set "BOOST_JAM_TOOLSET=intel-win32" |
---|
133 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" |
---|
134 | goto :eof) |
---|
135 | setlocal & endlocal |
---|
136 | if EXIST "C:\MinGW\bin\gcc.exe" ( |
---|
137 | set "BOOST_JAM_TOOLSET=mingw" |
---|
138 | set "BOOST_JAM_TOOLSET_ROOT=C:\MinGW\" |
---|
139 | goto :eof) |
---|
140 | setlocal & endlocal |
---|
141 | if NOT "_%CWFolder%_" == "__" ( |
---|
142 | set "BOOST_JAM_TOOLSET=metrowerks" |
---|
143 | set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\" |
---|
144 | goto :eof ) |
---|
145 | setlocal & endlocal |
---|
146 | call :Test_Path mwcc.exe |
---|
147 | if not errorlevel 1 ( |
---|
148 | set "BOOST_JAM_TOOLSET=metrowerks" |
---|
149 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\..\" |
---|
150 | goto :eof) |
---|
151 | setlocal & endlocal |
---|
152 | call :Error_Print "Could not find a suitable toolset." |
---|
153 | goto :eof |
---|
154 | |
---|
155 | :Guess_Yacc |
---|
156 | REM Tries to find bison or yacc in common places so we can build the grammar. |
---|
157 | setlocal & endlocal |
---|
158 | call :Test_Path yacc.exe |
---|
159 | if not errorlevel 1 ( |
---|
160 | set "YACC=yacc -d" |
---|
161 | goto :eof) |
---|
162 | setlocal & endlocal |
---|
163 | call :Test_Path bison.exe |
---|
164 | if not errorlevel 1 ( |
---|
165 | set "YACC=bison -d --yacc" |
---|
166 | goto :eof) |
---|
167 | setlocal & endlocal |
---|
168 | if EXIST "C:\Program Files\GnuWin32\bin\bison.exe" ( |
---|
169 | set "YACC=C:\Program Files\GnuWin32\bin\bison.exe" -d --yacc |
---|
170 | goto :eof) |
---|
171 | setlocal & endlocal |
---|
172 | call :Error_Print "Could not find Yacc to build the Jam grammar." |
---|
173 | goto :eof |
---|
174 | |
---|
175 | :Start |
---|
176 | set BOOST_JAM_TOOLSET= |
---|
177 | |
---|
178 | REM If no arguments guess the toolset; |
---|
179 | REM or if first argument is an option guess the toolset; |
---|
180 | REM otherwise the argument is the toolset to use. |
---|
181 | if "_%1_" == "__" ( |
---|
182 | call :Guess_Toolset |
---|
183 | if not errorlevel 1 goto Setup_Toolset |
---|
184 | ) else ( |
---|
185 | call :Test_Option "%1" |
---|
186 | if not errorlevel 1 ( |
---|
187 | call :Guess_Toolset |
---|
188 | if not errorlevel 1 goto Setup_Toolset |
---|
189 | ) else ( |
---|
190 | setlocal & endlocal |
---|
191 | set "BOOST_JAM_TOOLSET=%1" |
---|
192 | shift |
---|
193 | goto Setup_Toolset |
---|
194 | ) |
---|
195 | ) |
---|
196 | if errorlevel 1 goto Finish |
---|
197 | |
---|
198 | :Setup_Toolset |
---|
199 | REM Setup the toolset command and options. This bit of code |
---|
200 | REM needs to be flexible enough to handle both when |
---|
201 | REM the toolset was guessed at and found, or when the toolset |
---|
202 | REM was indicated in the command arguments. |
---|
203 | REM NOTE: The strange multiple "if ?? == _toolset_" tests are that way |
---|
204 | REM because in BAT variables are subsituted only once during a single |
---|
205 | REM command. A complete "if ... ( commands ) else ( commands )" |
---|
206 | REM is a single command, even though it's in multiple lines here. |
---|
207 | if "_%BOOST_JAM_TOOLSET%_" == "_metrowerks_" ( |
---|
208 | if NOT "_%CWFolder%_" == "__" ( |
---|
209 | set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\" |
---|
210 | ) ) |
---|
211 | if "_%BOOST_JAM_TOOLSET%_" == "_metrowerks_" ( |
---|
212 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
213 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%Other Metrowerks Tools\Command Line Tools;%PATH%" |
---|
214 | ) |
---|
215 | set "BOOST_JAM_CC=mwcc -runtime ss -cwd include -DNT -lkernel32.lib -ladvapi32.lib -luser32.lib" |
---|
216 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" |
---|
217 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" |
---|
218 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" |
---|
219 | set "_known_=1" |
---|
220 | ) |
---|
221 | if "_%BOOST_JAM_TOOLSET%_" == "_msvc_" ( |
---|
222 | if NOT "_%MSVCDir%_" == "__" ( |
---|
223 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" |
---|
224 | ) ) |
---|
225 | if "_%BOOST_JAM_TOOLSET%_" == "_msvc_" ( |
---|
226 | if EXIST "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" ( |
---|
227 | call "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" ) ) |
---|
228 | if "_%BOOST_JAM_TOOLSET%_" == "_msvc_" ( |
---|
229 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
230 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" |
---|
231 | ) |
---|
232 | set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib" |
---|
233 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" |
---|
234 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" |
---|
235 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" |
---|
236 | set "_known_=1" |
---|
237 | ) |
---|
238 | if "_%BOOST_JAM_TOOLSET%_" == "_vc7_" ( |
---|
239 | if NOT "_%MSVCDir%_" == "__" ( |
---|
240 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" |
---|
241 | ) ) |
---|
242 | if "_%BOOST_JAM_TOOLSET%_" == "_vc7_" ( |
---|
243 | if EXIST "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" ( |
---|
244 | call "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" ) ) |
---|
245 | if "_%BOOST_JAM_TOOLSET%_" == "_vc7_" ( |
---|
246 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
247 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" |
---|
248 | ) |
---|
249 | set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib" |
---|
250 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" |
---|
251 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" |
---|
252 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" |
---|
253 | set "_known_=1" |
---|
254 | ) |
---|
255 | if "_%BOOST_JAM_TOOLSET%_" == "_vc8_" ( |
---|
256 | if NOT "_%MSVCDir%_" == "__" ( |
---|
257 | set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\" |
---|
258 | ) ) |
---|
259 | if "_%BOOST_JAM_TOOLSET%_" == "_vc8_" ( |
---|
260 | if EXIST "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" ( |
---|
261 | call "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT" ) ) |
---|
262 | if "_%BOOST_JAM_TOOLSET%_" == "_vc8_" ( |
---|
263 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
264 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" |
---|
265 | ) |
---|
266 | set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib" |
---|
267 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" |
---|
268 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" |
---|
269 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" |
---|
270 | set "_known_=1" |
---|
271 | ) |
---|
272 | if "_%BOOST_JAM_TOOLSET%_" == "_borland_" ( |
---|
273 | if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
274 | call :Test_Path bcc32.exe ) ) |
---|
275 | if "_%BOOST_JAM_TOOLSET%_" == "_borland_" ( |
---|
276 | if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
277 | if not errorlevel 1 ( |
---|
278 | set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\" |
---|
279 | ) ) ) |
---|
280 | if "_%BOOST_JAM_TOOLSET%_" == "_borland_" ( |
---|
281 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
282 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%Bin;%PATH%" |
---|
283 | ) |
---|
284 | set "BOOST_JAM_CC=bcc32 -WC -w- -q "-I%BOOST_JAM_TOOLSET_ROOT%Include" "-L%BOOST_JAM_TOOLSET_ROOT%Lib" /DNT -nbootstrap" |
---|
285 | set "BOOST_JAM_OPT_JAM=-ejam0" |
---|
286 | set "BOOST_JAM_OPT_MKJAMBASE=-emkjambasejam0" |
---|
287 | set "BOOST_JAM_OPT_YYACC=-eyyacc0" |
---|
288 | set "_known_=1" |
---|
289 | ) |
---|
290 | if "_%BOOST_JAM_TOOLSET%_" == "_como_" ( |
---|
291 | set "BOOST_JAM_CC=como -DNT" |
---|
292 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" |
---|
293 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" |
---|
294 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" |
---|
295 | set "_known_=1" |
---|
296 | ) |
---|
297 | if "_%BOOST_JAM_TOOLSET%_" == "_gcc_" ( |
---|
298 | set "BOOST_JAM_CC=gcc -DNT" |
---|
299 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" |
---|
300 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" |
---|
301 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" |
---|
302 | set "_known_=1" |
---|
303 | ) |
---|
304 | if "_%BOOST_JAM_TOOLSET%_" == "_gcc-nocygwin_" ( |
---|
305 | set "BOOST_JAM_CC=gcc -DNT -mno-cygwin" |
---|
306 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" |
---|
307 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" |
---|
308 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" |
---|
309 | set "_known_=1" |
---|
310 | ) |
---|
311 | if "_%BOOST_JAM_TOOLSET%_" == "_intel-win32_" ( |
---|
312 | set "BOOST_JAM_CC=icl -DNT /nologo kernel32.lib advapi32.lib user32.lib" |
---|
313 | set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0" |
---|
314 | set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0" |
---|
315 | set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0" |
---|
316 | set "_known_=1" |
---|
317 | ) |
---|
318 | if "_%BOOST_JAM_TOOLSET%_" == "_mingw_" ( |
---|
319 | if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( |
---|
320 | set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%" |
---|
321 | ) |
---|
322 | set "BOOST_JAM_CC=gcc -DNT" |
---|
323 | set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe" |
---|
324 | set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe" |
---|
325 | set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe" |
---|
326 | set "_known_=1" |
---|
327 | ) |
---|
328 | if "_%_known_%_" == "__" ( |
---|
329 | call :Error_Print "Unknown toolset: %BOOST_JAM_TOOLSET%" |
---|
330 | ) |
---|
331 | if errorlevel 1 goto Finish |
---|
332 | |
---|
333 | echo ### |
---|
334 | echo ### Using '%BOOST_JAM_TOOLSET%' toolset. |
---|
335 | echo ### |
---|
336 | |
---|
337 | set YYACC_SOURCES=yyacc.c |
---|
338 | set MKJAMBASE_SOURCES=mkjambase.c |
---|
339 | set BJAM_SOURCES= |
---|
340 | set BJAM_SOURCES=%BJAM_SOURCES% command.c compile.c debug.c execnt.c expand.c filent.c glob.c hash.c |
---|
341 | set BJAM_SOURCES=%BJAM_SOURCES% hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c |
---|
342 | set BJAM_SOURCES=%BJAM_SOURCES% newstr.c option.c parse.c pathunix.c regexp.c |
---|
343 | set BJAM_SOURCES=%BJAM_SOURCES% rules.c scan.c search.c subst.c timestamp.c variable.c modules.c |
---|
344 | set BJAM_SOURCES=%BJAM_SOURCES% strings.c filesys.c builtins.c pwd.c class.c w32_getreg.c native.c |
---|
345 | set BJAM_SOURCES=%BJAM_SOURCES% modules/set.c modules/path.c modules/regex.c |
---|
346 | set BJAM_SOURCES=%BJAM_SOURCES% modules/property-set.c modules/sequence.c modules/order.c |
---|
347 | |
---|
348 | set BJAM_UPDATE= |
---|
349 | if "_%1" == "_--update" ( |
---|
350 | set BJAM_UPDATE=update |
---|
351 | ) |
---|
352 | if "_%2" == "_--update" ( |
---|
353 | set BJAM_UPDATE=update |
---|
354 | ) |
---|
355 | if "_%3" == "_--update" ( |
---|
356 | set BJAM_UPDATE=update |
---|
357 | ) |
---|
358 | if "_%4" == "_--update" ( |
---|
359 | set BJAM_UPDATE=update |
---|
360 | ) |
---|
361 | if "_%BJAM_UPDATE%_" == "_update_" ( |
---|
362 | if not exist ".\bootstrap\jam0.exe" ( |
---|
363 | set BJAM_UPDATE= |
---|
364 | ) |
---|
365 | ) |
---|
366 | |
---|
367 | |
---|
368 | @echo ON |
---|
369 | @if "_%BJAM_UPDATE%_" == "_update_" goto Skip_Bootstrap |
---|
370 | rd /S /Q bootstrap |
---|
371 | md bootstrap |
---|
372 | @if not exist jamgram.y goto Bootstrap_GrammarPrep |
---|
373 | @if not exist jamgramtab.h goto Bootstrap_GrammarPrep |
---|
374 | @goto Skip_GrammarPrep |
---|
375 | :Bootstrap_GrammarPrep |
---|
376 | %BOOST_JAM_CC% %BOOST_JAM_OPT_YYACC% %YYACC_SOURCES% |
---|
377 | @if not exist ".\bootstrap\yyacc0.exe" goto Skip_GrammarPrep |
---|
378 | .\bootstrap\yyacc0 jamgram.y jamgramtab.h jamgram.yy |
---|
379 | :Skip_GrammarPrep |
---|
380 | @if not exist jamgram.c goto Bootstrap_GrammarBuild |
---|
381 | @if not exist jamgram.h goto Bootstrap_GrammarBuild |
---|
382 | @goto Skip_GrammarBuild |
---|
383 | :Bootstrap_GrammarBuild |
---|
384 | @echo OFF |
---|
385 | if "_%YACC%_" == "__" ( |
---|
386 | call :Guess_Yacc |
---|
387 | ) |
---|
388 | if errorlevel 1 goto Finish |
---|
389 | @echo ON |
---|
390 | %YACC% jamgram.y |
---|
391 | @if errorlevel 1 goto Finish |
---|
392 | del /f jamgram.c |
---|
393 | rename y.tab.c jamgram.c |
---|
394 | del /f jamgram.h |
---|
395 | rename y.tab.h jamgram.h |
---|
396 | :Skip_GrammarBuild |
---|
397 | @echo ON |
---|
398 | @if exist jambase.c goto Skip_Jambase |
---|
399 | %BOOST_JAM_CC% %BOOST_JAM_OPT_MKJAMBASE% %MKJAMBASE_SOURCES% |
---|
400 | @if not exist ".\bootstrap\mkjambase0.exe" goto Skip_Jambase |
---|
401 | .\bootstrap\mkjambase0 jambase.c Jambase |
---|
402 | :Skip_Jambase |
---|
403 | %BOOST_JAM_CC% %BOOST_JAM_OPT_JAM% %BJAM_SOURCES% |
---|
404 | :Skip_Bootstrap |
---|
405 | @if not exist ".\bootstrap\jam0.exe" goto Skip_Jam |
---|
406 | @if "_%BJAM_UPDATE%_" == "_update_" goto Skip_Clean |
---|
407 | .\bootstrap\jam0 -f build.jam --toolset=%BOOST_JAM_TOOLSET% "--toolset-root=%BOOST_JAM_TOOLSET_ROOT% " clean |
---|
408 | :Skip_Clean |
---|
409 | @set args= |
---|
410 | :Set_Args |
---|
411 | @if not "_%1_" == "__" ( |
---|
412 | set args=%args% %1 |
---|
413 | shift |
---|
414 | goto Set_Args |
---|
415 | ) |
---|
416 | .\bootstrap\jam0 -f build.jam --toolset=%BOOST_JAM_TOOLSET% "--toolset-root=%BOOST_JAM_TOOLSET_ROOT% " %args% |
---|
417 | :Skip_Jam |
---|
418 | |
---|
419 | :Finish |
---|