boost-react-native-bundle
Version:
Boost library as in https://sourceforge.net/projects/boost/files/boost/1.57.0/
1,151 lines (931 loc) • 116 kB
text/xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"
[
<!ENTITY toolset_ops "<optional><replaceable>version</replaceable></optional> : <optional><replaceable>c++-compile-command</replaceable></optional> : <optional><replaceable>compiler options</replaceable></optional>">
<!ENTITY option_list_intro "<para>The following options can be provided, using <literal><<replaceable>option-name</replaceable>><replaceable>option-value</replaceable></literal> syntax:</para>">
<!ENTITY using_repeation "<para>This statement may be repeated several times, if you want to configure several versions of the compiler.</para>">
]>
<chapter id="bbv2.reference"
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Reference</title>
<section id="bbv2.reference.general">
<title>General information</title>
<section id="bbv2.reference.init">
<title>Initialization</title>
<para>
Immediately upon starting, the Boost.Build engine (<command>b2</command>)
loads the Jam code that implements the build system. To do this, it searches for a file
called <filename>boost-build.jam</filename>, first in the invocation directory, then
in its parent and so forth up to the filesystem root, and finally
in the directories specified by the environment variable
BOOST_BUILD_PATH. When found, the file is interpreted, and should
specify the build system location by calling the boost-build
rule:</para>
<programlisting>
rule boost-build ( location ? )
</programlisting>
<para>
If location is a relative path, it is treated as relative to
the directory of <filename>boost-build.jam</filename>. The directory specified by
that location and the directories in BOOST_BUILD_PATH are then searched for
a file called <filename>bootstrap.jam</filename>, which is expected to
bootstrap the build system. This arrangement allows the build
system to work without any command-line or environment variable
settings. For example, if the build system files were located in a
directory "build-system/" at your project root, you might place a
<filename>boost-build.jam</filename> at the project root containing:
<programlisting>
boost-build build-system ;
</programlisting>
In this case, running <command>b2</command> anywhere in the project tree will
automatically find the build system.</para>
<para>The default <filename>bootstrap.jam</filename>, after loading some standard
definitions, loads two <filename>site-config.jam</filename> and <filename>user-config.jam</filename>.</para>
</section>
</section>
<section id="bbv2.reference.rules">
<title>Builtin rules</title>
<para>This section contains the list of all rules that
can be used in Jamfile—both rules that define new
targets and auxiliary rules.</para>
<variablelist>
<varlistentry>
<term><literal>exe</literal></term>
<listitem><para>Creates an executable file. See
<xref linkend="bbv2.tasks.programs"/>.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>lib</literal></term>
<listitem><para>Creates an library file. See
<xref linkend="bbv2.tasks.libraries"/>.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>install</literal></term>
<listitem><para>Installs built targets and other files. See
<xref linkend="bbv2.tasks.installing"/>.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>alias</literal></term>
<listitem><para>Creates an alias for other targets. See
<xref linkend="bbv2.tasks.alias"/>.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>unit-test</literal></term>
<listitem><para>Creates an executable that will be automatically run. See
<xref linkend="bbv2.builtins.testing"/>.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>compile</literal></term>
<term><literal>compile-fail</literal></term>
<term><literal>link</literal></term>
<term><literal>link-fail</literal></term>
<term><literal>run</literal></term>
<term><literal>run-fail</literal></term>
<listitem><para>Specialized rules for testing. See
<xref linkend="bbv2.builtins.testing"/>.</para></listitem>
</varlistentry>
<varlistentry id="bbv2.reference.check-target-builds">
<indexterm><primary>check-target-builds</primary></indexterm>
<term><literal>check-target-builds</literal></term>
<listitem><para>The <literal>check-target-builds</literal> allows you
to conditionally use different properties depending on whether some
metatarget builds, or not. This is similar to functionality of configure
script in autotools projects. The function signature is:
</para>
<programlisting>
rule check-target-builds ( target message ? : true-properties * : false-properties * )
</programlisting>
<para>This function can only be used when passing requirements or usage
requirements to a metatarget rule. For example, to make an application link
to a library if it's avavailable, one has use the following:</para>
<programlisting>
exe app : app.cpp : [ check-target-builds has_foo "System has foo" : <library>foo : <define>FOO_MISSING=1 ] ;
</programlisting>
<para>For another example, the alias rule can be used to consolidate configuraiton
choices and make them available to other metatargets, like so:</para>
<programlisting>
alias foobar : : : : [ check-target-builds has_foo "System has foo" : <library>foo : <library>bar ] ;
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>obj</literal></term>
<listitem><para>Creates an object file. Useful when a single source
file must be compiled with special properties.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>preprocessed</literal></term>
<indexterm><primary>preprocessed</primary></indexterm>
<listitem><para>Creates an preprocessed source file. The arguments follow the
<link linkend="bbv2.main-target-rule-syntax">common syntax</link>.</para></listitem>
</varlistentry>
<varlistentry id="bbv2.reference.rules.glob">
<term><literal>glob</literal></term>
<listitem><para>The <code>glob</code> rule takes a list shell pattern
and returns the list of files in the project's source directory that
match the pattern. For example:
<programlisting>
lib tools : [ glob *.cpp ] ;
</programlisting>
It is possible to also pass a second argument—the list of
exclude patterns. The result will then include the list of
files patching any of include patterns, and not matching any
of the exclude patterns. For example:
<programlisting>
lib tools : [ glob *.cpp : file_to_exclude.cpp bad*.cpp ] ;
</programlisting>
</para></listitem>
</varlistentry>
<varlistentry id="bbv2.reference.glob-tree">
<indexterm><primary>glob-tree</primary></indexterm>
<term><literal>glob-tree</literal></term>
<listitem><para>The <code>glob-tree</code> is similar to the
<code>glob</code> except that it operates recursively from
the directory of the containing Jamfile. For example:
<programlisting>
ECHO [ glob-tree *.cpp : .svn ] ;
</programlisting>
will print the names of all C++ files in your project. The
<literal>.svn</literal> exclude pattern prevents the
<code>glob-tree</code> rule from entering administrative
directories of the Subversion version control system.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>project</literal></term>
<listitem><para>Declares project id and attributes, including
project requirements. See <xref linkend="bbv2.overview.projects"/>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>use-project</literal></term>
<listitem><para>Assigns a symbolic project ID to a project at
a given path. This rule must be better documented!
</para></listitem>
</varlistentry>
<varlistentry id="bbv2.reference.rules.explicit">
<term><literal>explicit</literal></term>
<listitem><para>The <literal>explicit</literal> rule takes a single
parameter—a list of target names. The named targets will
be marked explicit, and will be built only if they are explicitly
requested on the command line, or if their dependents are built.
Compare this to ordinary targets, that are built implicitly when
their containing project is built.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>always</literal></term>
<indexterm><primary>always building a metatarget</primary></indexterm>
<listitem><para>The <literal>always</literal> funciton takes a single
parameter—a list of metatarget names. The top-level targets produced
by the named metatargets will be always considered out of date. Consider this example:
</para>
<programlisting>
exe hello : hello.cpp ;
exe bye : bye.cpp ;
always hello ;
</programlisting>
<para>If a build of <filename>hello</filename> is requested, then the binary will
always be relinked. The object files will not be recompiled, though. Note that if
a build of <filename>hello</filename> is not requested, for example you specify just
<filename>bye</filename> on the command line, <filename>hello</filename> will not
be relinked.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>constant</literal></term>
<listitem><para>Sets project-wide constant. Takes two
parameters: variable name and a value and makes the specified
variable name accessible in this Jamfile and any child Jamfiles.
For example:
<programlisting>
constant VERSION : 1.34.0 ;
</programlisting>
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>path-constant</literal></term>
<listitem><para>Same as <literal>constant</literal> except that
the value is treated as path relative to Jamfile location. For example,
if <command>b2</command> is invoked in the current directory,
and Jamfile in <filename>helper</filename> subdirectory has:
<programlisting>
path-constant DATA : data/a.txt ;
</programlisting>
then the variable <varname>DATA</varname> will be set to
<literal>helper/data/a.txt</literal>, and if <command>b2</command>
is invoked from the <filename>helper</filename> directory, then
the variable <varname>DATA</varname> will be set to
<literal>data/a.txt</literal>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>build-project</literal></term>
<listitem><para>Cause some other project to be built. This rule
takes a single parameter—a directory name relative to
the containing Jamfile. When the containing Jamfile is built,
the project located at that directory will be built as well.
At the moment, the parameter to this rule should be a directory
name. Project ID or general target references are not allowed.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>test-suite</literal></term>
<listitem><para>This rule is deprecated and equivalent to
<code>alias</code>.</para></listitem>
</varlistentry>
</variablelist>
</section>
<section id="bbv2.overview.builtins.features">
<title>Builtin features</title>
<para>This section documents the features that are built-in into
Boost.Build. For features with a fixed set of values, that set is
provided, with the default value listed first.</para>
<indexterm><primary>features</primary><secondary>builtin</secondary></indexterm>
<variablelist>
<varlistentry><term><literal>variant</literal></term>
<indexterm><primary>variant</primary></indexterm>
<listitem>
<para>
A feature combining several low-level features, making it easy to
request common build configurations.
</para>
<para>
<emphasis role="bold">Allowed values:</emphasis>
<literal>debug</literal>, <literal>release</literal>,
<literal>profile</literal>.
</para>
<para>
The value <literal>debug</literal> expands to
</para>
<programlisting>
<optimization>off <debug-symbols>on <inlining>off <runtime-debugging>on
</programlisting>
<para>
The value <literal>release</literal> expands to
</para>
<programlisting>
<optimization>speed <debug-symbols>off <inlining>full <runtime-debugging>off
</programlisting>
<para>
The value <literal>profile</literal> expands to the same as
<literal>release</literal>, plus:
</para>
<programlisting>
<profiling>on <debug-symbols>on
</programlisting>
<para>
Users can define their own build variants using the
<code>variant</code> rule from the <code>common</code> module.
</para>
<para>
<emphasis role="bold">Note:</emphasis> Runtime debugging is on in
debug builds to suit the expectations of people used to various
IDEs.
<!-- Define "runtime debugging". Why will those people expect it to
be on in debug builds? -->
</para>
</listitem>
</varlistentry>
<varlistentry id="bbv2.overview.builtins.features.link">
<term><literal>link</literal></term>
<indexterm><primary>link</primary></indexterm>
<listitem>
<para><emphasis role="bold">Allowed values:</emphasis> <literal>shared</literal>,
<literal>static</literal></para>
<simpara>
A feature controling how libraries are built.
</simpara>
</listitem>
</varlistentry>
<varlistentry id="bbv2.overview.builtins.features.runtime-link">
<indexterm><primary>runtime linking</primary></indexterm>
<term><literal>runtime-link</literal></term>
<listitem>
<para><emphasis role="bold">Allowed values:</emphasis> <literal>shared</literal>,
<literal>static</literal></para>
<simpara>
Controls if a static or shared C/C++ runtime should be used. There
are some restrictions how this feature can be used, for example
on some compilers an application using static runtime should
not use shared libraries at all, and on some compilers,
mixing static and shared runtime requires extreme care. Check
your compiler documentation for more details.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>threading</literal></term>
<indexterm><primary>threading</primary></indexterm>
<listitem>
<para><emphasis role="bold">Allowed values:</emphasis> <literal>single</literal>,
<literal>multi</literal></para>
<simpara>
Controls if the project should be built in multi-threaded mode. This feature does not
necessary change code generation in the compiler, but it causes the compiler to link
to additional or different runtime libraries, and define additional preprocessor
symbols (for example, <code>_MT</code> on Windows and <code>_REENTRANT</code> on Linux).
How those symbols affect the compiled code depends on the code itself.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>source</literal></term>
<indexterm><primary>source</primary></indexterm>
<listitem>
<simpara>
The <code><source>X</code> feature has the same effect on
building a target as putting X in the list of sources. It is useful
when you want to add the same source to all targets in the project
(you can put <source> in requirements) or to conditionally
include a source (using conditional requirements, see <xref linkend=
"bbv2.tutorial.conditions"/>). See also the <code><library>
</code> feature.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>library</literal></term>
<indexterm><primary>library</primary></indexterm>
<listitem>
<simpara>
This feature is almost equivalent to the <code><source></code>
feature, except that it takes effect only for linking. When you want
to link all targets in a Jamfile to certain library, the
<code><library></code> feature is preferred over
<code><source>X</code>—the latter will add the library to
all targets, even those that have nothing to do with libraries.
</simpara>
</listitem>
</varlistentry>
<varlistentry><term><anchor id="bbv2.builtin.features.dependency"/>
<literal>dependency</literal></term>
<indexterm><primary>dependency</primary></indexterm>
<listitem>
<simpara>
Introduces a dependency on the target named by the value of this
feature (so it will be brought up-to-date whenever the target being
declared is). The dependency is not used in any other way.
<!--
====================================================================
An example and a motivation is needed here. Below is some commented
out content that used to be here but did not make any sense and
seems to have been left unfinished in some previous revision. Should
be fixed and this whole feature should be retested and fixed as
needed.
====================================================================
For example, in application with plugins, the plugins are not used
when linking the application, application might have a dependency on
its plugins, even though
and
adds its usage requirements to the build properties
of the target being declared.
The primary use case is when you want
the usage requirements (such as <code>#include</code> paths) of some
library to be applied, but do not want to link to it.
It is hard to picture why anyone would want to do that. Please flesh
out this motivation.
====================================================================
-->
</simpara>
</listitem>
</varlistentry>
<varlistentry><term><anchor id="bbv2.builtin.features.implicit-dependency"/>
<literal>implicit-dependency</literal></term>
<indexterm><primary>implicit-dependency</primary></indexterm>
<listitem>
<simpara>
Indicates that the target named by the value of this feature
may produce files that are included by the sources of the
target being declared. See <xref linkend="bbv2.reference.generated_headers"/>
for more information.
</simpara>
</listitem>
</varlistentry>
<varlistentry><term><anchor id="bbv2.builtin.features.use"/>
<literal>use</literal></term>
<indexterm><primary>use</primary></indexterm>
<listitem>
<simpara>
Introduces a dependency on the target named by the value of this
feature (so it will be brought up-to-date whenever the target being
declared is), and adds its usage requirements to the build
properties
<!-- Do you really mean "to the requirements?" -->
of the target being declared. The dependency is not used in any
other way. The primary use case is when you want the usage
requirements (such as <code>#include</code> paths) of some library
to be applied, but do not want to link to it.
<!-- It is hard to picture why anyone would want to do that. Please
flesh out this motivation. -->
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><anchor id="bbv2.reference.features.dll-path"/>
<literal>dll-path</literal></term>
<indexterm><primary>dll-path</primary></indexterm>
<listitem>
<simpara>
Specify an additional directory where the system should
look for shared libraries when the executable or shared
library is run. This feature only affects Unix
compilers. Plase see <xref linkend="bbv2.faq.dll-path"/>
in <xref linkend="bbv2.faq"/> for details.
</simpara>
</listitem></varlistentry>
<varlistentry>
<term><literal>hardcode-dll-paths</literal></term>
<indexterm><primary>hardcode-dll-paths</primary></indexterm>
<listitem>
<simpara>
Controls automatic generation of dll-path properties.
</simpara>
<para><emphasis role="bold">Allowed values:</emphasis>
<literal>true</literal>, <literal>false</literal>. This property is
specific to Unix systems. If an executable is built with
<code><hardcode-dll-paths>true</code>, the generated binary
will contain the list of all the paths to the used shared libraries.
As the result, the executable can be run without changing system
paths to shared libraries or installing the libraries to system
paths. This <!-- you need an antecedent. This _what_? --> is very
convenient during development. Plase see the <link linkend=
"bbv2.faq.dll-path">FAQ entry</link> for details. Note that on Mac
OSX, the paths are unconditionally hardcoded by the linker, and it
is not possible to disable that behaviour.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>cflags</literal></term>
<term><literal>cxxflags</literal></term>
<term><literal>linkflags</literal></term>
<listitem>
<simpara>
The value of those features is passed without modification to the
corresponding tools. For <code>cflags</code> that is both the C and
C++ compilers, for <code>cxxflags</code> that is the C++ compiler
and for <code>linkflags</code> that is the linker. The features are
handy when you are trying to do something special that cannot be
achieved by a higher-level feature in Boost.Build.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>include</literal></term>
<indexterm><primary>include</primary></indexterm>
<listitem>
<simpara>
Specifies an additional include path that is to be passed to C and
C++ compilers.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>define</literal></term>
<indexterm><primary>define</primary></indexterm>
<listitem>
<simpara>
Specifies an preprocessor symbol that should be defined on the command
line. You may either specify just the symbol, which will be defined
without any value, or both the symbol and the value, separated by
equal sign.
</simpara>
</listitem>
</varlistentry>
<varlistentry><term><literal>warnings</literal></term>
<listitem>
<simpara>
The <code><warnings></code> feature controls the warning level
of compilers. It has the following values:
<itemizedlist>
<listitem><para><code>off</code> - disables all warnings.</para></listitem>
<listitem><para><code>on</code> - enables default warning level for the tool.</para></listitem>
<listitem><para><code>all</code> - enables all warnings.</para></listitem>
</itemizedlist>
Default value is <code>all</code>.
</simpara>
</listitem>
</varlistentry>
<varlistentry><term><literal>warnings-as-errors</literal></term>
<listitem>
<simpara>
The <code><warnings-as-errors></code> makes it possible to
treat warnings as errors and abort compilation on a warning. The
value <code>on</code> enables this behaviour. The default value is
<code>off</code>.
</simpara>
</listitem>
</varlistentry>
<varlistentry><term><literal>build</literal></term>
<listitem>
<para><emphasis role="bold">Allowed values:</emphasis> <literal>no</literal></para>
<para>
The <code>build</code> feature is used to conditionally disable
build of a target. If <code><build>no</code> is in properties
when building a target, build of that target is skipped. Combined
with conditional requirements this allows you to skip building some
target in configurations where the build is known to fail.
</para>
</listitem>
</varlistentry>
<varlistentry><term><anchor id="bbv2.builtin.features.tag"/><literal>tag</literal></term>
<listitem><para>The <literal>tag</literal> feature is used to customize
the name of the generated files. The value should have the form:
<programlisting>@<replaceable>rulename</replaceable></programlisting> where
<replaceable>rulename</replaceable> should be a name of a rule with the
following signature:
<programlisting>rule tag ( name : type ? : property-set )</programlisting>
The rule will be called for each target with the default name computed
by Boost.Build, the type of the target, and property set. The rule can
either return a string that must be used as the name of the target, or
an empty string, in which case the default name will be used.
</para>
<para>Most typical use of the <literal>tag</literal> feature is to
encode build properties, or library version in library target names. You
should take care to return non-empty string from the tag rule only for
types you care about — otherwise, you might end up modifying
names of object files, generated header file and other targets for which
changing names does not make sense.</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>debug-symbols</literal></term>
<listitem>
<para><emphasis role="bold">Allowed values:</emphasis> <literal>on</literal>, <literal>off</literal>.</para>
<para>The <literal>debug-symbols</literal> feature specifies if
produced object files, executables and libraries should include
debug information.
Typically, the value of this feature is implicitly set by the
<literal>variant</literal> feature, but it can be explicitly
specified by the user. The most common usage is to build
release variant with debugging information.</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>runtime-debugging</literal></term>
<listitem>
<para><emphasis role="bold">Allowed values:</emphasis> <literal>on</literal>, <literal>off</literal>.</para>
<para>The <literal>runtime-debugging</literal> feature specifies if
produced object files, executables and libraries should include
behaviour useful only for debugging, such as asserts.
Typically, the value of this feature is implicitly set by the
<literal>variant</literal> feature, but it can be explicitly
specified by the user. The most common usage is to build
release variant with debugging output.</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>target-os</literal></term>
<listitem>
<anchor id="bbv2.reference.features.target-os"/>
<para>
The operating system for which the code is to be generated. The
compiler you used should be the compiler for that operating
system. This option causes Boost.Build to use naming conventions
suitable for that operating system, and adjust build process
accordingly. For example, with gcc, it controls if import
libraries are produced for shared libraries or not.
</para>
<para>The complete list of possible values for this feature is:
aix, bsd, cygwin, darwin, freebsd, hpux, iphone, linux, netbsd,
openbsd, osf, qnx, qnxnto, sgi, solaris, unix, unixware, windows.
</para>
<para>See <xref linkend="bbv2.tasks.crosscompile"/> for details of
crosscompilation</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>architecture</literal></term>
<listitem>
<para>The <literal>architecture</literal> features specifies
the general processor familty to generate code for.</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>instruction-set</literal></term>
<indexterm><primary>instruction-set</primary></indexterm>
<listitem>
<para>
<emphasis role="bold">Allowed values:</emphasis> depend on the used
toolset.
</para>
<para>The <literal>instruction-set</literal> specifies for which
specific instruction set the code should be generated. The
code in general might not run on processors with older/different
instruction sets.</para>
<para>While Boost.Build allows a large set of possible values
for this features, whether a given value works depends on which
compiler you use. Please see
<xref linkend="bbv2.reference.tools.compilers"/> for details.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>address-model</literal></term>
<indexterm><primary>64-bit compilation</primary></indexterm>
<listitem>
<para><emphasis role="bold">Allowed values:</emphasis> <literal>32</literal>, <literal>64</literal>.</para>
<para>The <literal>address-model</literal> specifies if 32-bit or
64-bit code should be generated by the compiler. Whether this feature
works depends on the used compiler, its version, how the compiler is
configured, and the values of the <literal>architecture</literal>
<literal>instruction-set</literal>
features. Please see <xref linkend="bbv2.reference.tools.compilers"/>
for details.</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>c++-template-depth</literal></term>
<listitem>
<para>
<emphasis role="bold">Allowed values:</emphasis> Any positive
integer.
</para>
<para>
This feature allows configuring a C++ compiler with the maximal
template instantiation depth parameter. Specific toolsets may or may
not provide support for this feature depending on whether their
compilers provide a corresponding command-line option.
</para>
<para>
<emphasis role="bold">Note:</emphasis> Due to some internal details
in the current Boost.Build implementation it is not possible to have
features whose valid values are all positive integer. As a
workaround a large set of allowed values has been defined for this
feature and, if a different one is needed, user can easily add it by
calling the feature.extend rule.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>embed-manifest</literal></term>
<listitem>
<indexterm><primary>manifest file</primary><secondary>embedding</secondary></indexterm>
<indexterm><primary>embed-manifest</primary></indexterm>
<para>
<emphasis role="bold">Allowed values:</emphasis> on, off.
</para>
<para>This feature is specific to the msvc toolset (see
<xref linkend="bbv2.reference.tools.compiler.msvc"/>),
and controls whether the manifest files should be embedded inside
executables and shared libraries, or placed alongside them. This
feature corresponds to the IDE option found in the project settings dialog,
under <menuchoice><guimenu>Configuration Properties</guimenu>
<guisubmenu>Manifest Tool</guisubmenu>
<guisubmenu>Input and Output</guisubmenu>
<guimenuitem>Embed manifest</guimenuitem> </menuchoice>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>embed-manifest-file</literal></term>
<listitem>
<indexterm><primary>manifest file</primary><secondary>embedding</secondary></indexterm>
<indexterm><primary>embed-manifest-file</primary></indexterm>
<para>This feature is specific to the msvc toolset (see
<xref linkend="bbv2.reference.tools.compiler.msvc"/>),
and controls which manifest files should be embedded inside
executables and shared libraries. This
feature corresponds to the IDE option found in the project settings dialog,
under <menuchoice><guimenu>Configuration Properties</guimenu>
<guisubmenu>Manifest Tool</guisubmenu>
<guisubmenu>Input and Output</guisubmenu>
<guimenuitem>Additional Manifest Files</guimenuitem> </menuchoice>.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="bbv2.reference.tools">
<title>Builtin tools</title>
<para>Boost.Build comes with support for a large number of C++ compilers,
and other tools. This section documents how to use those tools.</para>
<para>Before using any tool, you must declare your intention, and possibly
specify additional information about the tool's configuration. This is
done by calling the <code>using</code> rule, typically in your
<filename>user-config.jam</filename>, for example:</para>
<programlisting>
using gcc ;
</programlisting>
<para>additional parameters can be passed just like for other rules, for example:</para>
<programlisting>
using gcc : 4.0 : g++-4.0 ;
</programlisting>
<para>The options that can be passed to each tool are documented in the
subsequent sections.</para>
<section id="bbv2.reference.tools.compilers">
<title>C++ Compilers</title>
<para>This section lists all Boost.Build modules that support C++
compilers and documents how each one can be initialized. The name
of support module for compiler is also the value for
the <code>toolset</code> feature that can be used to explicitly
request that compiler. </para>
<section id="bbv2.reference.tools.compiler.gcc">
<title>GNU C++</title>
<para>The <code>gcc</code> module supports the
<ulink url="http://gcc.gnu.org">GNU C++ compiler</ulink>
on Linux, a number of Unix-like system including SunOS and on Windows
(either <ulink url="http://www.cygwin.com">Cygwin</ulink> or
<ulink url="http://www.mingw.org">MinGW</ulink>). On Mac OSX, it is recommended
to use system gcc, see <xref linkend="bbv2.reference.tools.compiler.darwin"/>.
</para>
<para>The <code>gcc</code> module is initialized using the following
syntax:</para>
<programlisting>
using gcc : &toolset_ops; ;</programlisting>
&using_repeation;
<!-- FIXME: mention everywhere what is the semantic
of version is -->
<para>
If the version is not explicitly specified, it will be
automatically detected by running the compiler with the <code>-v</code>
option. If the command is not specified, the <command>g++</command>
binary will be searched in <envar>PATH</envar>.</para>
&option_list_intro;
<variablelist>
<xi:include href="fragments.xml" xpointer="xpointer(id('common_options')/*)"
parse="xml"/>
<xi:include href="fragments.xml" xpointer="xpointer(id('root_option')/*)"
parse="xml"/>
<varlistentry>
<term><literal>rc</literal></term>
<listitem>
<para>Specifies the resource compiler command
that will be used with the version of gcc that is being
configured. This setting makes sense only for Windows and only
if you plan to use resource files. By
default <command>windres</command> will be used.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>rc-type</literal></term>
<listitem>
<para>Specifies the type of resource compiler. The value can
be either <code>windres</code> for msvc resource compiler,
or <code>rc</code> for borland's resource compiler.</para>
</listitem>
</varlistentry>
</variablelist>
<indexterm><primary>64-bit compilation</primary>
<secondary>gcc</secondary></indexterm>
In order to compile 64-bit applications, you have to specify
<code>address-model=64</code>, and the <code>instruction-set</code>
feature should refer to a 64 bit processor. Currently, those
include <literal>nocona</literal>, <literal>opteron</literal>,
<literal>athlon64</literal> and <literal>athlon-fx</literal>.
</section>
<section id="bbv2.reference.tools.compiler.darwin">
<title>Apple Darwin gcc</title>
<para>The <code>darwin</code> module supports the version of gcc that is
modified and provided by Apple. The configuration is essentially identical
to that of the gcc module.
</para>
<para>
<indexterm><primary>fat binaries</primary></indexterm>
The darwin toolset can generate so called "fat"
binaries—binaries that can run support more than one
architecture, or address mode. To build a binary that can run both
on Intel and PowerPC processors, specify
<code>architecture=combined</code>. To build a binary that can run
both in 32-bit and 64-bit modes, specify
<code>address-model=32_64</code>. If you specify both of those
properties, a "4-way" fat binary will be generated.
</para>
</section>
<section id="bbv2.reference.tools.compiler.msvc">
<title>Microsoft Visual C++</title>
<para>The <code>msvc</code> module supports the
<ulink url="http://msdn.microsoft.com/visualc/">Microsoft Visual
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 2010—10.0</para></listitem>
<listitem><para>Visual Studio 2008—9.0</para></listitem>
<listitem><para>Visual Studio 2005—8.0</para></listitem>
<listitem><para>Visual Studio .NET 2003—7.1</para></listitem>
<listitem><para>Visual Studio .NET—7.0</para></listitem>
<listitem><para>Visual Studio 6.0, Service Pack 5—6.5</para></listitem>
</itemizedlist>
<para>The <code>msvc</code> module is initialized using the following
syntax:</para>
<programlisting>
using msvc : &toolset_ops; ;
</programlisting>
&using_repeation;
<para>If the version is not explicitly specified, the most recent
version found in the registry will be used instead. If the special
value <code>all</code> is passed as the version, all versions found in
the registry will be configured. If a version is specified, but the
command is not, the compiler binary will be searched in standard
installation paths for that version, followed by <envar>PATH</envar>.
</para>
<para>The compiler command should be specified using forward slashes,
and quoted.</para>
&option_list_intro;
<variablelist>
<xi:include href="fragments.xml" xpointer="xpointer(id('common_options')/*)"
parse="xml"/>
<varlistentry>
<term><literal>assembler</literal></term>
<listitem><para>The command that compiles assembler sources. If
not specified, <command>ml</command> will be used. The command
will be invoked after the setup script was executed and adjusted
the <envar>PATH</envar> variable.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>compiler</literal></term>
<listitem><para>The command that compiles C and C++ sources. If
not specified, <command>cl</command> will be used. The command
will be invoked after the setup script was executed and adjusted
the <envar>PATH</envar> variable.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>compiler-filter</literal></term>
<listitem><para>Command through which to pipe the output of
running the compiler. For example to pass the output to STLfilt.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>idl-compiler</literal></term>
<listitem><para>The command that compiles Microsoft COM interface
definition files. If not specified, <command>midl</command> will
be used. The command will be invoked after the setup script was
executed and adjusted the <envar>PATH</envar> variable.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>linker</literal></term>
<listitem><para>The command that links executables and dynamic
libraries. If not specified, <command>link</command> will be used.
The command will be invoked after the setup script was executed
and adjusted the <envar>PATH</envar> variable.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>mc-compiler</literal></term>
<listitem><para>The command that compiles Microsoft message
catalog files. If not specified, <command>mc</command> will be
used. The command will be invoked after the setup script was
executed and adjusted the <envar>PATH</envar> variable.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>resource-compiler</literal></term>
<listitem><para>The command that compiles resource files. If not
specified, <command>rc</command> will be used. The command will be
invoked after the setup script was executed and adjusted the
<envar>PATH</envar> variable.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>setup</literal></term>
<listitem><para>The filename of the global environment setup
script to run before invoking any of the tools defined in this
toolset. Will not be used in case a target platform specific
script has been explicitly specified for the current target
platform. Used setup script will be passed the target platform
identifier (x86, x86_amd64, x86_ia64, amd64 or ia64) as a
arameter. If not specified a default script is chosen based on the
used compiler binary, e.g. <command>vcvars32.bat</command> or
<command>vsvars32.bat</command>.</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>setup-amd64</literal></term>
<term><literal>setup-i386</literal></term>
<term><literal>setup-ia64</literal></term>
<listitem><para>The filename of the target platform specific
environment setup script to run before invoking any of the tools
defined in this toolset. If not specified the global environment
setup script is used.</para></listitem>
</varlistentry>
</variablelist>
<section id="v2.reference.tools.compiler.msvc.64">
<title>64-bit support</title>
<indexterm><primary>64-bit compilation</primary>
<secondary>Microsoft Visual Studio</secondary></indexterm>
<para>Starting with version 8.0, Microsoft Visual Studio can
generate binaries for 64-bit processor, both 64-bit flavours of x86
(codenamed AMD64/EM64T), and Itanium (codenamed IA64). In addition,
compilers that are itself run in 64-bit mode, for better
performance, are provided. The complete list of compiler
configurations are as follows (we abbreviate AMD64/EM64T to just
AMD64):</para>
<itemizedlist>
<listitem><para>32-bit x86 host, 32-bit x86 target</para>
</listitem>
<listitem><para>32-bit x86 host, 64-bit AMD64 target</para>
</listitem>
<listitem><para>32-bit x86 host, 64-bit IA64 target</para>
</listitem>
<listitem><para>64-bit AMD64 host, 64-bit AMD64 target</para>
</listitem>
<listitem><para>64-bit IA64 host, 64-bit IA64 target</para>
</listitem>
</itemizedlist>
<para>
The 32-bit host compilers can be always used, even on 64-bit
Windows. On the contrary, 64-bit host compilers require both 64-bit
host processor and 64-bit Windows, but can be faster. By default,
only 32-bit host, 32-bit target compiler is installed, and
additional compilers need to be installed explicitly.
</para>
<para>To use 64-bit compilation you should:</para>
<orderedlist>
<listitem><para>Configure you compiler as usual. If you provide a
path to the compiler explicitly, provide the path to the 32-bit
compiler. If you try to specify the path to any of 64-bit
compilers, configuration will not work.</para></listitem>
<listitem><para>When compiling, use <code>address-model=64</code>,
to generate AMD64 code.</para></listitem>
<listitem><para>To generate IA64 code, use
<code>architecture=ia64</code></para></listitem>
</orderedlist>
<para>The (AMD64 host, AMD64 target) compiler will be used