| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> |
| <title>Installation</title> |
| <link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css"> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> |
| <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> |
| <link rel="up" href="../bbv2.html" title="Chapter 33. Boost.Build V2 User Manual"> |
| <link rel="prev" href="../bbv2.html" title="Chapter 33. Boost.Build V2 User Manual"> |
| <link rel="next" href="tutorial.html" title="Tutorial"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table cellpadding="2" width="100%"><tr> |
| <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> |
| <td align="center"><a href="../../../index.html">Home</a></td> |
| <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> |
| <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> |
| <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> |
| <td align="center"><a href="../../../more/index.htm">More</a></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <a accesskey="p" href="../bbv2.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../bbv2.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> |
| </div> |
| <div class="section"> |
| <div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
| <a name="bbv2.installation"></a>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="id3264173" href="#ftn.id3264173" class="footnote">9</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="id3264206" href="#ftn.id3264206" class="footnote">10</a>]</sup> |
| </p> |
| <div class="orderedlist"><ol class="orderedlist" type="1"> |
| <li class="listitem"> |
| 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 class="command"><strong>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 class="link" href="../jam/building.html" title="Building BJam">build <span class="command"><strong>bjam</strong></span> |
| from sources</a> included in the Boost source tree. |
| </li> |
| <li class="listitem"> |
| <p> |
| |
| To install Boost.Jam, copy the executable, |
| called <span class="command"><strong>bjam</strong></span> |
| or <span class="command"><strong>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 class="command"><strong>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 class="listitem"> |
| 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 class="listitem"> |
| You should now be able to go to the |
| <code class="filename">example/hello/</code> directory and run |
| <span class="command"><strong>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 class="command"><strong>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 class="command"><strong>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 class="command"><strong>bjam</strong></span> about the root directory: |
| </p> |
| <div class="itemizedlist"><ul class="itemizedlist" type="disc"> |
| <li class="listitem"> |
| Set the environment variable <code class="envar">BOOST_BUILD_PATH</code> |
| to the absolute path of the Boost.Build root directory. |
| </li> |
| <li class="listitem"> |
| <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> |
| <h3> |
| <a name="id3264458"></a>Information for distributors</h3> |
| <p> |
| If you're planning to package Boost.Build for a Linux distribution, |
| please follow these guidelines: |
| |
| </p> |
| <div class="itemizedlist"><ul class="itemizedlist" type="disc"> |
| <li class="listitem"><p>Create a separate package for Boost.Jam.</p></li> |
| <li class="listitem"> |
| <p>Create another package for Boost.Build, and make |
| this package install all Boost.Build files to |
| <code class="filename">/usr/share/boost-build</code> directory. After |
| install, that directory should contain everything you see in |
| Boost.Build release package, except for |
| <code class="filename">jam_src</code> directory. If you're using Boost CVS |
| to obtain Boost.Build, as opposed to release package, take |
| everything from the <code class="filename">tools/build/v2</code> directory. |
| For a check, make sure that |
| <code class="filename">/usr/share/boost-build/boost-build.jam</code> is installed. |
| </p> |
| <p>Placing Boost.Build into <code class="filename">/usr/share/boost-build</code> |
| will make sure that <span class="command"><strong>bjam</strong></span> will find Boost.Build |
| without any additional setup.</p> |
| </li> |
| <li class="listitem"> |
| <p>Provide a |
| <code class="filename">/etc/site-config.jam</code> configuration file that will |
| contain: |
| </p> |
| <pre class="programlisting"> |
| using gcc ; |
| </pre> |
| <p> |
| You might want to add dependency from Boost.Build package to gcc, |
| to make sure that users can always build Boost.Build examples. |
| </p> |
| </li> |
| </ul></div> |
| <p> |
| </p> |
| <p>If those guidelines are met, users will be able to invoke |
| <span class="command"><strong>bjam</strong></span> without any explicit configuration. |
| </p> |
| <div class="footnotes"> |
| <br><hr width="100" align="left"> |
| <div class="footnote"><p><sup>[<a name="ftn.id3264173" href="#id3264173" class="para">9</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.id3264206" href="#id3264206" class="para">10</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 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> |
| <td align="left"></td> |
| <td align="right"><div class="copyright-footer">Copyright © 2006-2009 Vladimir Prus<p>Distributed under the Boost Software License, Version 1.0. |
| (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at |
| <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) |
| </p> |
| </div></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <a accesskey="p" href="../bbv2.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../bbv2.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> |
| </div> |
| </body> |
| </html> |