2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 00:52:16 +00:00

Check Visual Studio 2017+ version in script

* Fixed `build.bat` stack overflow on some machines by splitting up to several files
* CSharp script simplified and now will check VC++ toolset version
This commit is contained in:
Arkadiy Shapkin
2017-03-19 00:59:40 +08:00
parent f1e32a7884
commit 00c23580af
8 changed files with 521 additions and 527 deletions

View File

@@ -2,26 +2,24 @@
# subject to the Boost Software License, Version 1.0. (See accompanying # subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# #
# Copyright Rene Rivera 2015-2016. # Copyright Rene Rivera 2015-2017.
build: false
image: image:
- Visual Studio 2013
- Visual Studio 2015
- Visual Studio 2017 - Visual Studio 2017
- Visual Studio 2015
- Visual Studio 2013
environment: environment:
matrix: matrix:
- TOOLSET: msvc - TEST_ALL_EXTRAS:
TEST_ALL_EXTRAS:
build_script:
- ps: |
& .\bootstrap.bat
if (Test-Path bootstrap.log) { appveyor PushArtifact bootstrap.log }
test_script: test_script:
- cd src/engine - ps: |
- build.bat cd test
- cd ../.. & python test_all.py msvc $env:TEST_ALL_EXTRAS
- cd src/tools/vc141helper
- cl141_path.cmd
- cd ../../..
- ./bootstrap.bat --with-toolset=${TOOLSET}
- cd test && python test_all.py ${TOOLSET} ${TEST_ALL_EXTRAS}

View File

@@ -35,18 +35,6 @@ endlocal
goto :eof goto :eof
:Test_Path
REM Tests for the given executable file presence in the directories in the PATH
REM environment variable. Additionaly sets FOUND_PATH to the path of the
REM found file.
call :Clear_Error
setlocal
set test=%~$PATH:1
endlocal
if not errorlevel 1 set FOUND_PATH=%~dp$PATH:1
goto :eof
:Test_Option :Test_Option
REM Tests whether the given string is in the form of an option: "--*" REM Tests whether the given string is in the form of an option: "--*"
call :Clear_Error call :Clear_Error
@@ -85,11 +73,6 @@ endlocal
goto :eof goto :eof
:Call_If_Exists
if EXIST %1 call %*
goto :eof
:Guess_Toolset :Guess_Toolset
REM Try and guess the toolset to bootstrap the build with... REM Try and guess the toolset to bootstrap the build with...
REM Sets BOOST_JAM_TOOLSET to the first found toolset. REM Sets BOOST_JAM_TOOLSET to the first found toolset.
@@ -97,214 +80,29 @@ REM May also set BOOST_JAM_TOOLSET_ROOT to the
REM location of the found toolset. REM location of the found toolset.
call :Clear_Error call :Clear_Error
call :Test_Empty %ProgramFiles% call :Test_Empty "%ProgramFiles%"
if not errorlevel 1 set "ProgramFiles=C:\Program Files" if not errorlevel 1 set "ProgramFiles=C:\Program Files"
REM Visual studio is by default installed to %ProgramFiles% on 32-bit machines and REM Visual studio is by default installed to %ProgramFiles% on 32-bit machines and
REM %ProgramFiles(x86)% on 64-bit machines. Making a common variable for both. REM %ProgramFiles(x86)% on 64-bit machines. Making a common variable for both.
call :Clear_Error call :Clear_Error
call :Test_Empty %ProgramFiles(x86)% call :Test_Empty "%ProgramFiles(x86)%"
if errorlevel 1 ( if errorlevel 1 (
set VS_ProgramFiles=%ProgramFiles(x86)% set "VS_ProgramFiles=%ProgramFiles(x86)%"
) else ( ) else (
set VS_ProgramFiles=%ProgramFiles% set "VS_ProgramFiles=%ProgramFiles%"
) )
call :Clear_Error call guess_toolset.bat
REM Check the variable first. This can be set manually by the user (by running the tools commmand prompt). if errorlevel 1 (
if NOT "_%VS150COMNTOOLS%_" == "__" ( call :Error_Print "Could not find a suitable toolset."
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%"
goto :eof) goto :eof)
:InvalidComnTools
call :Clear_Error
SET cl141cmd="%~dp0..\tools\vc141helper\cl141_path.cmd"
for /F "tokens=*" %%A IN ('cmd /D /S /C "%cl141cmd% InstallationPath"') DO if NOT "_%%A_" == "__" (
if errorlevel 1 goto :VCFind_Error
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%%A\VC\"
goto :eof)
:VCFind_Error
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS140COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc14"
set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 14.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc14"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 14.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS120COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc12"
set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 12.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc12"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 12.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS110COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc11"
set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 11.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc11"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 11.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS100COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc10"
set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 10.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc10"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 10.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS90COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc9"
set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 9.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc9"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 9.0\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS80COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc8"
set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 8\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc8"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 8\VC\"
goto :eof)
call :Clear_Error
if NOT "_%VS71COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%\..\..\VC7\"
goto :eof)
call :Clear_Error
if NOT "_%VCINSTALLDIR%_" == "__" (
REM %VCINSTALLDIR% is also set for VC9 (and probably VC8)
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VCINSTALLDIR%\VC7\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio .NET\VC7\"
goto :eof)
call :Clear_Error
if NOT "_%MSVCDir%_" == "__" (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\VC98\"
goto :eof)
call :Clear_Error
if EXIST "%VS_ProgramFiles%\Microsoft Visual C++\VC98\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual C++\VC98\"
goto :eof)
call :Clear_Error
call :Test_Path cl.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
goto :eof)
call :Clear_Error
call :Test_Path vcvars32.bat
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=msvc"
call "%FOUND_PATH%VCVARS32.BAT"
set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
goto :eof)
call :Clear_Error
if EXIST "C:\Borland\BCC55\Bin\bcc32.exe" (
set "BOOST_JAM_TOOLSET=borland"
set "BOOST_JAM_TOOLSET_ROOT=C:\Borland\BCC55\"
goto :eof)
call :Clear_Error
call :Test_Path bcc32.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=borland"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
goto :eof)
call :Clear_Error
call :Test_Path icl.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=intel-win32"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
goto :eof)
call :Clear_Error
if EXIST "C:\MinGW\bin\gcc.exe" (
set "BOOST_JAM_TOOLSET=mingw"
set "BOOST_JAM_TOOLSET_ROOT=C:\MinGW\"
goto :eof)
call :Clear_Error
if NOT "_%CWFolder%_" == "__" (
set "BOOST_JAM_TOOLSET=metrowerks"
set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\"
goto :eof )
call :Clear_Error
call :Test_Path mwcc.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=metrowerks"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\..\"
goto :eof)
call :Clear_Error
call :Error_Print "Could not find a suitable toolset."
goto :eof
:Guess_Yacc :Guess_Yacc
REM Tries to find bison or yacc in common places so we can build the grammar. call guess_toolset.bat yacc
call :Clear_Error if errorlevel 1 (
call :Test_Path yacc.exe call :Error_Print "Could not find Yacc to build the Jam grammar.")
if not errorlevel 1 (
set "YACC=yacc -d"
goto :eof)
call :Clear_Error
call :Test_Path bison.exe
if not errorlevel 1 (
set "YACC=bison -d --yacc"
goto :eof)
call :Clear_Error
if EXIST "C:\Program Files\GnuWin32\bin\bison.exe" (
set "YACC=C:\Program Files\GnuWin32\bin\bison.exe" -d --yacc
goto :eof)
call :Clear_Error
call :Error_Print "Could not find Yacc to build the Jam grammar."
goto :eof goto :eof
@@ -356,213 +154,7 @@ if errorlevel 1 (
goto Setup_Args goto Setup_Args
) )
:Config_Toolset :Config_Toolset
if NOT "_%BOOST_JAM_TOOLSET%_" == "_metrowerks_" goto Skip_METROWERKS call config_toolset.bat
if NOT "_%CWFolder%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\"
)
set "PATH=%BOOST_JAM_TOOLSET_ROOT%Other Metrowerks Tools\Command Line Tools;%PATH%"
set "BOOST_JAM_CC=mwcc -runtime ss -cwd include -DNT -lkernel32.lib -ladvapi32.lib -luser32.lib"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_METROWERKS
if NOT "_%BOOST_JAM_TOOLSET%_" == "_msvc_" goto Skip_MSVC
if NOT "_%MSVCDir%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
)
call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT"
if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
)
set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_MSVC
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc7_" goto Skip_VC7
if NOT "_%VS71COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%..\..\VC7\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT"
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC7
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc8_" goto Skip_VC8
if NOT "_%VS80COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
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"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC8
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc9_" goto Skip_VC9
if NOT "_%VS90COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC9
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc10_" goto Skip_VC10
if NOT "_%VS100COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC10
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc11_" goto Skip_VC11
if NOT "_%VS110COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC11
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc12_" goto Skip_VC12
if NOT "_%VS120COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC12
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc14_" goto Skip_VC14
if NOT "_%VS140COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC14
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc1410_" goto Skip_VC1410
if NOT "_%VS150COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
)
REM vc1410 vsvarsall requires the architecture as a parameter.
set BOOST_JAM_ARCH=x86
if NOT "_%PROCESSOR_ARCHITECTURE%_" == "__" set BOOST_JAM_ARCH=%PROCESSOR_ARCHITECTURE%
if NOT "_%Platform%_" == "__" set BOOST_JAM_ARCH=%Platform%
set BOOST_JAM_ARGS=%BOOST_JAM_ARGS% %BOOST_JAM_ARCH%
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC1410
if NOT "_%BOOST_JAM_TOOLSET%_" == "_borland_" goto Skip_BORLAND
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
call :Test_Path bcc32.exe )
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
) )
if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%Bin;%PATH%"
)
set "BOOST_JAM_CC=bcc32 -WC -w- -q -I%BOOST_JAM_TOOLSET_ROOT%Include -L%BOOST_JAM_TOOLSET_ROOT%Lib /DNT -nbootstrap"
set "BOOST_JAM_OPT_JAM=-ejam0"
set "BOOST_JAM_OPT_MKJAMBASE=-emkjambasejam0"
set "BOOST_JAM_OPT_YYACC=-eyyacc0"
set "_known_=1"
:Skip_BORLAND
if NOT "_%BOOST_JAM_TOOLSET%_" == "_como_" goto Skip_COMO
set "BOOST_JAM_CC=como -DNT"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_COMO
if NOT "_%BOOST_JAM_TOOLSET%_" == "_gcc_" goto Skip_GCC
set "BOOST_JAM_CC=gcc -DNT"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_GCC
if NOT "_%BOOST_JAM_TOOLSET%_" == "_gcc-nocygwin_" goto Skip_GCC_NOCYGWIN
set "BOOST_JAM_CC=gcc -DNT -mno-cygwin"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_GCC_NOCYGWIN
if NOT "_%BOOST_JAM_TOOLSET%_" == "_intel-win32_" goto Skip_INTEL_WIN32
set "BOOST_JAM_CC=icl -DNT /nologo kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_INTEL_WIN32
if NOT "_%BOOST_JAM_TOOLSET%_" == "_mingw_" goto Skip_MINGW
if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
)
set "BOOST_JAM_CC=gcc -DNT"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_MINGW
call :Clear_Error
if "_%_known_%_" == "__" ( if "_%_known_%_" == "__" (
call :Error_Print "Unknown toolset: %BOOST_JAM_TOOLSET%" call :Error_Print "Unknown toolset: %BOOST_JAM_TOOLSET%"
) )

View File

@@ -0,0 +1,238 @@
@ECHO OFF
REM ~ Copyright 2002-2007 Rene Rivera.
REM ~ Distributed under the Boost Software License, Version 1.0.
REM ~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
goto Start
:Call_If_Exists
if EXIST %1 call %*
goto :eof
:Start
REM Setup the toolset command and options. This bit of code
REM needs to be flexible enough to handle both when
REM the toolset was guessed at and found, or when the toolset
REM was indicated in the command arguments.
REM NOTE: The strange multiple "if ?? == _toolset_" tests are that way
REM because in BAT variables are subsituted only once during a single
REM command. A complete "if ... else ..."
REM is a single command, even though it's in multiple lines here.
if NOT "_%BOOST_JAM_TOOLSET%_" == "_metrowerks_" goto Skip_METROWERKS
if NOT "_%CWFolder%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\"
)
set "PATH=%BOOST_JAM_TOOLSET_ROOT%Other Metrowerks Tools\Command Line Tools;%PATH%"
set "BOOST_JAM_CC=mwcc -runtime ss -cwd include -DNT -lkernel32.lib -ladvapi32.lib -luser32.lib"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_METROWERKS
if NOT "_%BOOST_JAM_TOOLSET%_" == "_msvc_" goto Skip_MSVC
if NOT "_%MSVCDir%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
)
call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT"
if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
)
set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_MSVC
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc7_" goto Skip_VC7
if NOT "_%VS71COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%..\..\VC7\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%bin\VCVARS32.BAT"
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC7
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc8_" goto Skip_VC8
if NOT "_%VS80COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
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"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC8
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc9_" goto Skip_VC9
if NOT "_%VS90COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC9
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc10_" goto Skip_VC10
if NOT "_%VS100COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC10
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc11_" goto Skip_VC11
if NOT "_%VS110COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\"
)
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC11
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc12_" goto Skip_VC12
if NOT "_%VS120COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
)
if "_%BOOST_JAM_ARCH%_" == "__" set BOOST_JAM_ARCH=x86
set BOOST_JAM_ARGS=%BOOST_JAM_ARGS% %BOOST_JAM_ARCH%
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC12
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc14_" goto Skip_VC14
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if NOT "_%VS140COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\"
))
if "_%BOOST_JAM_ARCH%_" == "__" set BOOST_JAM_ARCH=x86
set BOOST_JAM_ARGS=%BOOST_JAM_ARGS% %BOOST_JAM_ARCH%
if "_%VCINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%VCVARSALL.BAT" %BOOST_JAM_ARGS%
if NOT "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if "_%VCINSTALLDIR%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
) )
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC14
if NOT "_%BOOST_JAM_TOOLSET%_" == "_vc1410_" goto Skip_VC1410
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if NOT "_%VS150COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
))
SET cl_path_cmd="%~dp0..\tools\vc141helper\cl_path.cmd"
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
for /f "tokens=*" %%A in ('cmd /D /S /C "%cl_path_cmd% 14.10"') do if NOT errorlevel 1 if NOT "_%%A_" == "__" (
set "BOOST_JAM_TOOLSET_ROOT=%%A\VC\"))
REM vc1410 vsvarsall requires the architecture as a parameter.
if "_%BOOST_JAM_ARCH%_" == "__" set BOOST_JAM_ARCH=x86
set BOOST_JAM_ARGS=%BOOST_JAM_ARGS% %BOOST_JAM_ARCH%
if "_%VSINSTALLDIR%_" == "__" call :Call_If_Exists "%BOOST_JAM_TOOLSET_ROOT%Auxiliary\Build\vcvarsall.bat" %BOOST_JAM_ARGS%
set "BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_VC1410
if NOT "_%BOOST_JAM_TOOLSET%_" == "_borland_" goto Skip_BORLAND
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
call :Test_Path bcc32.exe )
if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
) )
if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%Bin;%PATH%"
)
set "BOOST_JAM_CC=bcc32 -WC -w- -q -I%BOOST_JAM_TOOLSET_ROOT%Include -L%BOOST_JAM_TOOLSET_ROOT%Lib /DNT -nbootstrap"
set "BOOST_JAM_OPT_JAM=-ejam0"
set "BOOST_JAM_OPT_MKJAMBASE=-emkjambasejam0"
set "BOOST_JAM_OPT_YYACC=-eyyacc0"
set "_known_=1"
:Skip_BORLAND
if NOT "_%BOOST_JAM_TOOLSET%_" == "_como_" goto Skip_COMO
set "BOOST_JAM_CC=como -DNT"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_COMO
if NOT "_%BOOST_JAM_TOOLSET%_" == "_gcc_" goto Skip_GCC
set "BOOST_JAM_CC=gcc -DNT"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_GCC
if NOT "_%BOOST_JAM_TOOLSET%_" == "_gcc-nocygwin_" goto Skip_GCC_NOCYGWIN
set "BOOST_JAM_CC=gcc -DNT -mno-cygwin"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_GCC_NOCYGWIN
if NOT "_%BOOST_JAM_TOOLSET%_" == "_intel-win32_" goto Skip_INTEL_WIN32
set "BOOST_JAM_CC=icl -DNT /nologo kernel32.lib advapi32.lib user32.lib"
set "BOOST_JAM_OPT_JAM=/Febootstrap\jam0"
set "BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0"
set "BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0"
set "_known_=1"
:Skip_INTEL_WIN32
if NOT "_%BOOST_JAM_TOOLSET%_" == "_mingw_" goto Skip_MINGW
if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
)
set "BOOST_JAM_CC=gcc -DNT"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_MINGW
exit /b %errorlevel%

View File

@@ -0,0 +1,184 @@
@ECHO OFF
REM ~ Copyright 2002-2007 Rene Rivera.
REM ~ Distributed under the Boost Software License, Version 1.0.
REM ~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
if "_%1_" == "_yacc_" goto Guess_Yacc
goto Guess
:Clear_Error
ver >nul
goto :eof
:Test_Path
REM Tests for the given executable file presence in the directories in the PATH
REM environment variable. Additionaly sets FOUND_PATH to the path of the
REM found file.
call :Clear_Error
setlocal
set test=%~$PATH:1
endlocal
if not errorlevel 1 set FOUND_PATH=%~dp$PATH:1
goto :eof
:Guess
REM Check the variable first. This can be set manually by the user (by running the tools commmand prompt).
call :Clear_Error
if NOT "_%VS150COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\"
goto :eof)
SET cl_path_cmd="%~dp0..\tools\vc141helper\cl_path.cmd"
for /f "tokens=*" %%A in ('cmd /D /S /C "%cl_path_cmd% 14.10"') do if NOT errorlevel 1 if NOT "_%%A_" == "__" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%%A\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Professional\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
set "BOOST_JAM_TOOLSET=vc1410"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\2017\Community\VC\"
goto :eof)
if NOT "_%VS140COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc14"
set "BOOST_JAM_TOOLSET_ROOT=%VS140COMNTOOLS%..\..\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 14.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc14"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 14.0\VC\"
goto :eof)
if NOT "_%VS120COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc12"
set "BOOST_JAM_TOOLSET_ROOT=%VS120COMNTOOLS%..\..\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 12.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc12"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 12.0\VC\"
goto :eof)
if NOT "_%VS110COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc11"
set "BOOST_JAM_TOOLSET_ROOT=%VS110COMNTOOLS%..\..\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 11.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc11"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 11.0\VC\"
goto :eof)
if NOT "_%VS100COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc10"
set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 10.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc10"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 10.0\VC\"
goto :eof)
if NOT "_%VS90COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc9"
set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 9.0\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc9"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 9.0\VC\"
goto :eof)
if NOT "_%VS80COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc8"
set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio 8\VC\VCVARSALL.BAT" (
set "BOOST_JAM_TOOLSET=vc8"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio 8\VC\"
goto :eof)
if NOT "_%VS71COMNTOOLS%_" == "__" (
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%\..\..\VC7\"
goto :eof)
if NOT "_%VCINSTALLDIR%_" == "__" (
REM %VCINSTALLDIR% is also set for VC9 (and probably VC8)
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VCINSTALLDIR%\VC7\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=vc7"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio .NET\VC7\"
goto :eof)
if NOT "_%MSVCDir%_" == "__" (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual Studio\VC98\"
goto :eof)
if EXIST "%VS_ProgramFiles%\Microsoft Visual C++\VC98\bin\VCVARS32.BAT" (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%VS_ProgramFiles%\Microsoft Visual C++\VC98\"
goto :eof)
call :Test_Path cl.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=msvc"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
goto :eof)
call :Test_Path vcvars32.bat
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=msvc"
call "%FOUND_PATH%VCVARS32.BAT"
set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"
goto :eof)
if EXIST "C:\Borland\BCC55\Bin\bcc32.exe" (
set "BOOST_JAM_TOOLSET=borland"
set "BOOST_JAM_TOOLSET_ROOT=C:\Borland\BCC55\"
goto :eof)
call :Test_Path bcc32.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=borland"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
goto :eof)
call :Test_Path icl.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=intel-win32"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"
goto :eof)
if EXIST "C:\MinGW\bin\gcc.exe" (
set "BOOST_JAM_TOOLSET=mingw"
set "BOOST_JAM_TOOLSET_ROOT=C:\MinGW\"
goto :eof)
if NOT "_%CWFolder%_" == "__" (
set "BOOST_JAM_TOOLSET=metrowerks"
set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\"
goto :eof)
call :Test_Path mwcc.exe
if not errorlevel 1 (
set "BOOST_JAM_TOOLSET=metrowerks"
set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\..\"
goto :eof)
REM Could not find a suitable toolset
exit /b 1
:Guess_Yacc
REM Tries to find bison or yacc in common places so we can build the grammar.
call :Test_Path yacc.exe
if not errorlevel 1 (
set "YACC=yacc -d"
goto :eof)
call :Test_Path bison.exe
if not errorlevel 1 (
set "YACC=bison -d --yacc"
goto :eof)
if EXIST "C:\Program Files\GnuWin32\bin\bison.exe" (
set "YACC=C:\Program Files\GnuWin32\bin\bison.exe" -d --yacc
goto :eof)
exit /b 1

View File

@@ -711,8 +711,8 @@ local rule auto-detect-toolset-versions ( )
if $(i) = 14.10 if $(i) = 14.10
{ {
local file = [ path.make [ modules.binding $(__name__) ] ] ; local file = [ path.make [ modules.binding $(__name__) ] ] ;
local cl141_path = [ path.native [ path.join [ path.parent $(file) ] vc141helper cl141_path.cmd ] ] ; local cl_path = [ path.native [ path.join [ path.parent $(file) ] vc141helper cl_path.cmd ] ] ;
local shell_ret = [ SHELL $(cl141_path) ] ; local shell_ret = [ SHELL "$(cl_path) 14.10 -PathToCompiler" ] ;
local cl_path = $(shell_ret:D) ; local cl_path = $(shell_ret:D) ;
if $(cl_path) if $(cl_path)
{ {
@@ -1635,7 +1635,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
.version-alias-11 = 11.0 ; .version-alias-11 = 11.0 ;
.version-alias-12 = 12.0 ; .version-alias-12 = 12.0 ;
.version-alias-14 = 14.0 ; .version-alias-14 = 14.0 ;
.version-alias-15 = 14.10 ; .version-alias-14.1 = 14.10 ;
# Names of registry keys containing the Visual C++ installation path (relative # Names of registry keys containing the Visual C++ installation path (relative
# to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft"). # to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft").

View File

@@ -1,14 +1,36 @@
# Copyright 2017 - Refael Ackermann # Copyright 2017 - Refael Ackermann
# Copyright 2017 - Arkady Shapkin
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at # (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt) # http://www.boost.org/LICENSE_1_0.txt)
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$toolsetVersion,
[switch]$pathToCompiler = $false
)
# Is Microsoft.VisualStudio.Setup.Configuration.Native.dll installed
if (-NOT (Test-Path 'Registry::HKEY_CLASSES_ROOT\CLSID\{177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D}')) { Exit 1 } if (-NOT (Test-Path 'Registry::HKEY_CLASSES_ROOT\CLSID\{177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D}')) { Exit 1 }
$jsonFile = '.tmp.json'
Invoke-Expression 'powershell -NoProfile -ExecutionPolicy Unrestricted -Command "&{ Add-Type -Path GetVS2017Configuration.cs; [VisualStudioConfiguration.Main]::Query()}"' > $jsonFile Add-Type -Path (Join-Path $PSScriptRoot GetVS2017Configuration.cs) | Out-Null
$instPath = (Get-Content $jsonFile | ? {$_ -like "*InstallationPath*"}) -split '"' -replace '\\\\', '\' | Select-Object -skip 3 -first 1 $instPath = [VisualStudioConfiguration.Main]::Query($toolsetVersion)
Remove-Item $jsonFile
if ($args[0] -eq 'InstallationPath') { echo $instPath; exit } if ($pathToCompiler)
if ($env:PROCESSOR_ARCHITEW6432 -ne $null) {$filt = '*64\x64*'} else {$filt = '*86\x86*'} {
$cls = get-childitem $instPath -Include cl.exe -Recurse | ? { $_.Directory -like '*Host*' } if ($env:PROCESSOR_ARCHITEW6432 -ne $null) {$filt = '*64\x64*'} else {$filt = '*86\x86*'}
$cl = $cls | ? { $_.Directory -like $filt } $cls = get-childitem $instPath -Include cl.exe -Recurse | ? { $_.Directory -like '*Host*' }
if ($cl -ne $null) {echo $cl.FullName} else {echo $cls[0].FullName} $cl = $cls | ? { $_.Directory -like $filt }
if ($cl -ne $null)
{
Write-Output $cl.FullName
}
else
{
Write-Output $cls[0].FullName
}
}
else
{
Write-Output $instPath
}

View File

@@ -1,14 +1,17 @@
// Copyright 2017 - Refael Ackermann // Copyright 2017 - Refael Ackermann
// Copyright 2017 - Arkady Shapkin
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace VisualStudioConfiguration namespace VisualStudioConfiguration
{ {
#region VS setup COM types
[Flags] [Flags]
public enum InstanceState : uint public enum InstanceState : uint
{ {
@@ -180,88 +183,52 @@ namespace VisualStudioConfiguration
public class SetupConfigurationClass public class SetupConfigurationClass
{ {
} }
#endregion
public static class Main public static class Main
{ {
public static string Query(string vcToolVersion)
public static void Echo(string tmplt, params Object[] args)
{ {
string str = (args.Length > 0) ? String.Format(tmplt, args) : tmplt; ISetupConfiguration query = new SetupConfiguration();
Console.Write(" " + str + '\n'); ISetupConfiguration2 query2 = (ISetupConfiguration2)query;
} IEnumSetupInstances e = query2.EnumAllInstances();
ISetupInstance2[] rgelt = new ISetupInstance2[1];
public static void Query() int pceltFetched;
{
ISetupConfiguration query = new SetupConfiguration();
ISetupConfiguration2 query2 = (ISetupConfiguration2) query;
IEnumSetupInstances e = query2.EnumAllInstances();
ISetupInstance2[] rgelt = new ISetupInstance2[1];
int pceltFetched;
Echo("[");
e.Next(1, rgelt, out pceltFetched); e.Next(1, rgelt, out pceltFetched);
while (pceltFetched > 0) var instances = new List<KeyValuePair<Version, string>>();
{ while (pceltFetched > 0)
PrintInstance(rgelt[0]); {
var inst = CheckVsInstance(rgelt[0], vcToolVersion);
if (inst != null)
instances.Add(inst.Value);
e.Next(1, rgelt, out pceltFetched); e.Next(1, rgelt, out pceltFetched);
if (pceltFetched > 0) }
Echo(",");
} // find latest VC++ compiler for given version
Echo("]"); var latestInst = instances.OrderByDescending(i => i.Key).FirstOrDefault();
return latestInst.Value;
} }
private static void PrintInstance(ISetupInstance2 setupInstance2) private static KeyValuePair<Version, string>? CheckVsInstance(ISetupInstance2 setupInstance2, string vcToolVersion)
{ {
Echo("{");
string[] prodParts = setupInstance2.GetProduct().GetId().Split('.');
Array.Reverse(prodParts);
string prod = prodParts[0];
string instPath = setupInstance2.GetInstallationPath().Replace("\\", "\\\\");
string installationVersion = setupInstance2.GetInstallationVersion();
bool isComplete = setupInstance2.IsComplete(); bool isComplete = setupInstance2.IsComplete();
bool isLaunchable = setupInstance2.IsLaunchable(); bool isLaunchable = setupInstance2.IsLaunchable();
Echo("\"Product\": \"{0}\",", prod); if (isComplete && isLaunchable)
Echo("\"Version\": \"{0}\",", installationVersion); return null;
Echo("\"InstallationPath\": \"{0}\",", instPath); InstanceState state = setupInstance2.GetState();
Echo("\"IsComplete\": \"{0}\",", isComplete ? "true" : "false"); if ((state & InstanceState.Local) != InstanceState.Local)
Echo("\"IsLaunchable\": \"{0}\",", isLaunchable ? "true" : "false"); return null;
String cmd = (instPath + "\\\\Common7\\\\Tools\\\\VsDevCmd.bat");
Echo("\"CmdPath\": \"{0}\",", cmd);
List<string> packs = new List<String>(); var vctools = setupInstance2.GetPackages()
string MSBuild = "false"; .FirstOrDefault(item => item.GetId() == "Microsoft.VisualCpp.Tools.Core");
string VCTools = "false"; if (vctools == null)
string Win8SDK = "0"; return null;
string sdk10Ver = "0"; string version = vctools.GetVersion();
foreach (ISetupPackageReference package in setupInstance2.GetPackages()) if (!version.StartsWith(vcToolVersion + "."))
{ return null;
string id = package.GetId();
string ver = package.GetVersion();
string detail = "{\"id\": \"" + id + "\", \"version\":\"" + ver + "\"}";
packs.Add(" " + detail);
if (id.Contains("Component.MSBuild")) { string instPath = setupInstance2.GetInstallationPath();
MSBuild = detail; return new KeyValuePair<Version, string>(new Version(version), instPath);
} else if (id.Contains("VC.Tools")) {
VCTools = detail;
} else if (id.Contains("Microsoft.Windows.81SDK")) {
if (Win8SDK.CompareTo(ver) > 0) continue;
Win8SDK = ver;
} else if (id.Contains("Win10SDK_10")) {
if (sdk10Ver.CompareTo(ver) > 0) continue;
sdk10Ver = ver;
}
}
packs.Sort();
string[] sdk10Parts = sdk10Ver.Split('.');
sdk10Parts[sdk10Parts.Length - 1] = "0";
Echo("\"MSBuild\": {0},", MSBuild);
Echo("\"VCTools\": {0},", VCTools);
Echo("\"SDK8\": \"{0}\",", Win8SDK);
Echo("\"SDK10\": \"{0}\",", sdk10Ver);
Echo("\"SDK\": \"{0}\",", String.Join(".", sdk10Parts));
Echo("\"Packages\": [\n {0} \n ]", String.Join(",\n ", packs.ToArray()));
Echo("}");
} }
} }
} }

View File

@@ -1,16 +1,9 @@
:: Copyright 2017 - Refael Ackermann :: Copyright 2017 - Refael Ackermann
:: Copyright 2017 - Arkady Shapkin
:: Distributed under the Boost Software License, Version 1.0. :: Distributed under the Boost Software License, Version 1.0.
:: (See accompanying file LICENSE_1_0.txt or copy at :: (See accompanying file LICENSE_1_0.txt or copy at
:: http://www.boost.org/LICENSE_1_0.txt) :: http://www.boost.org/LICENSE_1_0.txt)
@IF NOT DEFINED DEBUG_GETTER @ECHO OFF @ECHO OFF
SETLOCAL FOR /F "tokens=*" %%A IN ('powershell -NoProfile -ExecutionPolicy Bypass "%~dp0GetCLPath.ps1" %1 %2') DO (
PUSHD %~dp0 ECHO %%A
SET PROMPT=$G )
SET DEBUG_GETTER=
CALL :find_CL %~dp0 %1
POPD
GOTO :eof
:find_CL
FOR /F "tokens=*" %%A IN ('powershell -NoProfile -ExecutionPolicy Unrestricted "%1GetCLPath.ps1" %2') DO ECHO %%A& EXIT /B
GOTO :eof