]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/engine/guess_toolset.bat
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / engine / guess_toolset.bat
1 @ECHO OFF
2
3 REM ~ Copyright 2002-2017 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 if "_%1_" == "_yacc_" goto Guess_Yacc
8 goto Guess
9
10
11 :Clear_Error
12 ver >nul
13 goto :eof
14
15
16 :Test_Path
17 REM Tests for the given executable file presence in the directories in the PATH
18 REM environment variable. Additionaly sets FOUND_PATH to the path of the
19 REM found file.
20 call :Clear_Error
21 setlocal
22 set test=%~$PATH:1
23 endlocal
24 if not errorlevel 1 set FOUND_PATH=%~dp$PATH:1
25 goto :eof
26
27
28 :Guess
29 REM Check the variable first. This can be set manually by the user (by running the tools commmand prompt).
30 call :Clear_Error
31 call vswhere_usability_wrapper.cmd
32 if NOT "_%VS150COMNTOOLS%_" == "__" (
33 set "BOOST_JAM_TOOLSET=vc141"
34 set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
35 goto :eof)
36
37 :skip_vswhere
38 call :Clear_Error
39 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
40 set "BOOST_JAM_TOOLSET=vc141"
41 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\"
42 goto :eof)
43 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" (
44 set "BOOST_JAM_TOOLSET=vc141"
45 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\"
46 goto :eof)
47 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
48 set "BOOST_JAM_TOOLSET=vc141"
49 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\"
50 goto :eof)
51 if NOT "_%VS140COMNTOOLS%_" == "__" (
52 set "BOOST_JAM_TOOLSET=vc14"
53 set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\"
54 goto :eof)
55 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 14.0\VC\VCVARSALL.BAT" (
56 set "BOOST_JAM_TOOLSET=vc14"
57 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 14.0\VC\"
58 goto :eof)
59 if NOT "_%VS120COMNTOOLS%_" == "__" (
60 set "BOOST_JAM_TOOLSET=vc12"
61 set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
62 goto :eof)
63 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 12.0\VC\VCVARSALL.BAT" (
64 set "BOOST_JAM_TOOLSET=vc12"
65 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 12.0\VC\"
66 goto :eof)
67 if NOT "_%VS110COMNTOOLS%_" == "__" (
68 set "BOOST_JAM_TOOLSET=vc11"
69 set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\"
70 goto :eof)
71 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 11.0\VC\VCVARSALL.BAT" (
72 set "BOOST_JAM_TOOLSET=vc11"
73 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 11.0\VC\"
74 goto :eof)
75 if NOT "_%VS100COMNTOOLS%_" == "__" (
76 set "BOOST_JAM_TOOLSET=vc10"
77 set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\"
78 goto :eof)
79 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 10.0\VC\VCVARSALL.BAT" (
80 set "BOOST_JAM_TOOLSET=vc10"
81 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 10.0\VC\"
82 goto :eof)
83 if NOT "_%VS90COMNTOOLS%_" == "__" (
84 set "BOOST_JAM_TOOLSET=vc9"
85 set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\"
86 goto :eof)
87 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 9.0\VC\VCVARSALL.BAT" (
88 set "BOOST_JAM_TOOLSET=vc9"
89 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 9.0\VC\"
90 goto :eof)
91 if NOT "_%VS80COMNTOOLS%_" == "__" (
92 set "BOOST_JAM_TOOLSET=vc8"
93 set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\"
94 goto :eof)
95 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 8\VC\VCVARSALL.BAT" (
96 set "BOOST_JAM_TOOLSET=vc8"
97 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 8\VC\"
98 goto :eof)
99 if NOT "_%VS71COMNTOOLS%_" == "__" (
100 set "BOOST_JAM_TOOLSET=vc7"
101 set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%\..\..\VC7\"
102 goto :eof)
103 if NOT "_%VCINSTALLDIR%_" == "__" (
104 REM %VCINSTALLDIR% is also set for VC9 (and probably VC8)
105 set "BOOST_JAM_TOOLSET=vc7"
106 set "BOOST_JAM_TOOLSET_ROOT=%VCINSTALLDIR%\VC7\"
107 goto :eof)
108 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" (
109 set "BOOST_JAM_TOOLSET=vc7"
110 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\"
111 goto :eof)
112 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\VCVARS32.BAT" (
113 set "BOOST_JAM_TOOLSET=vc7"
114 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio .NET\VC7\"
115 goto :eof)
116 if NOT "_%MSVCDir%_" == "__" (
117 set "BOOST_JAM_TOOLSET=msvc"
118 set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
119 goto :eof)
120 if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" (
121 set "BOOST_JAM_TOOLSET=msvc"
122 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\VC98\"
123 goto :eof)
124 if EXIST "%VS_ProgramFiles%\Microsoft Visual C++\VC98\bin\VCVARS32.BAT" (
125 set "BOOST_JAM_TOOLSET=msvc"
126 set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual C++\VC98\"
127 goto :eof)
128 call :Test_Path cl.exe
129 if not errorlevel 1 (
130 set "BOOST_JAM_TOOLSET=msvc"
131 set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
132 goto :eof)
133 call :Test_Path vcvars32.bat
134 if not errorlevel 1 (
135 set "BOOST_JAM_TOOLSET=msvc"
136 call "%FOUND_PATH%VCVARS32.BAT"
137 set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
138 goto :eof)
139 if EXIST "C:\Borland\BCC55\Bin\bcc32.exe" (
140 set "BOOST_JAM_TOOLSET=borland"
141 set "BOOST_JAM_TOOLSET_ROOT=C:\Borland\BCC55\"
142 goto :eof)
143 call :Test_Path bcc32.exe
144 if not errorlevel 1 (
145 set "BOOST_JAM_TOOLSET=borland"
146 set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
147 goto :eof)
148 call :Test_Path icl.exe
149 if not errorlevel 1 (
150 set "BOOST_JAM_TOOLSET=intel-win32"
151 set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
152 goto :eof)
153 if EXIST "C:\MinGW\bin\gcc.exe" (
154 set "BOOST_JAM_TOOLSET=mingw"
155 set "BOOST_JAM_TOOLSET_ROOT=C:\MinGW\"
156 goto :eof)
157 if NOT "_%CWFolder%_" == "__" (
158 set "BOOST_JAM_TOOLSET=metrowerks"
159 set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\"
160 goto :eof)
161 call :Test_Path mwcc.exe
162 if not errorlevel 1 (
163 set "BOOST_JAM_TOOLSET=metrowerks"
164 set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\..\"
165 goto :eof)
166 REM Could not find a suitable toolset
167 exit /b 1
168
169
170 :Guess_Yacc
171 REM Tries to find bison or yacc in common places so we can build the grammar.
172 call :Test_Path yacc.exe
173 if not errorlevel 1 (
174 set "YACC=yacc -d"
175 goto :eof)
176 call :Test_Path bison.exe
177 if not errorlevel 1 (
178 set "YACC=bison -d --yacc"
179 goto :eof)
180 if EXIST "C:\Program Files\GnuWin32\bin\bison.exe" (
181 set "YACC=C:\Program Files\GnuWin32\bin\bison.exe" -d --yacc
182 goto :eof)
183 exit /b 1