summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:08:07 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:09:00 +0900
commitb5c87084afaef42b2d058f68091be31988a6a874 (patch)
treeadef9a65870a41181687e11d57fdf98e7629de3c /tools
parent34bd32e225e2a8a94104489b31c42e5801cc1f4a (diff)
downloadboost-b5c87084afaef42b2d058f68091be31988a6a874.tar.gz
boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.bz2
boost-b5c87084afaef42b2d058f68091be31988a6a874.zip
Imported Upstream version 1.64.0upstream/1.64.0
Change-Id: Id9212edd016dd55f21172c427aa7894d1d24148b Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/build/Jamroot.jam2
-rw-r--r--tools/build/doc/src/overview.xml38
-rw-r--r--tools/build/doc/src/reference.xml86
-rw-r--r--tools/build/src/build/ac.jam14
-rw-r--r--tools/build/src/build/targets.jam4
-rw-r--r--tools/build/src/engine/build.bat416
-rw-r--r--tools/build/src/engine/build.jam3
-rw-r--r--tools/build/src/engine/config_toolset.bat233
-rw-r--r--tools/build/src/engine/guess_toolset.bat179
-rw-r--r--tools/build/src/tools/clang-linux.jam4
-rw-r--r--tools/build/src/tools/emscripten.jam5
-rw-r--r--tools/build/src/tools/msvc.jam105
-rw-r--r--tools/build/src/tools/msvc.py2
-rw-r--r--tools/build/src/tools/python.jam48
-rw-r--r--tools/build/src/tools/qcc.jam2
-rw-r--r--tools/build/test/core-language/test.jam2
-rw-r--r--tools/index.html7
-rw-r--r--tools/quickbook/build/Jamfile.v29
-rw-r--r--tools/quickbook/doc/change_log.qbk9
-rw-r--r--tools/quickbook/src/actions.cpp14
-rw-r--r--tools/quickbook/src/code_snippet.cpp10
-rw-r--r--tools/quickbook/src/doc_info_actions.cpp8
-rw-r--r--tools/quickbook/src/document_state.cpp50
-rw-r--r--tools/quickbook/src/document_state.hpp22
-rw-r--r--tools/quickbook/src/document_state_impl.hpp38
-rw-r--r--tools/quickbook/src/files.cpp50
-rw-r--r--tools/quickbook/src/files.hpp20
-rw-r--r--tools/quickbook/src/fwd.hpp4
-rw-r--r--tools/quickbook/src/glob.cpp18
-rw-r--r--tools/quickbook/src/glob.hpp12
-rw-r--r--tools/quickbook/src/id_generation.cpp24
-rw-r--r--tools/quickbook/src/id_xml.cpp8
-rw-r--r--tools/quickbook/src/include_paths.cpp26
-rw-r--r--tools/quickbook/src/include_paths.hpp4
-rw-r--r--tools/quickbook/src/main_grammar.cpp3
-rw-r--r--tools/quickbook/src/native_text.cpp12
-rw-r--r--tools/quickbook/src/native_text.hpp15
-rw-r--r--tools/quickbook/src/quickbook.cpp8
-rw-r--r--tools/quickbook/src/string_view.hpp30
-rw-r--r--tools/quickbook/src/syntax_highlight.cpp4
-rw-r--r--tools/quickbook/src/utils.cpp8
-rw-r--r--tools/quickbook/src/utils.hpp12
-rw-r--r--tools/quickbook/src/value_tags.hpp6
-rw-r--r--tools/quickbook/src/values.cpp14
-rw-r--r--tools/quickbook/src/values.hpp6
-rw-r--r--tools/quickbook/test/Jamfile.v23
-rw-r--r--tools/quickbook/test/doc-info/duplicates-1.5.quickbook1
-rw-r--r--tools/quickbook/test/python/run_tests.py (renamed from tools/quickbook/test/python/output-deps.py)28
-rw-r--r--tools/quickbook/test/python/simple.qbk12
-rw-r--r--tools/quickbook/test/python/simple.xml25
-rw-r--r--tools/quickbook/test/python/simple_custom_pretty_print.xml30
-rw-r--r--tools/quickbook/test/python/simple_no_pretty_print.xml18
-rw-r--r--tools/quickbook/test/python/simple_no_self_linked.xml25
-rw-r--r--tools/quickbook/test/template_arguments1-1_5-fail.quickbook11
-rw-r--r--tools/quickbook/test/template_arguments2-1_5-fail.quickbook6
-rw-r--r--tools/quickbook/test/template_arguments3-1_1-fail.quickbook12
-rw-r--r--tools/quickbook/test/template_arguments3-1_5-fail.quickbook11
-rw-r--r--tools/quickbook/test/unit/source_map_test.cpp84
-rw-r--r--tools/quickbook/test/unit/values_test.cpp2
59 files changed, 1167 insertions, 695 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 &#x26;&#x26; 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 : : &lt;compileflags&gt;-m64 &lt;linkflags&gt;-m64 ;
+using gcc : 3.4 : : &lt;compileflags&gt;-m64 &lt;linkflags&gt;-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 : : &lt;cxxflags&gt;"-std=c++14 -O2" ;
+using clang : 3.9 : : &lt;cxxflags&gt;-std=c++14 &lt;cxxflags&gt;-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 : &lt;cxxflags&gt;-std=c++03 ; # C++ 03
+using gcc : 5~gnu03 : g++-5 : &lt;cxxflags&gt;-std=gnu++03 ; # C++ 03 with GNU
+using gcc : 5~c++11 : g++-5 : &lt;cxxflags&gt;-std=c++11 ; # C++ 11
+using gcc : 5~c++14 : g++-5 : &lt;cxxflags&gt;-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&#x2014;14.1</para></listitem>
<listitem><para>Visual Studio 2015&#x2014;14.0</para></listitem>
<listitem><para>Visual Studio 2013&#x2014;12.0</para></listitem>
<listitem><para>Visual Studio 2012&#x2014;11.0</para></listitem>
@@ -1032,6 +1033,14 @@ using gcc : &toolset_ops; ;</programlisting>
<listitem><para>Visual Studio 6.0, Service Pack 5&#x2014;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 : : &lt;toolset&gt;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 : &lt;source&gt;/home/sergey/src/bzip2-1.0.6 ;
+# Find bzip in /usr/local
+using bzip2 : 1.0.6 : &lt;include&gt;/usr/local/include &lt;search&gt;/usr/local/lib ;
+# Build bzip from source for msvc and find
+# prebuilt binaries for gcc.
+using bzip2 : 1.0.6 : &lt;source&gt;C:/Devel/src/bzip2-1.0.6 : &lt;toolset&gt;msvc ;
+using bzip2 : 1.0.6 : : &lt;toolset&gt;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) ;
}
diff --git a/tools/index.html b/tools/index.html
index 77f7f59cd8..65236fedda 100644
--- a/tools/index.html
+++ b/tools/index.html
@@ -55,13 +55,6 @@
the full Boost version of the jam sources.<br>
&nbsp;
<li>
- <a href="regression/index.html">Regression</a> - The Boost regression testing
- system reporting sources.<br>
-&nbsp;<li>
- <a href="release/index.html">Release</a> - Scripts used to build the
- release tarballs and zips.<br>
- &nbsp;
- <li>
<a href="inspect/index.html">Inspect </a>- The inspection tool used to detect
errors in the Boost directory hierarchy.<br>
&nbsp;
diff --git a/tools/quickbook/build/Jamfile.v2 b/tools/quickbook/build/Jamfile.v2
new file mode 100644
index 0000000000..6873ef4242
--- /dev/null
+++ b/tools/quickbook/build/Jamfile.v2
@@ -0,0 +1,9 @@
+#==============================================================================
+# Copyright (c) 2017 Daniel James
+#
+# Use, modification and distribution is 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)
+#==============================================================================
+
+alias dist-bin : ..//dist-bin ;
diff --git a/tools/quickbook/doc/change_log.qbk b/tools/quickbook/doc/change_log.qbk
index 31dc8a7ecd..c48ef1cbd4 100644
--- a/tools/quickbook/doc/change_log.qbk
+++ b/tools/quickbook/doc/change_log.qbk
@@ -335,3 +335,12 @@ Boost 1.46.1:
[heading Version 1.6.2 - Boost 1.61]
* Better file URL generation for `xinclude`.
+
+[heading Version 1.6.3 - Boost 1.64]
+
+* Improved some error messages.
+* Fix `--no-self-linked-headers` options.
+* Hide 'debug' command line option in help text.
+* Changes to test and build setup to support continuous integration.
+* Fix a crash when templates are called with no arguments.
+ Only affected files with quickbook version less than 1.5.
diff --git a/tools/quickbook/src/actions.cpp b/tools/quickbook/src/actions.cpp
index 15bc7bccd3..4f54420197 100644
--- a/tools/quickbook/src/actions.cpp
+++ b/tools/quickbook/src/actions.cpp
@@ -65,7 +65,7 @@ namespace quickbook
}
std::string add_anchor(quickbook::state& state,
- boost::string_ref id,
+ quickbook::string_view id,
id_category::categories category =
id_category::explicit_anchor_id)
{
@@ -536,7 +536,7 @@ namespace quickbook
if (saved_conditional)
{
- boost::string_ref macro1 = values.consume().get_quickbook();
+ quickbook::string_view macro1 = values.consume().get_quickbook();
std::string macro(macro1.begin(), macro1.end());
state.conditional = find(state.macro, macro.c_str());
@@ -760,7 +760,7 @@ namespace quickbook
int code_tag = code_block.get_tag();
value_consumer values = code_block;
- boost::string_ref code_value = values.consume().get_quickbook();
+ quickbook::string_view code_value = values.consume().get_quickbook();
values.finish();
bool inline_code = code_tag == code_tags::inline_code ||
@@ -870,8 +870,8 @@ namespace quickbook
detail::print_string(v.get_encoded(), out);
}
else {
- boost::string_ref value = v.get_quickbook();
- for(boost::string_ref::const_iterator
+ quickbook::string_view value = v.get_quickbook();
+ for(quickbook::string_view::const_iterator
first = value.begin(), last = value.end();
first != last; ++first)
{
@@ -1201,7 +1201,7 @@ namespace quickbook
// then use whitespace to separate them
// (2 = template name + argument).
- if (qbk_version_n < 105 || args.size() == 1)
+ if (qbk_version_n < 105 ? args.size() : args.size() == 1)
{
while (args.size() < params.size())
@@ -1267,7 +1267,7 @@ namespace quickbook
file_ptr saved_current_file = state.current_file;
state.current_file = content.get_file();
- boost::string_ref source = content.get_quickbook();
+ quickbook::string_view source = content.get_quickbook();
parse_iterator first(source.begin());
parse_iterator last(source.end());
diff --git a/tools/quickbook/src/code_snippet.cpp b/tools/quickbook/src/code_snippet.cpp
index fe54f46ce1..5b5fc72402 100644
--- a/tools/quickbook/src/code_snippet.cpp
+++ b/tools/quickbook/src/code_snippet.cpp
@@ -87,8 +87,8 @@ namespace quickbook
}
mapped_file_builder content;
- boost::string_ref::const_iterator mark_begin, mark_end;
- boost::string_ref::const_iterator last_code_pos;
+ quickbook::string_view::const_iterator mark_begin, mark_end;
+ quickbook::string_view::const_iterator last_code_pos;
bool in_code;
boost::shared_ptr<snippet_data> snippet_stack;
std::vector<template_symbol>& storage;
@@ -382,7 +382,7 @@ namespace quickbook
in_code = true;
}
- content.add(boost::string_ref(last_code_pos, first - last_code_pos));
+ content.add(quickbook::string_view(last_code_pos, first - last_code_pos));
}
}
@@ -419,7 +419,7 @@ namespace quickbook
in_code = true;
}
- content.add(boost::string_ref(mark_begin, mark_end - mark_begin));
+ content.add(quickbook::string_view(mark_begin, mark_end - mark_begin));
}
void code_snippet_actions::escaped_comment(string_iterator first, string_iterator last)
@@ -437,7 +437,7 @@ namespace quickbook
snippet_data& snippet = *snippet_stack;
content.add_at_pos("\n", mark_begin);
- content.unindent_and_add(boost::string_ref(mark_begin, mark_end - mark_begin));
+ content.unindent_and_add(quickbook::string_view(mark_begin, mark_end - mark_begin));
if (snippet.id == "!")
{
diff --git a/tools/quickbook/src/doc_info_actions.cpp b/tools/quickbook/src/doc_info_actions.cpp
index 14d7a9994f..6f66981636 100644
--- a/tools/quickbook/src/doc_info_actions.cpp
+++ b/tools/quickbook/src/doc_info_actions.cpp
@@ -38,6 +38,12 @@ namespace quickbook
}
}
+ char const* doc_info_attribute_name(value::tag_type tag)
+ {
+ return doc_attributes::is_tag(tag) ? doc_attributes::name(tag) :
+ doc_info_attributes::name(tag);
+ }
+
// Each docinfo attribute is stored in a value list, these are then stored
// in a sorted value list. The following convenience methods extract all the
// values for an attribute tag.
@@ -54,7 +60,7 @@ namespace quickbook
++count;
}
- if(count > 1) duplicates->push_back(doc_info_attributes::name(tag));
+ if(count > 1) duplicates->push_back(doc_info_attribute_name(tag));
return p;
}
diff --git a/tools/quickbook/src/document_state.cpp b/tools/quickbook/src/document_state.cpp
index 2841389cab..9e84c90d01 100644
--- a/tools/quickbook/src/document_state.cpp
+++ b/tools/quickbook/src/document_state.cpp
@@ -33,7 +33,7 @@ namespace quickbook
// Constructor for files that aren't the root of a document.
file_info(boost::shared_ptr<file_info> const& parent,
unsigned compatibility_version,
- boost::string_ref doc_id_1_1,
+ quickbook::string_view doc_id_1_1,
id_placeholder const* override_id) :
parent(parent), document(parent->document),
compatibility_version(compatibility_version),
@@ -47,7 +47,7 @@ namespace quickbook
file_info(boost::shared_ptr<file_info> const& parent,
boost::shared_ptr<doc_info> const& document,
unsigned compatibility_version,
- boost::string_ref doc_id_1_1) :
+ quickbook::string_view doc_id_1_1) :
parent(parent), document(document),
compatibility_version(compatibility_version),
depth(0), override_depth(0), override_id(0),
@@ -77,8 +77,8 @@ namespace quickbook
source_mode_info const source_mode;
section_info(boost::shared_ptr<section_info> const& parent,
- file_info const* current_file, boost::string_ref id,
- boost::string_ref id_1_1, id_placeholder const* placeholder_1_6,
+ file_info const* current_file, quickbook::string_view id,
+ quickbook::string_view id_1_1, id_placeholder const* placeholder_1_6,
source_mode_info const& source_mode) :
parent(parent),
compatibility_version(current_file->compatibility_version),
@@ -102,8 +102,8 @@ namespace quickbook
void document_state::start_file(
unsigned compatibility_version,
- boost::string_ref include_doc_id,
- boost::string_ref id,
+ quickbook::string_view include_doc_id,
+ quickbook::string_view id,
value const& title)
{
state->start_file(compatibility_version, false, include_doc_id, id, title);
@@ -111,8 +111,8 @@ namespace quickbook
std::string document_state::start_file_with_docinfo(
unsigned compatibility_version,
- boost::string_ref include_doc_id,
- boost::string_ref id,
+ quickbook::string_view include_doc_id,
+ quickbook::string_view id,
value const& title)
{
return state->start_file(compatibility_version, true, include_doc_id,
@@ -124,7 +124,7 @@ namespace quickbook
state->end_file();
}
- std::string document_state::begin_section(boost::string_ref id,
+ std::string document_state::begin_section(quickbook::string_view id,
id_category category, source_mode_info const& source_mode)
{
return state->begin_section(id, category, source_mode)->to_string();
@@ -147,28 +147,28 @@ namespace quickbook
source_mode_info();
}
- std::string document_state::old_style_id(boost::string_ref id, id_category category)
+ std::string document_state::old_style_id(quickbook::string_view id, id_category category)
{
return state->old_style_id(id, category)->to_string();
}
- std::string document_state::add_id(boost::string_ref id, id_category category)
+ std::string document_state::add_id(quickbook::string_view id, id_category category)
{
return state->add_id(id, category)->to_string();
}
- std::string document_state::add_anchor(boost::string_ref id, id_category category)
+ std::string document_state::add_anchor(quickbook::string_view id, id_category category)
{
return state->add_placeholder(id, category)->to_string();
}
std::string document_state::replace_placeholders_with_unresolved_ids(
- boost::string_ref xml) const
+ quickbook::string_view xml) const
{
return replace_ids(*state, xml);
}
- std::string document_state::replace_placeholders(boost::string_ref xml) const
+ std::string document_state::replace_placeholders(quickbook::string_view xml) const
{
assert(!state->current_file);
std::vector<std::string> ids = generate_ids(*state, xml);
@@ -186,7 +186,7 @@ namespace quickbook
id_placeholder::id_placeholder(
unsigned index,
- boost::string_ref id,
+ quickbook::string_view id,
id_category category,
id_placeholder const* parent_)
: index(index),
@@ -211,7 +211,7 @@ namespace quickbook
//
id_placeholder const* document_state_impl::add_placeholder(
- boost::string_ref id, id_category category,
+ quickbook::string_view id, id_category category,
id_placeholder const* parent)
{
placeholders.push_back(id_placeholder(
@@ -219,7 +219,7 @@ namespace quickbook
return &placeholders.back();
}
- id_placeholder const* document_state_impl::get_placeholder(boost::string_ref value) const
+ id_placeholder const* document_state_impl::get_placeholder(quickbook::string_view value) const
{
// If this isn't a placeholder id.
if (value.size() <= 1 || *value.begin() != '$')
@@ -242,8 +242,8 @@ namespace quickbook
id_placeholder const* document_state_impl::start_file(
unsigned compatibility_version,
bool document_root,
- boost::string_ref include_doc_id,
- boost::string_ref id,
+ quickbook::string_view include_doc_id,
+ quickbook::string_view id,
value const& title)
{
boost::shared_ptr<file_info> parent = current_file;
@@ -256,7 +256,7 @@ namespace quickbook
// specified in an 'include' element) unless backwards compatibility
// is required.
- boost::string_ref initial_doc_id;
+ quickbook::string_view initial_doc_id;
if (document_root ||
compatibility_version >= 106u ||
@@ -348,7 +348,7 @@ namespace quickbook
}
id_placeholder const* document_state_impl::add_id(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category)
{
return add_id_to_section(id, category,
@@ -356,7 +356,7 @@ namespace quickbook
}
id_placeholder const* document_state_impl::add_id_to_section(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category,
boost::shared_ptr<section_info> const& section)
{
@@ -391,7 +391,7 @@ namespace quickbook
}
id_placeholder const* document_state_impl::old_style_id(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category)
{
return current_file->compatibility_version < 103u ?
@@ -401,7 +401,7 @@ namespace quickbook
}
id_placeholder const* document_state_impl::begin_section(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category,
source_mode_info const& source_mode)
{
@@ -410,7 +410,7 @@ namespace quickbook
}
id_placeholder const* document_state_impl::create_new_section(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category,
source_mode_info const& source_mode)
{
diff --git a/tools/quickbook/src/document_state.hpp b/tools/quickbook/src/document_state.hpp
index 2210c41731..15e62531f0 100644
--- a/tools/quickbook/src/document_state.hpp
+++ b/tools/quickbook/src/document_state.hpp
@@ -10,7 +10,7 @@
#define BOOST_QUICKBOOK_DOCUMENT_STATE_HPP
#include <boost/scoped_ptr.hpp>
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
#include <string>
#include "values.hpp"
#include "syntax_highlight.hpp"
@@ -54,31 +54,31 @@ namespace quickbook
std::string start_file_with_docinfo(
unsigned compatibility_version,
- boost::string_ref include_doc_id,
- boost::string_ref id,
+ quickbook::string_view include_doc_id,
+ quickbook::string_view id,
value const& title);
void start_file(
unsigned compatibility_version,
- boost::string_ref include_doc_id,
- boost::string_ref id,
+ quickbook::string_view include_doc_id,
+ quickbook::string_view id,
value const& title);
void end_file();
- std::string begin_section(boost::string_ref, id_category,
+ std::string begin_section(quickbook::string_view, id_category,
source_mode_info const&);
void end_section();
int section_level() const;
source_mode_info section_source_mode() const;
- std::string old_style_id(boost::string_ref, id_category);
- std::string add_id(boost::string_ref, id_category);
- std::string add_anchor(boost::string_ref, id_category);
+ std::string old_style_id(quickbook::string_view, id_category);
+ std::string add_id(quickbook::string_view, id_category);
+ std::string add_anchor(quickbook::string_view, id_category);
std::string replace_placeholders_with_unresolved_ids(
- boost::string_ref) const;
- std::string replace_placeholders(boost::string_ref) const;
+ quickbook::string_view) const;
+ std::string replace_placeholders(quickbook::string_view) const;
unsigned compatibility_version() const;
private:
diff --git a/tools/quickbook/src/document_state_impl.hpp b/tools/quickbook/src/document_state_impl.hpp
index e9258e3b11..66e0cebef8 100644
--- a/tools/quickbook/src/document_state_impl.hpp
+++ b/tools/quickbook/src/document_state_impl.hpp
@@ -12,7 +12,7 @@
#include "document_state.hpp"
#include "phrase_tags.hpp"
#include "utils.hpp"
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
#include <boost/shared_ptr.hpp>
#include <deque>
#include <string>
@@ -46,7 +46,7 @@ namespace quickbook
// but not when an explicit id contains
// dots.
- id_placeholder(unsigned index, boost::string_ref id,
+ id_placeholder(unsigned index, quickbook::string_view id,
id_category category, id_placeholder const* parent_);
std::string to_string() const;
@@ -69,10 +69,10 @@ namespace quickbook
// Placeholder methods
- id_placeholder const* add_placeholder(boost::string_ref, id_category,
+ id_placeholder const* add_placeholder(quickbook::string_view, id_category,
id_placeholder const* parent = 0);
- id_placeholder const* get_placeholder(boost::string_ref) const;
+ id_placeholder const* get_placeholder(quickbook::string_view) const;
id_placeholder const* get_id_placeholder(
boost::shared_ptr<section_info> const& section) const;
@@ -82,41 +82,41 @@ namespace quickbook
id_placeholder const* start_file(
unsigned compatibility_version,
bool document_root,
- boost::string_ref include_doc_id,
- boost::string_ref id,
+ quickbook::string_view include_doc_id,
+ quickbook::string_view id,
value const& title);
void end_file();
id_placeholder const* add_id(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category);
id_placeholder const* old_style_id(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category);
id_placeholder const* begin_section(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category,
source_mode_info const&);
void end_section();
private:
id_placeholder const* add_id_to_section(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category,
boost::shared_ptr<section_info> const& section);
id_placeholder const* create_new_section(
- boost::string_ref id,
+ quickbook::string_view id,
id_category category,
source_mode_info const&);
};
- std::string replace_ids(document_state_impl const& state, boost::string_ref xml,
+ std::string replace_ids(document_state_impl const& state, quickbook::string_view xml,
std::vector<std::string> const* = 0);
- std::vector<std::string> generate_ids(document_state_impl const&, boost::string_ref);
+ std::vector<std::string> generate_ids(document_state_impl const&, quickbook::string_view);
- std::string normalize_id(boost::string_ref src_id);
- std::string normalize_id(boost::string_ref src_id, std::size_t);
+ std::string normalize_id(quickbook::string_view src_id);
+ std::string normalize_id(quickbook::string_view src_id, std::size_t);
//
// Xml subset parser used for finding id values.
@@ -134,13 +134,13 @@ namespace quickbook
std::vector<std::string> id_attributes;
struct callback {
- virtual void start(boost::string_ref) {}
- virtual void id_value(boost::string_ref) {}
- virtual void finish(boost::string_ref) {}
+ virtual void start(quickbook::string_view) {}
+ virtual void id_value(quickbook::string_view) {}
+ virtual void finish(quickbook::string_view) {}
virtual ~callback() {}
};
- void parse(boost::string_ref, callback&);
+ void parse(quickbook::string_view, callback&);
};
}
diff --git a/tools/quickbook/src/files.cpp b/tools/quickbook/src/files.cpp
index 9999b0f220..ceb4ba7a92 100644
--- a/tools/quickbook/src/files.cpp
+++ b/tools/quickbook/src/files.cpp
@@ -142,11 +142,11 @@ namespace quickbook
}
file_position relative_position(
- boost::string_ref::const_iterator begin,
- boost::string_ref::const_iterator iterator)
+ quickbook::string_view::const_iterator begin,
+ quickbook::string_view::const_iterator iterator)
{
file_position pos;
- boost::string_ref::const_iterator line_begin = begin;
+ quickbook::string_view::const_iterator line_begin = begin;
while (begin != iterator)
{
@@ -178,7 +178,7 @@ namespace quickbook
return pos;
}
- file_position file::position_of(boost::string_ref::const_iterator iterator) const
+ file_position file::position_of(quickbook::string_view::const_iterator iterator) const
{
return relative_position(source().begin(), iterator);
}
@@ -257,7 +257,7 @@ namespace quickbook
file_ptr original;
std::vector<mapped_file_section> mapped_sections;
- void add_empty_mapped_file_section(boost::string_ref::const_iterator pos) {
+ void add_empty_mapped_file_section(quickbook::string_view::const_iterator pos) {
std::string::size_type original_pos =
pos - original->source().begin();
@@ -272,12 +272,12 @@ namespace quickbook
}
}
- void add_mapped_file_section(boost::string_ref::const_iterator pos) {
+ void add_mapped_file_section(quickbook::string_view::const_iterator pos) {
mapped_sections.push_back(mapped_file_section(
pos - original->source().begin(), source().size()));
}
- void add_indented_mapped_file_section(boost::string_ref::const_iterator pos)
+ void add_indented_mapped_file_section(quickbook::string_view::const_iterator pos)
{
mapped_sections.push_back(mapped_file_section(
pos - original->source().begin(), source().size(),
@@ -297,13 +297,13 @@ namespace quickbook
case mapped_file_section::indented: {
// Will contain the start of the current line.
- boost::string_ref::size_type our_line = section->our_pos;
+ quickbook::string_view::size_type our_line = section->our_pos;
// Will contain the number of lines in the block before
// the current line.
unsigned newline_count = 0;
- for(boost::string_ref::size_type i = section->our_pos;
+ for(quickbook::string_view::size_type i = section->our_pos;
i != pos; ++i)
{
if (source()[i] == '\n') {
@@ -313,7 +313,7 @@ namespace quickbook
}
// The start of the line in the original source.
- boost::string_ref::size_type original_line =
+ quickbook::string_view::size_type original_line =
section->original_pos;
while(newline_count > 0) {
@@ -347,7 +347,7 @@ namespace quickbook
}
std::vector<mapped_file_section>::const_iterator find_section(
- boost::string_ref::const_iterator pos) const
+ quickbook::string_view::const_iterator pos) const
{
std::vector<mapped_file_section>::const_iterator section =
boost::upper_bound(mapped_sections,
@@ -359,12 +359,12 @@ namespace quickbook
return section;
}
- virtual file_position position_of(boost::string_ref::const_iterator) const;
+ virtual file_position position_of(quickbook::string_view::const_iterator) const;
private:
static std::string::size_type skip_indentation(
- boost::string_ref src, std::string::size_type i)
+ quickbook::string_view src, std::string::size_type i)
{
while (i != src.size() && (src[i] == ' ' || src[i] == '\t')) ++i;
return i;
@@ -419,13 +419,13 @@ namespace quickbook
return data->new_file->source().size();
}
- void mapped_file_builder::add_at_pos(boost::string_ref x, iterator pos)
+ void mapped_file_builder::add_at_pos(quickbook::string_view x, iterator pos)
{
data->new_file->add_empty_mapped_file_section(pos);
data->new_file->source_.append(x.begin(), x.end());
}
- void mapped_file_builder::add(boost::string_ref x)
+ void mapped_file_builder::add(quickbook::string_view x)
{
data->new_file->add_mapped_file_section(x.begin());
data->new_file->source_.append(x.begin(), x.end());
@@ -469,11 +469,11 @@ namespace quickbook
}
}
- boost::string_ref::size_type indentation_count(boost::string_ref x)
+ quickbook::string_view::size_type indentation_count(quickbook::string_view x)
{
unsigned count = 0;
- for(boost::string_ref::const_iterator begin = x.begin(), end = x.end();
+ for(quickbook::string_view::const_iterator begin = x.begin(), end = x.end();
begin != end; ++begin)
{
switch(*begin)
@@ -493,7 +493,7 @@ namespace quickbook
return count;
}
- void mapped_file_builder::unindent_and_add(boost::string_ref x)
+ void mapped_file_builder::unindent_and_add(quickbook::string_view x)
{
// I wanted to do everything using a string_ref, but unfortunately
// they don't have all the overloads used in here. So...
@@ -510,8 +510,8 @@ namespace quickbook
// Get the first line indentation
std::string::size_type indent = program.find_first_not_of(" \t", start) - start;
- boost::string_ref::size_type full_indent = indentation_count(
- boost::string_ref(&program[start], indent));
+ quickbook::string_view::size_type full_indent = indentation_count(
+ quickbook::string_view(&program[start], indent));
std::string::size_type pos = start;
@@ -530,12 +530,12 @@ namespace quickbook
indent = (std::min)(indent, n-pos);
full_indent = (std::min)(full_indent, indentation_count(
- boost::string_ref(&program[pos], n-pos)));
+ quickbook::string_view(&program[pos], n-pos)));
}
// Detect if indentation is mixed.
bool mixed_indentation = false;
- boost::string_ref first_indent(&program[start], indent);
+ quickbook::string_view first_indent(&program[start], indent);
pos = start;
while (std::string::npos != (pos = program.find_first_of("\r\n", pos)))
@@ -546,7 +546,7 @@ namespace quickbook
std::string::size_type n = program.find_first_not_of(" \t", pos);
if (n == std::string::npos || n-pos < indent) continue;
- if (boost::string_ref(&program[pos], indent) != first_indent) {
+ if (quickbook::string_view(&program[pos], indent) != first_indent) {
mixed_indentation = true;
break;
}
@@ -570,7 +570,7 @@ namespace quickbook
if (mixed_indentation)
{
- unsigned length = indentation_count(boost::string_ref(
+ unsigned length = indentation_count(quickbook::string_view(
&program[pos], next - pos));
if (length > full_indent) {
@@ -595,7 +595,7 @@ namespace quickbook
data->new_file->source_.append(unindented_program);
}
- file_position mapped_file::position_of(boost::string_ref::const_iterator pos) const
+ file_position mapped_file::position_of(quickbook::string_view::const_iterator pos) const
{
return original->position_of(original->source().begin() +
to_original_pos(find_section(pos), pos - source().begin()));
diff --git a/tools/quickbook/src/files.hpp b/tools/quickbook/src/files.hpp
index 0a2e5309c5..73c530e076 100644
--- a/tools/quickbook/src/files.hpp
+++ b/tools/quickbook/src/files.hpp
@@ -14,7 +14,7 @@
#include <string>
#include <boost/filesystem/path.hpp>
#include <boost/intrusive_ptr.hpp>
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
#include <stdexcept>
#include <cassert>
#include <iosfwd>
@@ -56,15 +56,15 @@ namespace quickbook {
unsigned qbk_version;
unsigned ref_count;
public:
- boost::string_ref source() const { return source_; }
+ quickbook::string_view source() const { return source_; }
- file(fs::path const& path, boost::string_ref source,
+ file(fs::path const& path, quickbook::string_view source,
unsigned qbk_version) :
path(path), source_(source.begin(), source.end()), is_code_snippets(false),
qbk_version(qbk_version), ref_count(0)
{}
- file(file const& f, boost::string_ref source) :
+ file(file const& f, quickbook::string_view source) :
path(f.path), source_(source.begin(), source.end()),
is_code_snippets(f.is_code_snippets),
qbk_version(f.qbk_version), ref_count(0)
@@ -87,7 +87,7 @@ namespace quickbook {
qbk_version = v;
}
- virtual file_position position_of(boost::string_ref::const_iterator) const;
+ virtual file_position position_of(quickbook::string_view::const_iterator) const;
friend void intrusive_ptr_add_ref(file* ptr) { ++ptr->ref_count; }
@@ -112,8 +112,8 @@ namespace quickbook {
struct mapped_file_builder
{
- typedef boost::string_ref::const_iterator iterator;
- typedef boost::string_ref::size_type pos;
+ typedef quickbook::string_view::const_iterator iterator;
+ typedef quickbook::string_view::size_type pos;
mapped_file_builder();
~mapped_file_builder();
@@ -125,11 +125,11 @@ namespace quickbook {
bool empty() const;
pos get_pos() const;
- void add_at_pos(boost::string_ref, iterator);
- void add(boost::string_ref);
+ void add_at_pos(quickbook::string_view, iterator);
+ void add(quickbook::string_view);
void add(mapped_file_builder const&);
void add(mapped_file_builder const&, pos, pos);
- void unindent_and_add(boost::string_ref);
+ void unindent_and_add(quickbook::string_view);
private:
mapped_file_builder_data* data;
diff --git a/tools/quickbook/src/fwd.hpp b/tools/quickbook/src/fwd.hpp
index 5dec2d68a2..224e3c13b5 100644
--- a/tools/quickbook/src/fwd.hpp
+++ b/tools/quickbook/src/fwd.hpp
@@ -13,7 +13,7 @@
#include "iterator.hpp"
#include <boost/intrusive_ptr.hpp>
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
namespace quickbook
{
@@ -27,7 +27,7 @@ namespace quickbook
typedef boost::intrusive_ptr<file> file_ptr;
typedef unsigned source_mode_type;
- typedef boost::string_ref::const_iterator string_iterator;
+ typedef quickbook::string_view::const_iterator string_iterator;
typedef lookback_iterator<string_iterator> parse_iterator;
inline void ignore_variable(void const*) {}
diff --git a/tools/quickbook/src/glob.cpp b/tools/quickbook/src/glob.cpp
index 474bdeb077..91bac35080 100644
--- a/tools/quickbook/src/glob.cpp
+++ b/tools/quickbook/src/glob.cpp
@@ -11,7 +11,7 @@
namespace quickbook
{
- typedef boost::string_ref::const_iterator glob_iterator;
+ typedef quickbook::string_view::const_iterator glob_iterator;
void check_glob_range(glob_iterator&, glob_iterator);
void check_glob_escape(glob_iterator&, glob_iterator);
@@ -21,7 +21,7 @@ namespace quickbook
bool match_range(glob_iterator& pattern_begin, glob_iterator pattern_end,
unsigned char x);
- bool check_glob(boost::string_ref pattern)
+ bool check_glob(quickbook::string_view pattern)
{
bool is_glob = false;
bool is_ascii = true;
@@ -125,8 +125,8 @@ namespace quickbook
++begin;
}
- bool glob(boost::string_ref const& pattern,
- boost::string_ref const& filename)
+ bool glob(quickbook::string_view const& pattern,
+ quickbook::string_view const& filename)
{
// If there wasn't this special case then '*' would match an
// empty string.
@@ -260,29 +260,29 @@ namespace quickbook
return invert_match != matched;
}
- std::size_t find_glob_char(boost::string_ref pattern,
+ std::size_t find_glob_char(quickbook::string_view pattern,
std::size_t pos)
{
- // Weird style is because boost::string_ref's find_first_of
+ // Weird style is because quickbook::string_view's find_first_of
// doesn't take a position argument.
std::size_t removed = 0;
while (true) {
pos = pattern.find_first_of("[]?*\\");
- if (pos == boost::string_ref::npos) return pos;
+ if (pos == quickbook::string_view::npos) return pos;
if (pattern[pos] != '\\') return pos + removed;
pattern.remove_prefix(pos + 2);
removed += pos + 2;
}
}
- std::string glob_unescape(boost::string_ref pattern)
+ std::string glob_unescape(quickbook::string_view pattern)
{
std::string result;
while (true) {
std::size_t pos = pattern.find("\\");
- if (pos == boost::string_ref::npos) {
+ if (pos == quickbook::string_view::npos) {
result.append(pattern.data(), pattern.size());
break;
}
diff --git a/tools/quickbook/src/glob.hpp b/tools/quickbook/src/glob.hpp
index 8e8458961a..5b79c07b2b 100644
--- a/tools/quickbook/src/glob.hpp
+++ b/tools/quickbook/src/glob.hpp
@@ -6,7 +6,7 @@
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
#include <stdexcept>
namespace quickbook
@@ -18,13 +18,13 @@ namespace quickbook
};
// Is this path a glob? Throws glob_error if glob is invalid.
- bool check_glob(boost::string_ref);
+ bool check_glob(quickbook::string_view);
// pre: glob is valid (call check_glob first on user data).
- bool glob(boost::string_ref const& pattern,
- boost::string_ref const& filename);
+ bool glob(quickbook::string_view const& pattern,
+ quickbook::string_view const& filename);
- std::size_t find_glob_char(boost::string_ref,
+ std::size_t find_glob_char(quickbook::string_view,
std::size_t start = 0);
- std::string glob_unescape(boost::string_ref);
+ std::string glob_unescape(quickbook::string_view);
}
diff --git a/tools/quickbook/src/id_generation.cpp b/tools/quickbook/src/id_generation.cpp
index b6445a5816..664014dc26 100644
--- a/tools/quickbook/src/id_generation.cpp
+++ b/tools/quickbook/src/id_generation.cpp
@@ -27,13 +27,13 @@ namespace quickbook {
static const std::size_t max_size = 32;
typedef std::vector<id_placeholder const*> placeholder_index;
- placeholder_index index_placeholders(document_state_impl const&, boost::string_ref);
+ placeholder_index index_placeholders(document_state_impl const&, quickbook::string_view);
void generate_id_block(
placeholder_index::iterator, placeholder_index::iterator,
std::vector<std::string>& generated_ids);
- std::vector<std::string> generate_ids(document_state_impl const& state, boost::string_ref xml)
+ std::vector<std::string> generate_ids(document_state_impl const& state, quickbook::string_view xml)
{
std::vector<std::string> generated_ids(state.placeholders.size());
@@ -102,7 +102,7 @@ namespace quickbook {
count(0)
{}
- void id_value(boost::string_ref value)
+ void id_value(quickbook::string_view value)
{
set_placeholder_order(state.get_placeholder(value));
}
@@ -118,7 +118,7 @@ namespace quickbook {
placeholder_index index_placeholders(
document_state_impl const& state,
- boost::string_ref xml)
+ quickbook::string_view xml)
{
// The order that the placeholder appear in the xml source.
std::vector<unsigned> order(state.placeholders.size());
@@ -287,7 +287,7 @@ namespace quickbook {
{
document_state_impl const& state;
std::vector<std::string> const* ids;
- boost::string_ref::const_iterator source_pos;
+ quickbook::string_view::const_iterator source_pos;
std::string result;
replace_ids_callback(document_state_impl const& state,
@@ -298,16 +298,16 @@ namespace quickbook {
result()
{}
- void start(boost::string_ref xml)
+ void start(quickbook::string_view xml)
{
source_pos = xml.begin();
}
- void id_value(boost::string_ref value)
+ void id_value(quickbook::string_view value)
{
if (id_placeholder const* p = state.get_placeholder(value))
{
- boost::string_ref id = ids ?
+ quickbook::string_view id = ids ?
(*ids)[p->index] : p->unresolved_id;
result.append(source_pos, value.begin());
@@ -316,14 +316,14 @@ namespace quickbook {
}
}
- void finish(boost::string_ref xml)
+ void finish(quickbook::string_view xml)
{
result.append(source_pos, xml.end());
source_pos = xml.end();
}
};
- std::string replace_ids(document_state_impl const& state, boost::string_ref xml,
+ std::string replace_ids(document_state_impl const& state, quickbook::string_view xml,
std::vector<std::string> const* ids)
{
xml_processor processor;
@@ -338,12 +338,12 @@ namespace quickbook {
// Normalizes generated ids.
//
- std::string normalize_id(boost::string_ref src_id)
+ std::string normalize_id(quickbook::string_view src_id)
{
return normalize_id(src_id, max_size);
}
- std::string normalize_id(boost::string_ref src_id, std::size_t size)
+ std::string normalize_id(quickbook::string_view src_id, std::size_t size)
{
std::string id(src_id.begin(), src_id.end());
diff --git a/tools/quickbook/src/id_xml.cpp b/tools/quickbook/src/id_xml.cpp
index d69336b784..40f07f6b45 100644
--- a/tools/quickbook/src/id_xml.cpp
+++ b/tools/quickbook/src/id_xml.cpp
@@ -73,9 +73,9 @@ namespace quickbook
while(it != end && !find_char(text, *it)) ++it;
}
- void xml_processor::parse(boost::string_ref source, callback& c)
+ void xml_processor::parse(quickbook::string_view source, callback& c)
{
- typedef boost::string_ref::const_iterator iterator;
+ typedef quickbook::string_view::const_iterator iterator;
c.start(source);
@@ -118,7 +118,7 @@ namespace quickbook
iterator name_start = it;
read_to_one_of(it, end, "= \t\n\r>");
if (it == end || *it == '>') break;
- boost::string_ref name(name_start, it - name_start);
+ quickbook::string_view name(name_start, it - name_start);
++it;
read_some_of(it, end, "= \t\n\r");
@@ -131,7 +131,7 @@ namespace quickbook
it = std::find(it, end, delim);
if (it == end) break;
- boost::string_ref value(value_start, it - value_start);
+ quickbook::string_view value(value_start, it - value_start);
++it;
if (boost::find(id_attributes, detail::to_s(name))
diff --git a/tools/quickbook/src/include_paths.cpp b/tools/quickbook/src/include_paths.cpp
index 73d8407ad5..19f0fa285f 100644
--- a/tools/quickbook/src/include_paths.cpp
+++ b/tools/quickbook/src/include_paths.cpp
@@ -30,6 +30,14 @@ namespace quickbook
{
if (qbk_version_n >= 107u) {
std::string path_text = path.get_encoded();
+ if (path_text.empty())
+ {
+ detail::outerr(path.get_file(), path.get_position())
+ << "Empty path argument"
+ << "std::endl";
+ ++state.error_count;
+ return path_parameter(path_text, path_parameter::invalid);
+ }
try {
if (check_glob(path_text)) {
@@ -58,6 +66,18 @@ namespace quickbook
std::string path_text = qbk_version_n >= 106u || path.is_encoded() ?
path.get_encoded() : detail::to_s(path.get_quickbook());
+ if (path_text.empty())
+ {
+ detail::outerr(path.get_file(), path.get_position())
+ << "Empty path argument"
+ << std::endl;
+ ++state.error_count;
+ return path_parameter(path_text, path_parameter::invalid);
+ }
+
+ // Check for windows paths, an error in quickbook 1.6
+ // In quickbook 1.7 backslash is used as an escape character
+ // for glob characters.
if (path_text.find('\\') != std::string::npos)
{
quickbook::detail::ostream* err;
@@ -133,7 +153,7 @@ namespace quickbook
if (next != std::string::npos) ++next;
- boost::string_ref glob(
+ quickbook::string_view glob(
path.data() + glob_begin,
glob_end - glob_begin);
@@ -285,12 +305,12 @@ namespace quickbook
file_path < other.file_path;
}
- quickbook_path quickbook_path::operator/(boost::string_ref x) const
+ quickbook_path quickbook_path::operator/(quickbook::string_view x) const
{
return quickbook_path(*this) /= x;
}
- quickbook_path& quickbook_path::operator/=(boost::string_ref x)
+ quickbook_path& quickbook_path::operator/=(quickbook::string_view x)
{
fs::path x2 = detail::generic_to_path(x);
file_path /= x2;
diff --git a/tools/quickbook/src/include_paths.hpp b/tools/quickbook/src/include_paths.hpp
index 7c51dc0f5a..5882092dfa 100644
--- a/tools/quickbook/src/include_paths.hpp
+++ b/tools/quickbook/src/include_paths.hpp
@@ -47,8 +47,8 @@ namespace quickbook
quickbook_path parent_path() const;
bool operator<(quickbook_path const& other) const;
- quickbook_path operator/(boost::string_ref) const;
- quickbook_path& operator/=(boost::string_ref);
+ quickbook_path operator/(quickbook::string_view) const;
+ quickbook_path& operator/=(quickbook::string_view);
// The actual location of the file.
fs::path file_path;
diff --git a/tools/quickbook/src/main_grammar.cpp b/tools/quickbook/src/main_grammar.cpp
index b01f4a0b84..ad935bc73d 100644
--- a/tools/quickbook/src/main_grammar.cpp
+++ b/tools/quickbook/src/main_grammar.cpp
@@ -1207,8 +1207,7 @@ namespace quickbook
if (qbk_version_n == 106u &&
list_stack.top().type == list_stack_item::syntactic_list) {
detail::outerr(state_.current_file, first)
- << "Nested blocks in lists won't be supported in "
- << "quickbook 1.6"
+ << "Paragraphs in lists aren't supported in quickbook 1.6."
<< std::endl;
++state_.error_count;
}
diff --git a/tools/quickbook/src/native_text.cpp b/tools/quickbook/src/native_text.cpp
index 23836c5ce1..62ff52064f 100644
--- a/tools/quickbook/src/native_text.cpp
+++ b/tools/quickbook/src/native_text.cpp
@@ -54,7 +54,7 @@ namespace detail {
return std::string(buffer.get());
}
- std::wstring from_utf8(boost::string_ref text)
+ std::wstring from_utf8(quickbook::string_view text)
{
std::string x(text.begin(), text.end());
int buffer_count = MultiByteToWideChar(CP_UTF8, 0, x.c_str(), -1, 0, 0);
@@ -85,7 +85,7 @@ namespace detail {
#endif
#if QUICKBOOK_WIDE_PATHS
- fs::path generic_to_path(boost::string_ref x)
+ fs::path generic_to_path(quickbook::string_view x)
{
return fs::path(from_utf8(x));
}
@@ -95,7 +95,7 @@ namespace detail {
return to_utf8(x.generic_wstring());
}
#else
- fs::path generic_to_path(boost::string_ref x)
+ fs::path generic_to_path(quickbook::string_view x)
{
return fs::path(x.begin(), x.end());
}
@@ -171,7 +171,7 @@ namespace detail {
if (_isatty(_fileno(stderr))) _setmode(_fileno(stderr), _O_U16TEXT);
}
- void write_utf8(ostream::base_ostream& out, boost::string_ref x)
+ void write_utf8(ostream::base_ostream& out, quickbook::string_view x)
{
out << from_utf8(x);
}
@@ -197,7 +197,7 @@ namespace detail {
{
}
- void write_utf8(ostream::base_ostream& out, boost::string_ref x)
+ void write_utf8(ostream::base_ostream& out, quickbook::string_view x)
{
out << x;
}
@@ -286,7 +286,7 @@ namespace detail {
return *this;
}
- ostream& ostream::operator<<(boost::string_ref x) {
+ ostream& ostream::operator<<(quickbook::string_view x) {
write_utf8(base, x);
return *this;
}
diff --git a/tools/quickbook/src/native_text.hpp b/tools/quickbook/src/native_text.hpp
index 80d6727524..a31daa00bb 100644
--- a/tools/quickbook/src/native_text.hpp
+++ b/tools/quickbook/src/native_text.hpp
@@ -13,7 +13,7 @@
#include <boost/config.hpp>
#include <boost/filesystem/path.hpp>
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
#include <string>
#include <stdexcept>
#include <iostream>
@@ -23,7 +23,10 @@
# define QUICKBOOK_CYGWIN_PATHS 1
#elif defined(_WIN32)
# define QUICKBOOK_WIDE_PATHS 1
-# if defined(BOOST_MSVC) && BOOST_MSVC >= 1400
+ // Wide streams work okay for me with older versions of Visual C++,
+ // but I've had reports of problems. My guess is that it's an
+ // incompatibility with later versions of windows.
+# if defined(BOOST_MSVC) && BOOST_MSVC >= 1700
# define QUICKBOOK_WIDE_STREAMS 1
# endif
#endif
@@ -68,7 +71,7 @@ namespace quickbook
typedef boost::wstring_ref command_line_string_ref;
#else
typedef std::string command_line_string;
- typedef boost::string_ref command_line_string_ref;
+ typedef quickbook::string_view command_line_string_ref;
#endif
// A light wrapper around C++'s streams that gets things right
@@ -86,7 +89,7 @@ namespace quickbook
typedef std::ostream base_ostream;
typedef std::ios base_ios;
typedef std::string string;
- typedef boost::string_ref string_ref;
+ typedef quickbook::string_view string_ref;
#endif
base_ostream& base;
@@ -98,7 +101,7 @@ namespace quickbook
// std::string should be UTF-8 (what a mess!)
ostream& operator<<(std::string const&);
- ostream& operator<<(boost::string_ref);
+ ostream& operator<<(quickbook::string_view);
// Other value types.
ostream& operator<<(int x);
@@ -123,7 +126,7 @@ namespace quickbook
fs::path command_line_to_path(command_line_string const&);
std::string path_to_generic(fs::path const&);
- fs::path generic_to_path(boost::string_ref);
+ fs::path generic_to_path(quickbook::string_view);
void initialise_output();
diff --git a/tools/quickbook/src/quickbook.cpp b/tools/quickbook/src/quickbook.cpp
index 3447a4663b..264b05856d 100644
--- a/tools/quickbook/src/quickbook.cpp
+++ b/tools/quickbook/src/quickbook.cpp
@@ -40,7 +40,7 @@
#pragma warning(disable:4355)
#endif
-#define QUICKBOOK_VERSION "Quickbook Version 1.6.2"
+#define QUICKBOOK_VERSION "Quickbook Version 1.6.3"
namespace quickbook
{
@@ -62,7 +62,7 @@ namespace quickbook
end = preset_defines.end();
it != end; ++it)
{
- boost::string_ref val(*it);
+ quickbook::string_view val(*it);
parse_iterator first(val.begin());
parse_iterator last(val.end());
@@ -285,7 +285,6 @@ main(int argc, char* argv[])
("input-file", PO_VALUE<command_line_string>(), "input file")
("output-file", PO_VALUE<command_line_string>(), "output file")
("output-deps", PO_VALUE<command_line_string>(), "output dependency file")
- ("debug", "debug mode (for developers)")
("ms-errors", "use Microsoft Visual Studio style error & warn message format")
("include-path,I", PO_VALUE< std::vector<command_line_string> >(), "include path")
("define,D", PO_VALUE< std::vector<command_line_string> >(), "define macro")
@@ -293,6 +292,7 @@ main(int argc, char* argv[])
;
hidden.add_options()
+ ("debug", "debug mode")
("expect-errors",
"Succeed if the input file contains a correctly handled "
"error, fail otherwise.")
@@ -382,7 +382,7 @@ main(int argc, char* argv[])
if (vm.count("no-pretty-print"))
parse_document_options.pretty_print = false;
- quickbook::self_linked_headers = !vm.count("no-self-link-headers");
+ quickbook::self_linked_headers = !vm.count("no-self-linked-headers");
if (vm.count("indent"))
parse_document_options.indent = vm["indent"].as<int>();
diff --git a/tools/quickbook/src/string_view.hpp b/tools/quickbook/src/string_view.hpp
new file mode 100644
index 0000000000..3f28b3e98e
--- /dev/null
+++ b/tools/quickbook/src/string_view.hpp
@@ -0,0 +1,30 @@
+/*=============================================================================
+ Copyright (c) 2017 Daniel James
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is 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)
+=============================================================================*/
+#if !defined(BOOST_SPIRIT_QUICKBOOK_STRING_VIEW_HPP)
+#define BOOST_SPIRIT_QUICKBOOK_STRING_VIEW_HPP
+
+#include <boost/utility/string_view.hpp>
+
+namespace quickbook {
+ // boost::string_view now can't be constructed from an rvalue std::string,
+ // which is something that quickbook does in several places, so this wraps
+ // it to allow that.
+
+ struct string_view : boost::string_view {
+ typedef boost::string_view base;
+
+ string_view() : base() {}
+ string_view(string_view const& x) : base(x) {}
+ string_view(std::string const& x) : base(x) {}
+ string_view(const char* x) : base(x) {}
+ string_view(const char* x, typename base::size_type len) : base(x, len) {}
+ };
+}
+
+#endif
diff --git a/tools/quickbook/src/syntax_highlight.cpp b/tools/quickbook/src/syntax_highlight.cpp
index 12e2c5e077..14bc4be02d 100644
--- a/tools/quickbook/src/syntax_highlight.cpp
+++ b/tools/quickbook/src/syntax_highlight.cpp
@@ -34,7 +34,7 @@ namespace quickbook
// State
bool support_callouts;
- boost::string_ref marked_text;
+ quickbook::string_view marked_text;
syntax_highlight_actions(quickbook::state& state, bool is_block) :
state(state),
@@ -129,7 +129,7 @@ namespace quickbook
void syntax_highlight_actions::mark_text(parse_iterator first,
parse_iterator last)
{
- marked_text = boost::string_ref(first.base(), last.base() - first.base());
+ marked_text = quickbook::string_view(first.base(), last.base() - first.base());
}
void syntax_highlight_actions::callout(parse_iterator, parse_iterator)
diff --git a/tools/quickbook/src/utils.cpp b/tools/quickbook/src/utils.cpp
index 6f3b49acda..195d8b68b2 100644
--- a/tools/quickbook/src/utils.cpp
+++ b/tools/quickbook/src/utils.cpp
@@ -15,12 +15,12 @@
namespace quickbook { namespace detail
{
- std::string encode_string(boost::string_ref str)
+ std::string encode_string(quickbook::string_view str)
{
std::string result;
result.reserve(str.size());
- for (boost::string_ref::const_iterator it = str.begin();
+ for (quickbook::string_view::const_iterator it = str.begin();
it != str.end(); ++it)
{
switch (*it)
@@ -50,9 +50,9 @@ namespace quickbook { namespace detail
}
}
- void print_string(boost::string_ref str, std::ostream& out)
+ void print_string(quickbook::string_view str, std::ostream& out)
{
- for (boost::string_ref::const_iterator cur = str.begin();
+ for (quickbook::string_view::const_iterator cur = str.begin();
cur != str.end(); ++cur)
{
print_char(*cur, out);
diff --git a/tools/quickbook/src/utils.hpp b/tools/quickbook/src/utils.hpp
index 3f5c5455dc..93e7ed1f55 100644
--- a/tools/quickbook/src/utils.hpp
+++ b/tools/quickbook/src/utils.hpp
@@ -14,12 +14,12 @@
#include <ostream>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <boost/range/adaptor/transformed.hpp>
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
namespace quickbook { namespace detail {
- std::string encode_string(boost::string_ref);
+ std::string encode_string(quickbook::string_view);
void print_char(char ch, std::ostream& out);
- void print_string(boost::string_ref str, std::ostream& out);
+ void print_string(quickbook::string_view str, std::ostream& out);
char filter_identifier_char(char ch);
template <typename Range>
@@ -36,17 +36,17 @@ namespace quickbook { namespace detail {
// URI escape string
std::string escape_uri(std::string uri);
- inline std::string escape_uri(boost::string_ref uri) {
+ inline std::string escape_uri(quickbook::string_view uri) {
return escape_uri(std::string(uri.begin(), uri.end()));
}
// URI escape string, leaving characters generally used in URIs.
std::string partially_escape_uri(std::string uri);
- inline std::string partially_escape_uri(boost::string_ref uri) {
+ inline std::string partially_escape_uri(quickbook::string_view uri) {
return escape_uri(std::string(uri.begin(), uri.end()));
}
- inline std::string to_s(boost::string_ref x) {
+ inline std::string to_s(quickbook::string_view x) {
return std::string(x.begin(), x.end());
}
}}
diff --git a/tools/quickbook/src/value_tags.hpp b/tools/quickbook/src/value_tags.hpp
index ec3312c1ca..42a5313fa2 100644
--- a/tools/quickbook/src/value_tags.hpp
+++ b/tools/quickbook/src/value_tags.hpp
@@ -36,6 +36,9 @@
\
typedef boost::integer_range<int> range_type; \
static range_type tags() { return boost::irange(start_index, (int) end_index); } \
+ static bool is_tag(int value) { \
+ return value >= start_index && value < (int) end_index; \
+ } \
};
#define QUICKBOOK_VALUE_CASE(r, _, value) \
@@ -61,6 +64,9 @@
\
typedef boost::integer_range<int> range_type; \
static range_type tags() { return boost::irange(start_index, (int) end_index); } \
+ static bool is_tag(int value) { \
+ return value >= start_index && value < (int) end_index; \
+ } \
};
#define QUICKBOOK_VALUE_NAMED_ENUM(r, _, value) \
diff --git a/tools/quickbook/src/values.cpp b/tools/quickbook/src/values.cpp
index 59c11cfa48..8a049e3c1e 100644
--- a/tools/quickbook/src/values.cpp
+++ b/tools/quickbook/src/values.cpp
@@ -50,7 +50,7 @@ namespace quickbook
file_ptr value_node::get_file() const { UNDEFINED_ERROR(); }
string_iterator value_node::get_position() const { UNDEFINED_ERROR(); }
int value_node::get_int() const { UNDEFINED_ERROR(); }
- boost::string_ref value_node::get_quickbook() const { UNDEFINED_ERROR(); }
+ quickbook::string_view value_node::get_quickbook() const { UNDEFINED_ERROR(); }
std::string value_node::get_encoded() const { UNDEFINED_ERROR(); }
value_node* value_node::get_list() const { UNDEFINED_ERROR(); }
@@ -332,7 +332,7 @@ namespace quickbook
virtual value_node* clone() const;
virtual file_ptr get_file() const;
virtual string_iterator get_position() const;
- virtual boost::string_ref get_quickbook() const;
+ virtual quickbook::string_view get_quickbook() const;
virtual bool empty() const;
virtual bool equals(value_node*) const;
@@ -354,7 +354,7 @@ namespace quickbook
virtual value_node* clone() const;
virtual file_ptr get_file() const;
virtual string_iterator get_position() const;
- virtual boost::string_ref get_quickbook() const;
+ virtual quickbook::string_view get_quickbook() const;
virtual std::string get_encoded() const;
virtual bool empty() const;
virtual bool is_encoded() const;
@@ -433,8 +433,8 @@ namespace quickbook
string_iterator qbk_value_impl::get_position() const
{ return begin_; }
- boost::string_ref qbk_value_impl::get_quickbook() const
- { return boost::string_ref(begin_, end_ - begin_); }
+ quickbook::string_view qbk_value_impl::get_quickbook() const
+ { return quickbook::string_view(begin_, end_ - begin_); }
bool qbk_value_impl::empty() const
{ return begin_ == end_; }
@@ -481,8 +481,8 @@ namespace quickbook
string_iterator encoded_qbk_value_impl::get_position() const
{ return begin_; }
- boost::string_ref encoded_qbk_value_impl::get_quickbook() const
- { return boost::string_ref(begin_, end_ - begin_); }
+ quickbook::string_view encoded_qbk_value_impl::get_quickbook() const
+ { return quickbook::string_view(begin_, end_ - begin_); }
std::string encoded_qbk_value_impl::get_encoded() const
{ return encoded_value_; }
diff --git a/tools/quickbook/src/values.hpp b/tools/quickbook/src/values.hpp
index e681c8a75f..c012ca24a4 100644
--- a/tools/quickbook/src/values.hpp
+++ b/tools/quickbook/src/values.hpp
@@ -16,7 +16,7 @@
#include <cassert>
#include <boost/scoped_ptr.hpp>
#include <boost/iterator/iterator_traits.hpp>
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
#include <stdexcept>
#include "fwd.hpp"
#include "files.hpp"
@@ -51,7 +51,7 @@ namespace quickbook
virtual file_ptr get_file() const;
virtual string_iterator get_position() const;
- virtual boost::string_ref get_quickbook() const;
+ virtual quickbook::string_view get_quickbook() const;
virtual std::string get_encoded() const;
virtual int get_int() const;
@@ -113,7 +113,7 @@ namespace quickbook
{ return value_->get_file(); }
string_iterator get_position() const
{ return value_->get_position(); }
- boost::string_ref get_quickbook() const
+ quickbook::string_view get_quickbook() const
{ return value_->get_quickbook(); }
std::string get_encoded() const
{ return value_->get_encoded(); }
diff --git a/tools/quickbook/test/Jamfile.v2 b/tools/quickbook/test/Jamfile.v2
index 505b58ff1a..abf96013af 100644
--- a/tools/quickbook/test/Jamfile.v2
+++ b/tools/quickbook/test/Jamfile.v2
@@ -108,8 +108,11 @@ test-suite quickbook.test :
[ quickbook-test table-1_6 ]
[ quickbook-test table-1_7 ]
[ quickbook-error-test template_arguments1-1_1-fail ]
+ [ quickbook-error-test template_arguments1-1_5-fail ]
[ quickbook-error-test template_arguments2-1_1-fail ]
+ [ quickbook-error-test template_arguments2-1_5-fail ]
[ quickbook-error-test template_arguments3-1_1-fail ]
+ [ quickbook-error-test template_arguments3-1_5-fail ]
[ quickbook-test template_section-1_5 ]
[ quickbook-error-test template_section1-1_5-fail ]
[ quickbook-error-test template_section2-1_5-fail ]
diff --git a/tools/quickbook/test/doc-info/duplicates-1.5.quickbook b/tools/quickbook/test/doc-info/duplicates-1.5.quickbook
index 99e681aba3..ed8f5da226 100644
--- a/tools/quickbook/test/doc-info/duplicates-1.5.quickbook
+++ b/tools/quickbook/test/doc-info/duplicates-1.5.quickbook
@@ -1,5 +1,6 @@
[article Duplicates 1.5
[quickbook 1.5]
+[quickbook 1.5]
[id thing1]
[id thing2]
diff --git a/tools/quickbook/test/python/output-deps.py b/tools/quickbook/test/python/run_tests.py
index 875a808db9..0dd2f09897 100644
--- a/tools/quickbook/test/python/output-deps.py
+++ b/tools/quickbook/test/python/run_tests.py
@@ -13,6 +13,9 @@ def main(args, directory):
quickbook_command = args[0]
failures = 0
+
+ # Dependency tests
+
failures += run_quickbook(quickbook_command, 'svg_missing.qbk',
deps_gold = 'svg_missing_deps.txt')
failures += run_quickbook(quickbook_command, 'svg_missing.qbk',
@@ -29,6 +32,20 @@ def main(args, directory):
locations_gold = 'include_glob_locs.txt',
input_path = ['sub1', 'sub2'])
+ # Try building a simple document with various flags.
+
+ failures += run_quickbook(quickbook_command, 'simple.qbk',
+ output_gold = 'simple.xml')
+ failures += run_quickbook(quickbook_command, 'simple.qbk',
+ extra_flags = ['--no-self-linked-headers'],
+ output_gold = 'simple_no_self_linked.xml')
+ failures += run_quickbook(quickbook_command, 'simple.qbk',
+ extra_flags = ['--no-pretty-print'],
+ output_gold = 'simple_no_pretty_print.xml')
+ failures += run_quickbook(quickbook_command, 'simple.qbk',
+ extra_flags = ['--indent','4','--linewidth','60'],
+ output_gold = 'simple_custom_pretty_print.xml')
+
if failures == 0:
print "Success"
else:
@@ -36,7 +53,8 @@ def main(args, directory):
exit(failures)
def run_quickbook(quickbook_command, filename, output_gold = None,
- deps_gold = None, locations_gold = None, input_path = []):
+ deps_gold = None, locations_gold = None, input_path = [],
+ extra_flags = None):
failures = 0
command = [quickbook_command, '--debug', filename]
@@ -56,9 +74,13 @@ def run_quickbook(quickbook_command, filename, output_gold = None,
locations_filename = temp_filename('.txt')
command.extend(['--output-checked-locations', locations_filename])
+ for path in input_path:
+ command.extend(['-I', path])
+
+ if extra_flags:
+ command.extend(extra_flags)
+
try:
- for path in input_path:
- command.extend(['-I', path])
print 'Running: ' + ' '.join(command)
print
exit_code = subprocess.call(command)
diff --git a/tools/quickbook/test/python/simple.qbk b/tools/quickbook/test/python/simple.qbk
new file mode 100644
index 0000000000..a7a1661ee6
--- /dev/null
+++ b/tools/quickbook/test/python/simple.qbk
@@ -0,0 +1,12 @@
+[quickbook 1.6]
+[article Simple Test Article]
+
+[section:one One]
+
+[h1 A]
+
+Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus. Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit. Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed pretium urna metus scelerisque urna massa vestibulum neque.
+
+[heading B]
+
+[endsect]
diff --git a/tools/quickbook/test/python/simple.xml b/tools/quickbook/test/python/simple.xml
new file mode 100644
index 0000000000..ac4239f996
--- /dev/null
+++ b/tools/quickbook/test/python/simple.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="simple_test_article" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Simple Test Article</title>
+ <section id="simple_test_article.one">
+ <title><link linkend="simple_test_article.one">One</link></title>
+ <bridgehead renderas="sect1" id="simple_test_article.one.h0">
+ <phrase id="simple_test_article.one.a"/><link linkend="simple_test_article.one.a">A</link>
+ </bridgehead>
+ <para>
+ Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit
+ luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus.
+ Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non
+ libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem
+ amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor
+ iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit.
+ Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed
+ pretium urna metus scelerisque urna massa vestibulum neque.
+ </para>
+ <bridgehead renderas="sect3" id="simple_test_article.one.h1">
+ <phrase id="simple_test_article.one.b"/><link linkend="simple_test_article.one.b">B</link>
+ </bridgehead>
+ </section>
+</article>
diff --git a/tools/quickbook/test/python/simple_custom_pretty_print.xml b/tools/quickbook/test/python/simple_custom_pretty_print.xml
new file mode 100644
index 0000000000..b3502c0e25
--- /dev/null
+++ b/tools/quickbook/test/python/simple_custom_pretty_print.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
+"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="simple_test_article" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Simple Test Article</title>
+ <section id="simple_test_article.one">
+ <title><link linkend="simple_test_article.one">One</link></title>
+ <bridgehead renderas="sect1" id="simple_test_article.one.h0">
+ <phrase id="simple_test_article.one.a"/><link linkend="simple_test_article.one.a">A</link>
+ </bridgehead>
+ <para>
+ Lorem ipsum dolor. Sit amet quis hendrerit pretium
+ massa. Et imperdiet sit luctus et nam. Eget neque
+ vivamus nec aliquam vestibulum. Venenatis id penatibus.
+ Rutrum lobortis tempora. Turpis cras imperdiet. Quis
+ parturient quam sed non libero donec in ut aliquam
+ aliquam purus maecenas con dolor in est felis lorem
+ amet vel. Risus mauris felis. Libero felis fringilla.
+ Sed cursus metus dolor iaculis eget sit ac commodo.
+ Molestie interdum nunc. Erat auctor suscipit. Turpis
+ quisque nonummy. Integer vestibulum vivamus vulputate
+ euismod et sed pretium urna metus scelerisque urna
+ massa vestibulum neque.
+ </para>
+ <bridgehead renderas="sect3" id="simple_test_article.one.h1">
+ <phrase id="simple_test_article.one.b"/><link linkend="simple_test_article.one.b">B</link>
+ </bridgehead>
+ </section>
+</article>
diff --git a/tools/quickbook/test/python/simple_no_pretty_print.xml b/tools/quickbook/test/python/simple_no_pretty_print.xml
new file mode 100644
index 0000000000..adc2521964
--- /dev/null
+++ b/tools/quickbook/test/python/simple_no_pretty_print.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
+ "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article
+ id="simple_test_article"
+ last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Simple Test Article</title>
+
+
+
+<section id="simple_test_article.one">
+<title><link linkend="simple_test_article.one">One</link></title>
+<bridgehead renderas="sect1" id="simple_test_article.one.h0"><phrase id="simple_test_article.one.a"/><link linkend="simple_test_article.one.a">A</link></bridgehead><para>
+Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus. Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit. Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed pretium urna metus scelerisque urna massa vestibulum neque.</para>
+<bridgehead renderas="sect3" id="simple_test_article.one.h1"><phrase id="simple_test_article.one.b"/><link linkend="simple_test_article.one.b">B</link></bridgehead></section>
+</article>
+
diff --git a/tools/quickbook/test/python/simple_no_self_linked.xml b/tools/quickbook/test/python/simple_no_self_linked.xml
new file mode 100644
index 0000000000..490e1f250f
--- /dev/null
+++ b/tools/quickbook/test/python/simple_no_self_linked.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="simple_test_article" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Simple Test Article</title>
+ <section id="simple_test_article.one">
+ <title>One</title>
+ <bridgehead renderas="sect1" id="simple_test_article.one.a">
+ A
+ </bridgehead>
+ <para>
+ Lorem ipsum dolor. Sit amet quis hendrerit pretium massa. Et imperdiet sit
+ luctus et nam. Eget neque vivamus nec aliquam vestibulum. Venenatis id penatibus.
+ Rutrum lobortis tempora. Turpis cras imperdiet. Quis parturient quam sed non
+ libero donec in ut aliquam aliquam purus maecenas con dolor in est felis lorem
+ amet vel. Risus mauris felis. Libero felis fringilla. Sed cursus metus dolor
+ iaculis eget sit ac commodo. Molestie interdum nunc. Erat auctor suscipit.
+ Turpis quisque nonummy. Integer vestibulum vivamus vulputate euismod et sed
+ pretium urna metus scelerisque urna massa vestibulum neque.
+ </para>
+ <bridgehead renderas="sect3" id="simple_test_article.one.b">
+ B
+ </bridgehead>
+ </section>
+</article>
diff --git a/tools/quickbook/test/template_arguments1-1_5-fail.quickbook b/tools/quickbook/test/template_arguments1-1_5-fail.quickbook
new file mode 100644
index 0000000000..335306a271
--- /dev/null
+++ b/tools/quickbook/test/template_arguments1-1_5-fail.quickbook
@@ -0,0 +1,11 @@
+[article Expect template to fail because there are too many arguments.
+ [quickbook 1.5]
+]
+
+[template unary[x] [x]]
+
+[section Failure]
+
+[unary a..b ]
+
+[endsect]
diff --git a/tools/quickbook/test/template_arguments2-1_5-fail.quickbook b/tools/quickbook/test/template_arguments2-1_5-fail.quickbook
new file mode 100644
index 0000000000..1c45e09c7c
--- /dev/null
+++ b/tools/quickbook/test/template_arguments2-1_5-fail.quickbook
@@ -0,0 +1,6 @@
+[article Expect template to fail because there are not enough arguments on 1.5.
+ [quickbook 1.5]
+]
+
+[template ternary[x y z] {[x]-[y]-[z]}]
+[ternary 1..2 3 4] \ No newline at end of file
diff --git a/tools/quickbook/test/template_arguments3-1_1-fail.quickbook b/tools/quickbook/test/template_arguments3-1_1-fail.quickbook
index 1c45e09c7c..83b2daa903 100644
--- a/tools/quickbook/test/template_arguments3-1_1-fail.quickbook
+++ b/tools/quickbook/test/template_arguments3-1_1-fail.quickbook
@@ -1,6 +1,10 @@
-[article Expect template to fail because there are not enough arguments on 1.5.
- [quickbook 1.5]
+[article Expect template to fail because there are no arguments.
]
-[template ternary[x y z] {[x]-[y]-[z]}]
-[ternary 1..2 3 4] \ No newline at end of file
+[template ternary[x y z] [x][y][z]]
+
+[section Failure]
+
+[ternary]
+
+[endsect]
diff --git a/tools/quickbook/test/template_arguments3-1_5-fail.quickbook b/tools/quickbook/test/template_arguments3-1_5-fail.quickbook
new file mode 100644
index 0000000000..cd66182411
--- /dev/null
+++ b/tools/quickbook/test/template_arguments3-1_5-fail.quickbook
@@ -0,0 +1,11 @@
+[article Expect template to fail because there are no arguments.
+ [quickbook 1.5]
+]
+
+[template ternary[x y z] [x][y][z]]
+
+[section Failure]
+
+[ternary]
+
+[endsect]
diff --git a/tools/quickbook/test/unit/source_map_test.cpp b/tools/quickbook/test/unit/source_map_test.cpp
index 3eb305741c..dd98a5d3e6 100644
--- a/tools/quickbook/test/unit/source_map_test.cpp
+++ b/tools/quickbook/test/unit/source_map_test.cpp
@@ -8,13 +8,13 @@
#include "fwd.hpp"
#include "files.hpp"
-#include <boost/utility/string_ref.hpp>
+#include "string_view.hpp"
#include <boost/detail/lightweight_test.hpp>
#include <boost/range/algorithm/find.hpp>
void simple_map_tests()
{
- boost::string_ref source("First Line\nSecond Line");
+ quickbook::string_view source("First Line\nSecond Line");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
@@ -34,7 +34,7 @@ void simple_map_tests()
{ // Add full text
builder.start(fake_file);
- builder.add(boost::string_ref(line1, line2_end - line1));
+ builder.add(quickbook::string_view(line1, line2_end - line1));
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(), source);
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
@@ -51,10 +51,10 @@ void simple_map_tests()
{ // Add first line
builder.start(fake_file);
- builder.add(boost::string_ref(line1, line1_end - line1));
+ builder.add(quickbook::string_view(line1, line1_end - line1));
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref(source.begin(), line1_end - line1));
+ quickbook::string_view(source.begin(), line1_end - line1));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(1,1));
BOOST_TEST_EQ(f1->position_of(f1->source().begin() + 2),
@@ -65,9 +65,9 @@ void simple_map_tests()
{ // Add second line
builder.start(fake_file);
- builder.add(boost::string_ref(line2, line2_end - line2));
+ builder.add(quickbook::string_view(line2, line2_end - line2));
quickbook::file_ptr f1 = builder.release();
- BOOST_TEST_EQ(f1->source(), boost::string_ref("Second Line"));
+ BOOST_TEST_EQ(f1->source(), quickbook::string_view("Second Line"));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(2,1));
BOOST_TEST_EQ(f1->position_of(f1->source().begin() + 2),
@@ -78,12 +78,12 @@ void simple_map_tests()
{ // Out of order
builder.start(fake_file);
- builder.add(boost::string_ref(line2, line2_end - line2));
- builder.add(boost::string_ref(line1_end, 1));
- builder.add(boost::string_ref(line1, line1_end - line1));
+ builder.add(quickbook::string_view(line2, line2_end - line2));
+ builder.add(quickbook::string_view(line1_end, 1));
+ builder.add(quickbook::string_view(line1, line1_end - line1));
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Second Line\nFirst Line"));
+ quickbook::string_view("Second Line\nFirst Line"));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(2,1));
@@ -101,12 +101,12 @@ void simple_map_tests()
{ // Repeated text
builder.start(fake_file);
- builder.add(boost::string_ref(line2, line2_end - line2));
- builder.add(boost::string_ref(line1_end, 1));
- builder.add(boost::string_ref(line2, line2_end - line2));
+ builder.add(quickbook::string_view(line2, line2_end - line2));
+ builder.add(quickbook::string_view(line1_end, 1));
+ builder.add(quickbook::string_view(line2, line2_end - line2));
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Second Line\nSecond Line"));
+ quickbook::string_view("Second Line\nSecond Line"));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(2,1));
@@ -126,11 +126,11 @@ void simple_map_tests()
{ // Generated text
builder.start(fake_file);
builder.add_at_pos("------\n", line1);
- builder.add(boost::string_ref(line1, line1_end - line1));
+ builder.add(quickbook::string_view(line1, line1_end - line1));
builder.add_at_pos("\n------\n", line1_end);
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("------\nFirst Line\n------\n"));
+ quickbook::string_view("------\nFirst Line\n------\n"));
quickbook::string_iterator newline = boost::find(f1->source(), '\n');
@@ -157,7 +157,7 @@ void simple_map_tests()
void indented_map_tests()
{
- boost::string_ref source(
+ quickbook::string_view source(
" Code line1\n"
" Code line2\n");
quickbook::file_ptr fake_file = new quickbook::file(
@@ -170,7 +170,7 @@ void indented_map_tests()
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\nCode line2\n"));
+ quickbook::string_view("Code line1\nCode line2\n"));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(1,4));
BOOST_TEST_EQ(f1->position_of(f1->source().begin() + 1),
@@ -197,7 +197,7 @@ void indented_map_tests()
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\nCode line2\n"));
+ quickbook::string_view("Code line1\nCode line2\n"));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(1,4));
BOOST_TEST_EQ(f1->position_of(f1->source().begin() + 1),
@@ -214,12 +214,12 @@ void indented_map_tests()
{
builder.start(fake_file);
- builder.unindent_and_add(boost::string_ref(
+ builder.unindent_and_add(quickbook::string_view(
fake_file->source().begin() + 3,
fake_file->source().end() - (fake_file->source().begin() + 3)));
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n Code line2\n"));
+ quickbook::string_view("Code line1\n Code line2\n"));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(1,4));
BOOST_TEST_EQ(f1->position_of(f1->source().begin() + 1),
@@ -237,7 +237,7 @@ void indented_map_tests()
void indented_map_tests2()
{
- boost::string_ref source(
+ quickbook::string_view source(
" Code line1\n"
"\n"
" Code line2\n");
@@ -251,7 +251,7 @@ void indented_map_tests2()
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n\nCode line2\n"));
+ quickbook::string_view("Code line1\n\nCode line2\n"));
BOOST_TEST_EQ(f1->position_of(f1->source().begin()),
quickbook::file_position(1,4));
BOOST_TEST_EQ(f1->position_of(f1->source().begin() + 1),
@@ -272,36 +272,36 @@ void indented_map_leading_blanks_test()
quickbook::mapped_file_builder builder;
{
- boost::string_ref source("\n\n Code line1\n");
+ quickbook::string_view source("\n\n Code line1\n");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n"));
+ quickbook::string_view("Code line1\n"));
}
{
- boost::string_ref source(" \n \n Code line1\n");
+ quickbook::string_view source(" \n \n Code line1\n");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n"));
+ quickbook::string_view("Code line1\n"));
}
{
- boost::string_ref source(" Code line1\n \n Code line2");
+ quickbook::string_view source(" Code line1\n \n Code line2");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n\nCode line2"));
+ quickbook::string_view("Code line1\n\nCode line2"));
}
}
@@ -310,36 +310,36 @@ void indented_map_trailing_blanks_test()
quickbook::mapped_file_builder builder;
{
- boost::string_ref source("\n\n Code line1\n ");
+ quickbook::string_view source("\n\n Code line1\n ");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n"));
+ quickbook::string_view("Code line1\n"));
}
{
- boost::string_ref source(" \n \n Code line1\n ");
+ quickbook::string_view source(" \n \n Code line1\n ");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n "));
+ quickbook::string_view("Code line1\n "));
}
{
- boost::string_ref source(" Code line1\n \n Code line2\n ");
+ quickbook::string_view source(" Code line1\n \n Code line2\n ");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line1\n\nCode line2\n"));
+ quickbook::string_view("Code line1\n\nCode line2\n"));
}
}
@@ -349,36 +349,36 @@ void indented_map_mixed_test()
quickbook::mapped_file_builder builder;
{
- boost::string_ref source("\tCode line 1\n Code line 2\n\t Code line 3\n \tCode line 4");
+ quickbook::string_view source("\tCode line 1\n Code line 2\n\t Code line 3\n \tCode line 4");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line 1\nCode line 2\n Code line 3\n Code line 4"));
+ quickbook::string_view("Code line 1\nCode line 2\n Code line 3\n Code line 4"));
}
{
- boost::string_ref source(" Code line 1\n\tCode line 2");
+ quickbook::string_view source(" Code line 1\n\tCode line 2");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line 1\n Code line 2"));
+ quickbook::string_view("Code line 1\n Code line 2"));
}
{
- boost::string_ref source(" Code line 1\n \tCode line 2");
+ quickbook::string_view source(" Code line 1\n \tCode line 2");
quickbook::file_ptr fake_file = new quickbook::file(
"(fake file)", source, 105u);
builder.start(fake_file);
builder.unindent_and_add(fake_file->source());
quickbook::file_ptr f1 = builder.release();
BOOST_TEST_EQ(f1->source(),
- boost::string_ref("Code line 1\n\tCode line 2"));
+ quickbook::string_view("Code line 1\n\tCode line 2"));
}
}
diff --git a/tools/quickbook/test/unit/values_test.cpp b/tools/quickbook/test/unit/values_test.cpp
index d3da4a857e..9c673a77d9 100644
--- a/tools/quickbook/test/unit/values_test.cpp
+++ b/tools/quickbook/test/unit/values_test.cpp
@@ -35,7 +35,7 @@ void qbk_tests()
fake_file->source().begin(),
fake_file->source().end());
}
- BOOST_TEST_EQ(q.get_quickbook(), boost::string_ref(source));
+ BOOST_TEST_EQ(q.get_quickbook(), quickbook::string_view(source));
}
void sort_test()