]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/engine/build.bat
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / src / engine / build.bat
CommitLineData
20effc67
TL
1@ECHO OFF\r
2\r
3REM ~ Copyright 2002-2007 Rene Rivera.\r
4REM ~ Distributed under the Boost Software License, Version 1.0.\r
5REM ~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)\r
6\r
7setlocal\r
8goto Start\r
9\r
10\r
11:Set_Error\r
12color 00\r
13goto :eof\r
14\r
15\r
16:Clear_Error\r
17ver >nul\r
18goto :eof\r
19\r
20\r
21:Error_Print\r
22REM Output an error message and set the errorlevel to indicate failure.\r
23setlocal\r
24ECHO ###\r
25ECHO ### %1\r
26ECHO ###\r
27ECHO ### You can specify the toolset as the argument, i.e.:\r
28ECHO ### .\build.bat msvc\r
29ECHO ###\r
30ECHO ### Toolsets supported by this script are: borland, como, gcc,\r
1e59de90
TL
31ECHO ### gcc-nocygwin, intel-win32, mingw,\r
32ECHO ### vc12, vc14, vc141, vc142, vc143\r
20effc67
TL
33ECHO ###\r
34ECHO ### If you have Visual Studio 2017 installed you will need to either update\r
35ECHO ### the Visual Studio 2017 installer or run from VS 2017 Command Prompt\r
36ECHO ### as we where unable to detect your toolset installation.\r
37ECHO ###\r
38call :Set_Error\r
39endlocal\r
40goto :eof\r
41\r
42\r
43:Test_Option\r
44REM Tests whether the given string is in the form of an option: "--*"\r
45call :Clear_Error\r
46setlocal\r
47set test=%1\r
48if not defined test (\r
49 call :Set_Error\r
50 goto Test_Option_End\r
51)\r
52set test=###%test%###\r
53set test=%test:"###=%\r
54set test=%test:###"=%\r
55set test=%test:###=%\r
56if not "-" == "%test:~1,1%" call :Set_Error\r
57:Test_Option_End\r
58endlocal\r
59goto :eof\r
60\r
61\r
62:Test_Empty\r
63REM Tests whether the given string is not empty\r
64call :Clear_Error\r
65setlocal\r
66set test=%1\r
67if not defined test (\r
68 call :Clear_Error\r
69 goto Test_Empty_End\r
70)\r
71set test=###%test%###\r
72set test=%test:"###=%\r
73set test=%test:###"=%\r
74set test=%test:###=%\r
75if not "" == "%test%" call :Set_Error\r
76:Test_Empty_End\r
77endlocal\r
78goto :eof\r
79\r
80\r
81:Guess_Toolset\r
82set local\r
83REM Try and guess the toolset to bootstrap the build with...\r
84REM Sets B2_TOOLSET to the first found toolset.\r
85REM May also set B2_TOOLSET_ROOT to the\r
86REM location of the found toolset.\r
87\r
88call :Clear_Error\r
89call :Test_Empty "%ProgramFiles%"\r
90if not errorlevel 1 set "ProgramFiles=C:\Program Files"\r
91\r
92REM Visual Studio is by default installed to %ProgramFiles% on 32-bit machines and\r
93REM %ProgramFiles(x86)% on 64-bit machines. Making a common variable for both.\r
94call :Clear_Error\r
95call :Test_Empty "%ProgramFiles(x86)%"\r
96if errorlevel 1 (\r
97 set "VS_ProgramFiles=%ProgramFiles(x86)%"\r
98) else (\r
99 set "VS_ProgramFiles=%ProgramFiles%"\r
100)\r
101\r
102call guess_toolset.bat\r
103if errorlevel 1 (\r
104 call :Error_Print "Could not find a suitable toolset.")\r
105goto :eof\r
106\r
107endlocal\r
108goto :eof\r
109\r
110\r
111:Start\r
112set B2_TOOLSET=\r
113set B2_BUILD_ARGS=\r
114\r
115REM If no arguments guess the toolset;\r
116REM or if first argument is an option guess the toolset;\r
117REM otherwise the argument is the toolset to use.\r
118call :Clear_Error\r
119call :Test_Empty %1\r
120if not errorlevel 1 (\r
121 call :Guess_Toolset\r
122 if not errorlevel 1 ( goto Setup_Toolset ) else ( goto Finish )\r
123)\r
124\r
125call :Clear_Error\r
126call :Test_Option %1\r
127if not errorlevel 1 (\r
128 call :Guess_Toolset\r
129 if not errorlevel 1 ( goto Setup_Toolset ) else ( goto Finish )\r
130)\r
131\r
132call :Clear_Error\r
133set B2_TOOLSET=%1\r
134shift\r
135goto Setup_Toolset\r
136\r
137\r
138:Setup_Toolset\r
139REM Setup the toolset command and options. This bit of code\r
140REM needs to be flexible enough to handle both when\r
141REM the toolset was guessed at and found, or when the toolset\r
142REM was indicated in the command arguments.\r
143REM NOTE: The strange multiple "if ?? == _toolset_" tests are that way\r
144REM because in BAT variables are subsituted only once during a single\r
145REM command. A complete "if ... else ..."\r
146REM is a single command, even though it's in multiple lines here.\r
147:Setup_Args\r
148call :Clear_Error\r
149call :Test_Empty %1\r
150if not errorlevel 1 goto Config_Toolset\r
151call :Clear_Error\r
152call :Test_Option %1\r
153if errorlevel 1 (\r
154 set B2_BUILD_ARGS=%B2_BUILD_ARGS% %1\r
155 shift\r
156 goto Setup_Args\r
157)\r
158:Config_Toolset\r
159call config_toolset.bat\r
160if "_%_known_%_" == "__" (\r
161 call :Error_Print "Unknown toolset: %B2_TOOLSET%"\r
162)\r
163if errorlevel 1 goto Finish\r
164\r
165echo ###\r
166echo ### Using '%B2_TOOLSET%' toolset.\r
167echo ###\r
168\r
169set B2_SOURCES=\r
170set B2_SOURCES=%B2_SOURCES% builtins.cpp class.cpp\r
171set B2_SOURCES=%B2_SOURCES% command.cpp compile.cpp constants.cpp cwd.cpp\r
172set B2_SOURCES=%B2_SOURCES% debug.cpp debugger.cpp\r
1e59de90 173set B2_SOURCES=%B2_SOURCES% execcmd.cpp execnt.cpp execunix.cpp filent.cpp filesys.cpp fileunix.cpp frames.cpp function.cpp\r
20effc67
TL
174set B2_SOURCES=%B2_SOURCES% glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam.cpp\r
175set B2_SOURCES=%B2_SOURCES% jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp\r
176set B2_SOURCES=%B2_SOURCES% native.cpp object.cpp option.cpp output.cpp parse.cpp pathnt.cpp\r
1e59de90 177set B2_SOURCES=%B2_SOURCES% pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp jam_strings.cpp\r
20effc67
TL
178set B2_SOURCES=%B2_SOURCES% startup.cpp subst.cpp sysinfo.cpp\r
179set B2_SOURCES=%B2_SOURCES% timestamp.cpp variable.cpp w32_getreg.cpp\r
180set B2_SOURCES=%B2_SOURCES% modules/order.cpp\r
181set B2_SOURCES=%B2_SOURCES% modules/path.cpp\r
182set B2_SOURCES=%B2_SOURCES% modules/property-set.cpp\r
183set B2_SOURCES=%B2_SOURCES% modules/regex.cpp\r
184set B2_SOURCES=%B2_SOURCES% modules/sequence.cpp\r
185set B2_SOURCES=%B2_SOURCES% modules/set.cpp\r
186\r
187set B2_CXXFLAGS=%B2_CXXFLAGS% -DNDEBUG\r
188\r
189@echo ON\r
190%B2_CXX% %CXXFLAGS% %B2_CXXFLAGS% %B2_SOURCES% %B2_CXX_LINK%\r
191dir *.exe\r
192copy /b .\b2.exe .\bjam.exe\r
193\r
194:Finish\r
195@exit /b %ERRORLEVEL%\r