diff options
Diffstat (limited to 'tools/build')
-rw-r--r-- | tools/build/Jamroot.jam | 2 | ||||
-rw-r--r-- | tools/build/doc/src/overview.xml | 38 | ||||
-rw-r--r-- | tools/build/doc/src/reference.xml | 86 | ||||
-rw-r--r-- | tools/build/src/build/ac.jam | 14 | ||||
-rw-r--r-- | tools/build/src/build/targets.jam | 4 | ||||
-rw-r--r-- | tools/build/src/engine/build.bat | 416 | ||||
-rw-r--r-- | tools/build/src/engine/build.jam | 3 | ||||
-rw-r--r-- | tools/build/src/engine/config_toolset.bat | 233 | ||||
-rw-r--r-- | tools/build/src/engine/guess_toolset.bat | 179 | ||||
-rw-r--r-- | tools/build/src/tools/clang-linux.jam | 4 | ||||
-rw-r--r-- | tools/build/src/tools/emscripten.jam | 5 | ||||
-rw-r--r-- | tools/build/src/tools/msvc.jam | 105 | ||||
-rw-r--r-- | tools/build/src/tools/msvc.py | 2 | ||||
-rw-r--r-- | tools/build/src/tools/python.jam | 48 | ||||
-rw-r--r-- | tools/build/src/tools/qcc.jam | 2 | ||||
-rw-r--r-- | tools/build/test/core-language/test.jam | 2 |
16 files changed, 686 insertions, 457 deletions
diff --git a/tools/build/Jamroot.jam b/tools/build/Jamroot.jam index 2f50eed092..d7f76b7c95 100644 --- a/tools/build/Jamroot.jam +++ b/tools/build/Jamroot.jam @@ -35,7 +35,9 @@ package.install-data boost-build-core $(SELF)/boost-build.jam $(SELF)/src/build-system.jam [ path.glob-tree $(SELF)/src/build : *.jam *.py ] + [ path.glob-tree $(SELF)/src/contrib : *.jam *.py ] [ path.glob-tree $(SELF)/src/kernel : *.jam *.py ] + [ path.glob-tree $(SELF)/src/options : *.jam *.py ] [ path.glob-tree $(SELF)/src/util : *.jam *.py ] [ path.glob-tree $(SELF)/src/tools : *.jam *.py *.xml *.xsl *.doxyfile *.hpp ] $(e2) diff --git a/tools/build/doc/src/overview.xml b/tools/build/doc/src/overview.xml index 37bae1c96e..25184d4f46 100644 --- a/tools/build/doc/src/overview.xml +++ b/tools/build/doc/src/overview.xml @@ -526,6 +526,9 @@ using msvc : : echo Compiling && foo/bar/baz/cl ; using gcc : 3.3 ; using gcc : 3.4 : g++-3.4 ; using gcc : 3.2 : g++-3.2 ; +using gcc : 5 ; +using clang : 3.9 ; +using msvc : 14.0 ; </programlisting> Note that in the first call to <code language="jam">using</code>, the compiler found in the <envar>PATH</envar> will be used, and there is no @@ -555,7 +558,8 @@ using gcc : 3.4 : g++-3.4 ; <varname>cflags</varname>, <varname>cxxflags</varname>, <varname>compileflags</varname> and <varname>linkflags</varname> as <parameter class="function">options</parameter> specifying flags that will be - always passed to the corresponding tools. Values of the + always passed to the corresponding tools. There must not be a space + between the tag for the option name and the value. Values of the <varname>cflags</varname> feature are passed directly to the C compiler, values of the <varname>cxxflags</varname> feature are passed directly to the C++ compiler, and values of the @@ -563,7 +567,37 @@ using gcc : 3.4 : g++-3.4 ; example, to configure a <command>gcc</command> toolset so that it always generates 64-bit code you could write: <programlisting> - using gcc : 3.4 : : <compileflags>-m64 <linkflags>-m64 ; +using gcc : 3.4 : : <compileflags>-m64 <linkflags>-m64 ; +</programlisting> + </para> + + <para> + If multiple of the same type of options are needed, they can be + concatenated with quotes or have multiple instances of the option tag. +<programlisting> +using gcc : 5 : : <cxxflags>"-std=c++14 -O2" ; +using clang : 3.9 : : <cxxflags>-std=c++14 <cxxflags>-O2 ; +</programlisting> + </para> + + <para> + Multiple varaiations of the same tool can be used for most tools. + These are deliniated by the version passed in. Because the dash '-' + cannot be used here, the convention has become to use the tilde '~' to + deliniate variations. + +<programlisting> +using gcc : 5 : g++-5 : ; # default is C++ 98 +using gcc : 5~c++03 : g++-5 : <cxxflags>-std=c++03 ; # C++ 03 +using gcc : 5~gnu03 : g++-5 : <cxxflags>-std=gnu++03 ; # C++ 03 with GNU +using gcc : 5~c++11 : g++-5 : <cxxflags>-std=c++11 ; # C++ 11 +using gcc : 5~c++14 : g++-5 : <cxxflags>-std=c++14 ; # C++ 14 +</programlisting> + + These are then used as normal toolsets: +<programlisting> +b2 toolset=gcc-5 stage +b2 toolset=gcc-5~c++14 stage </programlisting> </para> diff --git a/tools/build/doc/src/reference.xml b/tools/build/doc/src/reference.xml index 7e4c4ec86e..6dad2e0143 100644 --- a/tools/build/doc/src/reference.xml +++ b/tools/build/doc/src/reference.xml @@ -1021,6 +1021,7 @@ using gcc : &toolset_ops; ;</programlisting> C++</ulink> command-line tools on Microsoft Windows. The supported products and versions of command line tools are listed below:</para> <itemizedlist> + <listitem><para>Visual Studio 2017—14.1</para></listitem> <listitem><para>Visual Studio 2015—14.0</para></listitem> <listitem><para>Visual Studio 2013—12.0</para></listitem> <listitem><para>Visual Studio 2012—11.0</para></listitem> @@ -1032,6 +1033,14 @@ using gcc : &toolset_ops; ;</programlisting> <listitem><para>Visual Studio 6.0, Service Pack 5—6.5</para></listitem> </itemizedlist> + <para>The user would then call the boost build executable with the + toolset set equal to <command>msvc-[version number]</command> for + example to build with Visual Studio 2017 one could run: + <programlisting> +.\b2 toolset=msvc-14.1 target + </programlisting> + </para> + <para>The <code>msvc</code> module is initialized using the following syntax:</para> <programlisting> @@ -1698,6 +1707,83 @@ using zlib : 1.2.7 : : <toolset>gcc ; </programlisting> </section> + <section id="bbv2.reference.tools.libraries.bzip2"> + <title>bzip2</title> + <indexterm><primary>bzip2</primary></indexterm> + + <para>Provides support for the + <ulink url="http://www.bzip.org">bzip2</ulink> library. bzip2 + can be configured either to use precompiled binaries or to + build the library from source.</para> + + <para>bzip2 can be initialized using the following syntax</para> + <programlisting> +using bzip2 : <optional><replaceable>version</replaceable></optional> : <optional><replaceable>options</replaceable></optional> : <optional><replaceable>condition</replaceable></optional> : <optional><replaceable>is-default</replaceable></optional> ; + </programlisting> + <para>Options for using a prebuilt library:</para> + <variablelist> + <varlistentry> + <term><literal>search</literal></term> + <listitem> + <para>The directory containing the bzip2 binaries.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>name</literal></term> + <listitem> + <para>Overrides the default library name.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>include</literal></term> + <listitem> + <para>The directory containing the bzip2 headers.</para> + </listitem> + </varlistentry> + </variablelist> + <para>If none of these options is specified, then the environmental + variables BZIP2_LIBRARY_PATH, BZIP2_NAME, and BZIP2_INCLUDE will be + used instead.</para> + <para>Options for building bzip2 from source:</para> + <variablelist> + <varlistentry> + <term><literal>source</literal></term> + <listitem> + <para>The bzip2 source directory. Defaults to the + environmental variable BZIP2_SOURCE.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>tag</literal></term> + <listitem> + <para>Sets the <link linkend="bbv2.builtin.features.tag">tag</link> + property to adjust the file name of the library. Ignored + when using precompiled binaries.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>build-name</literal></term> + <listitem> + <para>The base name to use for the compiled library. + Ignored when using precompiled binaries.</para> + </listitem> + </varlistentry> + </variablelist> + <para>Examples:</para> + <programlisting> +# Find bzip in the default system location +using bzip2 ; +# Build bzip from source +using bzip2 : 1.0.6 : <source>/home/sergey/src/bzip2-1.0.6 ; +# Find bzip in /usr/local +using bzip2 : 1.0.6 : <include>/usr/local/include <search>/usr/local/lib ; +# Build bzip from source for msvc and find +# prebuilt binaries for gcc. +using bzip2 : 1.0.6 : <source>C:/Devel/src/bzip2-1.0.6 : <toolset>msvc ; +using bzip2 : 1.0.6 : : <toolset>gcc ; +</programlisting> + </section> + </section> <section> diff --git a/tools/build/src/build/ac.jam b/tools/build/src/build/ac.jam index c6e36c6a50..c01dc59973 100644 --- a/tools/build/src/build/ac.jam +++ b/tools/build/src/build/ac.jam @@ -76,14 +76,6 @@ rule construct-library ( name : property-set : provided-path ? ) rule find-library ( properties : names + : provided-path ? ) { local result ; - if ! $(.main.cpp) - { - local a = [ class.new action : ac.generate-main : - [ property-set.empty ] ] ; - .main.cpp = [ virtual-target.register - [ class.new file-target main.cpp exact - : CPP : $(.project) : $(a) ] ] ; - } if [ $(properties).get <link> ] = shared { link-opts = <link>shared <link>static ; @@ -100,8 +92,12 @@ rule find-library ( properties : names + : provided-path ? ) { local name = $(names-iter[1]) ; local lib = [ construct-library $(name) : $(properties) : $(provided-path) ] ; + local a = [ class.new action : ac.generate-main : + [ property-set.empty ] ] ; + local main.cpp = [ virtual-target.register + [ class.new file-target main-$(name).cpp exact : CPP : $(.project) : $(a) ] ] ; local test = [ generators.construct $(.project) $(name) : EXE - : [ $(properties).add $(lib[1]) ] : $(.main.cpp) $(lib[2-]) + : [ $(properties).add $(lib[1]) ] : $(main.cpp) $(lib[2-]) : true ] ; local jam-targets ; for t in $(test[2-]) diff --git a/tools/build/src/build/targets.jam b/tools/build/src/build/targets.jam index 2cfe08e05b..375af4e237 100644 --- a/tools/build/src/build/targets.jam +++ b/tools/build/src/build/targets.jam @@ -654,13 +654,13 @@ class main-target : abstract-target # Returns the best viable alternative for this property-set. See the # documentation for selection rules. # - local rule select-alternatives ( property-set debug ? ) + rule select-alternatives ( property-set debug ? ) { # When selecting alternatives we have to consider defaults, for example: # lib l : l.cpp : <variant>debug ; # lib l : l_opt.cpp : <variant>release ; # will not work unless we add default value <variant>debug. - property-set = [ $(p).add-defaults ] ; + property-set = [ $(property-set).add-defaults ] ; # The algorithm: we keep the current best viable alternative. When we # encounter a new best viable alternative, we compare it with the diff --git a/tools/build/src/engine/build.bat b/tools/build/src/engine/build.bat index 2086f37a7d..7466400ed5 100644 --- a/tools/build/src/engine/build.bat +++ b/tools/build/src/engine/build.bat @@ -27,26 +27,19 @@ ECHO ### ECHO ### You can specify the toolset as the argument, i.e.: ECHO ### .\build.bat msvc ECHO ### -ECHO ### Toolsets supported by this script are: borland, como, gcc, gcc-nocygwin, -ECHO ### intel-win32, metrowerks, mingw, msvc, vc7, vc8, vc9, vc10, vc11, vc12, vc14, vc15 +ECHO ### Toolsets supported by this script are: borland, como, gcc, +ECHO ### gcc-nocygwin, intel-win32, metrowerks, mingw, msvc, vc7, vc8, +ECHO ### vc9, vc10, vc11, vc12, vc14, vc141 +ECHO ### +ECHO ### If you have Visual Studio 2017 installed you will need to build from +ECHO ### the Visual Studio Command Prompt for VS 2017 as we where unable to +ECHO ### detect your toolset installtion. ECHO ### call :Set_Error endlocal 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 REM Tests whether the given string is in the form of an option: "--*" call :Clear_Error @@ -85,11 +78,6 @@ endlocal goto :eof -:Call_If_Exists -if EXIST %1 call %* -goto :eof - - :Guess_Toolset REM Try and guess the toolset to bootstrap the build with... REM Sets BOOST_JAM_TOOLSET to the first found toolset. @@ -97,184 +85,29 @@ REM May also set BOOST_JAM_TOOLSET_ROOT to the REM location of the found toolset. call :Clear_Error -call :Test_Empty %ProgramFiles% -if not errorlevel 1 set ProgramFiles=C:\Program Files +call :Test_Empty "%ProgramFiles%" +if not errorlevel 1 set "ProgramFiles=C:\Program Files" +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. call :Clear_Error -if NOT "_%VS150COMNTOOLS%_" == "__" ( - set "BOOST_JAM_TOOLSET=vc15" - set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\" - goto :eof) -call :Clear_Error -if EXIST "%ProgramFiles%\Microsoft Visual Studio 15.0\VC\VCVARSALL.BAT" ( - set "BOOST_JAM_TOOLSET=vc15" - set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 15.0\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 "%ProgramFiles%\Microsoft Visual Studio 14.0\VC\VCVARSALL.BAT" ( - set "BOOST_JAM_TOOLSET=vc14" - set "BOOST_JAM_TOOLSET_ROOT=%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 "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\VCVARSALL.BAT" ( - set "BOOST_JAM_TOOLSET=vc12" - set "BOOST_JAM_TOOLSET_ROOT=%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 "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\VCVARSALL.BAT" ( - set "BOOST_JAM_TOOLSET=vc11" - set "BOOST_JAM_TOOLSET_ROOT=%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 "%ProgramFiles%\Microsoft Visual Studio 10.0\VC\VCVARSALL.BAT" ( - set "BOOST_JAM_TOOLSET=vc10" - set "BOOST_JAM_TOOLSET_ROOT=%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 "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\VCVARSALL.BAT" ( - set "BOOST_JAM_TOOLSET=vc9" - set "BOOST_JAM_TOOLSET_ROOT=%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 "%ProgramFiles%\Microsoft Visual Studio 8\VC\VCVARSALL.BAT" ( - set "BOOST_JAM_TOOLSET=vc8" - set "BOOST_JAM_TOOLSET_ROOT=%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 "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" ( - set "BOOST_JAM_TOOLSET=vc7" - set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\" - goto :eof) -call :Clear_Error -if EXIST "%ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\VCVARS32.BAT" ( - set "BOOST_JAM_TOOLSET=vc7" - set "BOOST_JAM_TOOLSET_ROOT=%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 "%ProgramFiles%\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" ( - set "BOOST_JAM_TOOLSET=msvc" - set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio\VC98\" - goto :eof) -call :Clear_Error -if EXIST "%ProgramFiles%\Microsoft Visual C++\VC98\bin\VCVARS32.BAT" ( - set "BOOST_JAM_TOOLSET=msvc" - set "BOOST_JAM_TOOLSET_ROOT=%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%..\..\" +call :Test_Empty "%ProgramFiles(x86)%" +if errorlevel 1 ( + set "VS_ProgramFiles=%ProgramFiles(x86)%" +) else ( + set "VS_ProgramFiles=%ProgramFiles%" +) + +call guess_toolset.bat +if errorlevel 1 ( + call :Error_Print "Could not find a suitable toolset." goto :eof) -call :Clear_Error -call :Error_Print "Could not find a suitable toolset." -goto :eof :Guess_Yacc -REM Tries to find bison or yacc in common places so we can build the grammar. -call :Clear_Error -call :Test_Path yacc.exe -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." +call guess_toolset.bat yacc +if errorlevel 1 ( + call :Error_Print "Could not find Yacc to build the Jam grammar.") goto :eof @@ -326,206 +159,7 @@ if errorlevel 1 ( goto Setup_Args ) :Config_Toolset -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 "_%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%_" == "_vc15_" goto Skip_VC15 -if NOT "_%VS150COMNTOOLS%_" == "__" ( - set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\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_VC15 -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 +call config_toolset.bat if "_%_known_%_" == "__" ( call :Error_Print "Unknown toolset: %BOOST_JAM_TOOLSET%" ) diff --git a/tools/build/src/engine/build.jam b/tools/build/src/engine/build.jam index e16b240859..842296a678 100644 --- a/tools/build/src/engine/build.jam +++ b/tools/build/src/engine/build.jam @@ -401,7 +401,8 @@ toolset vc14 cl : /Fe /Fe /Fd /Fo : -D [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) -I$(--extra-include) : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; -toolset vc15 cl : /Fe /Fe /Fd /Fo : -D +## Microsoft Visual C++ 2017 +toolset vc141 cl : /Fe /Fe /Fd /Fo : -D : /nologo [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] diff --git a/tools/build/src/engine/config_toolset.bat b/tools/build/src/engine/config_toolset.bat new file mode 100644 index 0000000000..560d5aa3bd --- /dev/null +++ b/tools/build/src/engine/config_toolset.bat @@ -0,0 +1,233 @@ +@ECHO OFF + +REM ~ Copyright 2002-2017 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%_" == "_vc141_" goto Skip_VC141 +if "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( + if NOT "_%VS150COMNTOOLS%_" == "__" ( + set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\" + )) + +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_VC141 +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% diff --git a/tools/build/src/engine/guess_toolset.bat b/tools/build/src/engine/guess_toolset.bat new file mode 100644 index 0000000000..a671802d3c --- /dev/null +++ b/tools/build/src/engine/guess_toolset.bat @@ -0,0 +1,179 @@ +@ECHO OFF + +REM ~ Copyright 2002-2017 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=vc141" + set "BOOST_JAM_TOOLSET_ROOT=%VS150COMNTOOLS%..\..\VC\" + goto :eof) +if EXIST "%VS_ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ( + set "BOOST_JAM_TOOLSET=vc141" + 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=vc141" + 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=vc141" + 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 diff --git a/tools/build/src/tools/clang-linux.jam b/tools/build/src/tools/clang-linux.jam index f6dcda9f3e..f977c8c72d 100644 --- a/tools/build/src/tools/clang-linux.jam +++ b/tools/build/src/tools/clang-linux.jam @@ -153,7 +153,7 @@ rule compile.c++.pch ( targets * : sources * : properties * ) { } actions compile.c++.pch { - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)" + rm -f "$(<)" && "$(CONFIG_COMMAND)" -c -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)" } rule compile.c.pch ( targets * : sources * : properties * ) { @@ -164,7 +164,7 @@ rule compile.c.pch ( targets * : sources * : properties * ) { actions compile.c.pch { - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)" + rm -f "$(<)" && "$(CONFIG_COMMAND)" -c -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)" } ############################################################################### diff --git a/tools/build/src/tools/emscripten.jam b/tools/build/src/tools/emscripten.jam index 2ad1b804a5..c9a0009dba 100644 --- a/tools/build/src/tools/emscripten.jam +++ b/tools/build/src/tools/emscripten.jam @@ -21,9 +21,10 @@ rule init ( version ? : command * : options * ) : $(command) ] ; # Determine the version - local command-string = $(command:J=" ") ; if $(command) - { + { + local command-string = \"$(command)\" ; + command-string = $(command-string:J=" ") ; version ?= [ MATCH "([0-9.]+)" : [ SHELL "$(command-string) --version" ] ] ; } diff --git a/tools/build/src/tools/msvc.jam b/tools/build/src/tools/msvc.jam index 3f8f49e68b..5f179933d4 100644 --- a/tools/build/src/tools/msvc.jam +++ b/tools/build/src/tools/msvc.jam @@ -3,7 +3,7 @@ # Copyright (c) 2005 Alexey Pakhunov # Copyright (c) 2006 Bojan Resnik # Copyright (c) 2006 Ilya Sokolov -# Copyright (c) 2007 Rene Rivera +# Copyright (c) 2007-2017 Rene Rivera # Copyright (c) 2008 Jurko Gospodnetic # Copyright (c) 2014 Microsoft Corporation # @@ -820,7 +820,16 @@ local rule generate-setup-cmd ( version : command : parent : options * : cpu : g } else { + if [ MATCH "(14.1)" : $(version) ] + { + if $(.debug-configuration) + { + ECHO 'notice: [generate-setup-cmd] $(version) is 14.1' ; + } + parent = [ path.native [ path.join $(parent) "..\\..\\..\\..\\..\\Auxiliary\\Build" ] ] ; + } setup = [ locate-default-setup $(command) : $(parent) : $(default-setup) ] ; + setup ?= [ path.join $(parent) "vcvarsall.bat" ] ; } } @@ -850,8 +859,16 @@ local rule configure-really ( version ? : options * ) # Decide what the 'default' version is. if ! $(v) { - # Take the first registered (i.e. auto-detected) version. + # Take the best registered (i.e. auto-detected) version. version = [ $(.versions).all ] ; + for local known in $(.known-versions) + { + if $(known) in $(version) + { + version = $(known) ; + break ; + } + } version = $(version[1]) ; v = $(version) ; @@ -894,11 +911,29 @@ local rule configure-really ( version ? : options * ) local command = [ feature.get-values <command> : $(options) ] ; + # For 14.1 we need the exact version as MS is planning rolling updates + # that will cause our `setup-cmd` to become invalid + exact-version = [ MATCH "(14\.10\.[0-9\.]+)" : $(command) ] ; + # If version is specified, we try to search first in default paths, and # only then in PATH. command = [ common.get-invocation-command msvc : cl.exe : $(command) : [ default-paths $(version) ] : $(version) ] ; + if ( ! $(version) || $(version) = "default" ) && ! $(command:D) + { + ECHO ; + ECHO warning: + "Did not find command for MSVC toolset." + "If you have Visual Studio 2017 installed you will need to" + "specify the full path to the command," + "set VS150COMNTOOLS for your installation," + "or" + "build from the 'Visual Studio Command Prompt for VS 2017'." + ; + ECHO ; + } + common.handle-options msvc : $(conditions) : $(command) : $(options) ; if ! $(version) @@ -907,9 +942,9 @@ local rule configure-really ( version ? : options * ) # version from the path. # FIXME: We currently detect both Microsoft Visual Studio 9.0 and # 9.0express as 9.0 here. - if [ MATCH "(Microsoft Visual Studio 15)" : $(command) ] + if [ MATCH "(MSVC\\14.1)" : $(command) ] { - version = 15.0 ; + version = 14.1 ; } else if [ MATCH "(Microsoft Visual Studio 14)" : $(command) ] { @@ -1073,7 +1108,8 @@ local rule configure-really ( version ? : options * ) for local c in $(cpu) { - setup-$(c) = [ generate-setup-cmd $(version) : $(command) : $(parent) : $(options) : $(c) : $(global-setup) : $(default-global-setup-options-$(c)) : $(default-setup-$(c)) ] ; + exact-version ?= $(version) ; + setup-$(c) = [ generate-setup-cmd $(exact-version) : $(command) : $(parent) : $(options) : $(c) : $(global-setup) : $(default-global-setup-options-$(c)) : $(default-setup-$(c)) ] ; } # Windows phone has different setup scripts, located in a different directory hierarchy. @@ -1205,37 +1241,39 @@ local rule configure-really ( version ? : options * ) local rule default-path ( version ) { # Use auto-detected path if possible. - local path = [ feature.get-values <command> : [ $(.versions).get $(version) + local result = [ feature.get-values <command> : [ $(.versions).get $(version) : options ] ] ; - if $(path) + if $(result) { - path = $(path:D) ; + result = $(result:D) ; } else { # Check environment. - if $(.version-$(version)-env) + for local env in $(.version-$(version)-env) { - local vc-path = [ os.environ $(.version-$(version)-env) ] ; - if $(vc-path) + local env-path = [ os.environ $(env) ] ; + if $(env-path) && $(.version-$(version)-path) { - vc-path = [ path.make $(vc-path) ] ; - vc-path = [ path.join $(vc-path) $(.version-$(version)-envpath) ] ; - vc-path = [ path.native $(vc-path) ] ; - - path = $(vc-path) ; + for local bin-path in $(.version-$(version)-path) + { + result = [ path.glob [ path.make $(env-path) ] : $(bin-path) ] ; + if $(result) + { + result = [ path.native $(result[1]) ] ; + break ; + } + } + } + if $(result) + { + break ; } - } - - # Check default path. - if ! $(path) && $(.version-$(version)-path) - { - path = [ path.native [ path.join $(.ProgramFiles) $(.version-$(version)-path) ] ] ; } } - return $(path) ; + return $(result) ; } @@ -1595,7 +1633,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] armv7 armv7s ; # Known toolset versions, in order of preference. -.known-versions = 15.0 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1 +.known-versions = 14.1 14.0 12.0 11.0 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ; # Version aliases. @@ -1608,7 +1646,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .version-alias-11 = 11.0 ; .version-alias-12 = 12.0 ; .version-alias-14 = 14.0 ; -.version-alias-15 = 15.0 ; +.version-alias-14.1 = 14.1 ; # Names of registry keys containing the Visual C++ installation path (relative # to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft"). @@ -1624,18 +1662,21 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .version-11.0-reg = "VisualStudio\\11.0\\Setup\\VC" ; .version-12.0-reg = "VisualStudio\\12.0\\Setup\\VC" ; .version-14.0-reg = "VisualStudio\\14.0\\Setup\\VC" ; -.version-15.0-reg = "VisualStudio\\15.0\\Setup\\VC" ; # Visual C++ Toolkit 2003 does not store its installation path in the registry. # The environment variable 'VCToolkitInstallDir' and the default installation # path will be checked instead. -.version-7.1toolkit-path = "Microsoft Visual C++ Toolkit 2003" "bin" ; +.version-7.1toolkit-path = "Microsoft Visual C++ Toolkit 2003/bin" ; .version-7.1toolkit-env = VCToolkitInstallDir ; - -# Path to the folder containing "cl.exe" relative to the value of the -# corresponding environment variable. -.version-7.1toolkit-envpath = "bin" ; - +# Visual Studio 2017 doesn't use a registry at all. And the suggested methods +# of discovery involve having a compiled program. We can't do that as it would +# make for a recursive discovery and build dependency cycle. So we search +# paths for VS2017 (aka msvc >= 14.1). +.version-14.1-path = + "../../VC/Tools/MSVC/*/bin/Host*/*" + "Microsoft Visual Studio/2017/*/VC/Tools/MSVC/*/bin/Host*/*" + ; +.version-14.1-env = VS150COMNTOOLS ProgramFiles ProgramFiles(x86) ; # Auto-detect all the available msvc installations on the system. auto-detect-toolset-versions ; diff --git a/tools/build/src/tools/msvc.py b/tools/build/src/tools/msvc.py index baa57e8311..efd3a908ae 100644 --- a/tools/build/src/tools/msvc.py +++ b/tools/build/src/tools/msvc.py @@ -772,7 +772,7 @@ def configure_really(version=None, options=[]): # version from the path. # FIXME: We currently detect both Microsoft Visual Studio 9.0 and # 9.0express as 9.0 here. - if re.search("Microsoft Visual Studio 15", command): + if re.search("Microsoft Visual Studio[\/\\]2017", command): version = '15.0' elif re.search("Microsoft Visual Studio 14", command): version = '14.0' diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam index cc13385cac..bf300b8a32 100644 --- a/tools/build/src/tools/python.jam +++ b/tools/build/src/tools/python.jam @@ -34,6 +34,7 @@ import path ; import feature ; import set ; import builtin ; +import property-set ; # Make this module a project. @@ -60,6 +61,10 @@ lib rt ; # installed in the development system's default paths. feature.feature pythonpath : : free optional path ; +# The best configured version of Python 2 and 3. +py2-version = ; +py3-version = ; + # Initializes the Python toolset. Note that all parameters are optional. # # - version -- the version of Python to use. Should be in Major.Minor format, @@ -861,6 +866,11 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : if ! $(version) in [ feature.values python ] { feature.extend python : $(version) ; + py$(major-minor[1])-version ?= $(version) ; + if $(py$(major-minor[1])-version) < $(version) + { + py$(major-minor[1])-version = $(version) ; + } } target-requirements += <python>$(version:E=default) ; } @@ -916,6 +926,9 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : } } + # In case we added duplicate requirements from what the user specified. + target-requirements = [ sequence.unique $(target-requirements) ] ; + # Global, but conditional, requirements to give access to the interpreter # for general utilities, like other toolsets, that run Python scripts. toolset.add-requirements @@ -934,19 +947,6 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : toolset.add-requirements <target-os>$(target-os):<python>$(version:E=default) ; } - # We also set a default requirement that assigns the first python configured - # for a particular target OS as the default. This makes it so that we can - # select a python interpreter with only knowledge of the target OS. And hence - # can configure different Pythons based on the target OS only. - local toolset-requirements = [ toolset.requirements ] ; - local toolset-target-os-requirements - = [ property.evaluate-conditionals-in-context - [ $(toolset-requirements).raw ] : <target-os>$(target-os) ] ; - if ! <python> in $(toolset-target-os-requirements:G) - { - toolset.add-requirements <target-os>$(target-os):<python>$(version:E=default) ; - } - # Register the right suffix for extensions. register-extension-suffix $(extension-suffix) : $(target-requirements) ; @@ -1038,6 +1038,22 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? : : $(usage-requirements) ; } + +} + +# Conditional rule specification that will prevent building of a target +# if there is no matching python configuration available with the given +# required properties. +rule require-py ( properties * ) +{ + local py-ext-target = [ $(.project).find python_for_extensions ] ; + local property-set = [ property-set.create $(properties) ] ; + property-set = [ $(property-set).expand ] ; + local py-ext-alternative = [ $(py-ext-target).select-alternatives $(property-set) ] ; + if ! $(py-ext-alternative) + { + return <build>no ; + } } @@ -1298,5 +1314,11 @@ rule numpy-test ( name : sources * : requirements * ) : $(name) ] ; } +rule py-version ( n ) +{ + return $(py$(n)-version) ; +} + IMPORT $(__name__) : bpl-test : : bpl-test ; IMPORT $(__name__) : numpy-test : : numpy-test ; +IMPORT $(__name__) : py-version : : py-version ; diff --git a/tools/build/src/tools/qcc.jam b/tools/build/src/tools/qcc.jam index 3b3557894b..faa3530643 100644 --- a/tools/build/src/tools/qcc.jam +++ b/tools/build/src/tools/qcc.jam @@ -234,5 +234,5 @@ rule link.dll ( targets * : sources * : properties * ) # actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) } diff --git a/tools/build/test/core-language/test.jam b/tools/build/test/core-language/test.jam index b0ac767ef2..341efcf803 100644 --- a/tools/build/test/core-language/test.jam +++ b/tools/build/test/core-language/test.jam @@ -1471,7 +1471,7 @@ if $(NT) for local x in $(param:L) { if ! x in $(found) && - $(x) in "addservices" "policies" "deleted device ids" + $(x) in "addservices" "policies" "deleted device ids" "software" { found += $(x) ; } |