1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter2.Installation</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="../index.html" title="PartI.Boost.Build v2 User Manual">
<link rel="up" href="../index.html" title="PartI.Boost.Build v2 User Manual">
<link rel="prev" href="howto.html" title="Chapter1.How to use this document">
<link rel="next" href="tutorial.html" title="Chapter3.Tutorial">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="howto.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../images/next.png" alt="Next"></a>
</div>
<div class="chapter" lang="en">
<div class="titlepage"><div><div><h2 class="title">
<a name="bbv2.installation"></a>Chapter2.Installation</h2></div></div></div>
<p>
This section describes how to install Boost.Build from a
released <a href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041" target="_top">Boost
source distribution</a>
or <a href="http://sourceforge.net/cvs/?group_id=7586" target="_top">CVS
image</a>.
<sup>[<a name="id2523867" href="#ftn.id2523867">1</a>]</sup>
All paths are given relative to
the <em class="firstterm">Boost.Build v2 root directory</em>, which is
located in the <code class="filename">tools/build/v2</code> subdirectory
of a full Boost <a href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041" target="_top">distribution</a>.
<sup>[<a name="id2523909" href="#ftn.id2523909">2</a>]</sup>
</p>
<div class="orderedlist"><ol type="1">
<li>
Boost.Build uses <a href="../../../tools/jam/index.html" target="_top">Boost.Jam</a>, an
extension of the <a href="http://www.perforce.com/jam/jam.html" target="_top">Perforce
Jam</a> portable <span><strong class="command">make</strong></span> replacement. The
recommended way to get Boost.Jam is to <span class="bold"><strong><a href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941" target="_top">download
a prebuilt executable</a></strong></span> from SourceForge.
If a prebuilt executable is not provided for your platform
or you are using Boost's sources in an unreleased state, it
may be necessary to <a href="../../../doc/html/jam/buildin.html" target="_top">build <span><strong class="command">bjam</strong></span>
from sources</a> included in the Boost source tree.
</li>
<li>
<p>
To install Boost.Jam, copy the executable,
called <span><strong class="command">bjam</strong></span>
or <span><strong class="command">bjam.exe</strong></span> to a location accessible in
your <code class="envar">PATH</code>. Go to the Boost.Build root
directory and
run <span><strong class="command">bjam <code class="option">--version</code></strong></span>. You
should see:
</p>
<pre class="screen">
Boost.Build V2 (Milestone N)
Boost.Jam xx.xx.xx
</pre>
<p>
where N is the version of Boost.Build you're using.
</p>
</li>
<li>
Configure Boost.Build to recognize the build resources (such
as compilers and libraries) you have installed on your
system. Open the
<code class="filename">user-config.jam</code> file in the Boost.Build
root directory and follow the instructions there to describe
your toolsets and libraries, and, if necessary, where they
are located.
</li>
<li>
You should now be able to go to the
<code class="filename">example/hello/</code> directory and run
<span><strong class="command">bjam</strong></span> there. A simple application will be
built. You can also play with other projects in the
<code class="filename">example/</code> directory.
</li>
</ol></div>
<p>
If you are using Boost's CVS state, be sure to
rebuild <span><strong class="command">bjam</strong></span> even if you have a previous
version. The CVS version of Boost.Build requires the CVS
version of Boost.Jam.
</p>
<p>
When <span><strong class="command">bjam</strong></span> is invoked, it always needs to be
able to find the Boost.Build root directory, where the
interpreted source code of Boost.Build is located. There are
two ways to tell <span><strong class="command">bjam</strong></span> about the root directory:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
Set the environment variable <code class="envar">BOOST_BUILD_PATH</code>
to the absolute path of the Boost.Build root directory.
</li>
<li>
<p>
At the root directory of your project or in any of its
parent directories, create a file called
<code class="filename">boost-build.jam</code>, with a single line:
</p>
<pre class="programlisting">
boost-build <em class="replaceable"><code>/path/to/boost.build</code></em> ;
</pre>
<p>
</p>
</li>
</ul></div>
<p><span class="bold"><strong>N.B.</strong></span>
When <span><strong class="command">bjam</strong></span> is invoked from anywhere in the Boost
directory tree <span class="emphasis"><em>other than</em></span> the Boost.Build root
and its subdirectories, <a href="../../../tools/build/index.html" target="_top">Boost.Build
v1</a> is used by default. To override the default and use
Boost.Build v2, you have to add the <code class="option">--v2</code> command
line option to all <span><strong class="command">bjam</strong></span> invocations.</p>
<div class="footnotes">
<br><hr width="100" align="left">
<div class="footnote"><p><sup>[<a name="ftn.id2523867" href="#id2523867">1</a>] </sup>Note that packages prepared for
Unix/Linux systems usually make their own choices about where to
put things and even which parts of Boost to include. When we
say “released source distribution” we mean a
distribution of Boost as released on its SourceForge
<a href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041" target="_top">project
page</a>.
</p></div>
<div class="footnote"><p><sup>[<a name="ftn.id2523909" href="#id2523909">2</a>] </sup>The Boost.Build subset of boost is also distributed
separately, for those who are only interested in getting a
build tool. The top-level directory of a <a href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=80982" target="_top">Boost.Build
distribution</a> contains all the subdirectories of the
<code class="filename">tools/build/v2</code> subdirectory from a full
Boost distribution, so it is itself a valid Boost.Build root
directory. It also contains the
<code class="filename">tools/jam/src</code> subdirectory of a
full Boost distribution, so you can rebuild Boost.Jam from
source.
</p></div>
</div>
</div>
<table width="100%"><tr>
<td align="left"></td>
<td align="right"><small></small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="howto.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../images/next.png" alt="Next"></a>
</div>
</body>
</html>
|