1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <!DOCTYPE chapter PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" |
---|
3 | "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> |
---|
4 | |
---|
5 | <chapter id="bbv2.installation"> |
---|
6 | <title>Installation</title> |
---|
7 | |
---|
8 | <para> |
---|
9 | This section describes how to install Boost.Build from a |
---|
10 | released <ulink |
---|
11 | url="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041">Boost |
---|
12 | source distribution</ulink> |
---|
13 | or <ulink url="http://sourceforge.net/cvs/?group_id=7586">CVS |
---|
14 | image</ulink>. |
---|
15 | <footnote> |
---|
16 | <para>Note that packages prepared for |
---|
17 | Unix/Linux systems usually make their own choices about where to |
---|
18 | put things and even which parts of Boost to include. When we |
---|
19 | say “released source distribution” we mean a |
---|
20 | distribution of Boost as released on its SourceForge |
---|
21 | <ulink url="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041">project |
---|
22 | page</ulink>. |
---|
23 | </para> |
---|
24 | </footnote> |
---|
25 | All paths are given relative to |
---|
26 | the <firstterm>Boost.Build v2 root directory</firstterm>, which is |
---|
27 | |
---|
28 | <!-- the normal location of the document you are reading. |
---|
29 | Boost.Build is --> |
---|
30 | |
---|
31 | <!-- That is a lie AFAICT, at least in a Boost distro. You need |
---|
32 | to say something that will be true if you want to cover BBv2 as |
---|
33 | distributed separately --> |
---|
34 | |
---|
35 | located in the <filename>tools/build/v2</filename> subdirectory |
---|
36 | of a full Boost <ulink url="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041">distribution</ulink>. |
---|
37 | <footnote> |
---|
38 | <para>The Boost.Build subset of boost is also distributed |
---|
39 | separately, for those who are only interested in getting a |
---|
40 | build tool. The top-level directory of a <ulink |
---|
41 | url="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=80982">Boost.Build |
---|
42 | distribution</ulink> contains all the subdirectories of the |
---|
43 | <filename>tools/build/v2</filename> subdirectory from a full |
---|
44 | Boost distribution, so it is itself a valid Boost.Build root |
---|
45 | directory. It also contains the |
---|
46 | <filename>tools/build/jam_src</filename> subdirectory of a |
---|
47 | full Boost distribution, so you can rebuild Boost.Jam from |
---|
48 | source. |
---|
49 | </para> |
---|
50 | </footnote> |
---|
51 | </para> |
---|
52 | |
---|
53 | <orderedlist> |
---|
54 | <listitem> |
---|
55 | <simpara> |
---|
56 | Boost.Build uses <ulink |
---|
57 | url= "../../tools/build/jam_src/index.html">Boost.Jam</ulink>, an |
---|
58 | extension of the <ulink |
---|
59 | url="http://www.perforce.com/jam/jam.html">Perforce |
---|
60 | Jam</ulink> portable <command>make</command> replacement. The |
---|
61 | recommended way to get Boost.Jam is to <emphasis |
---|
62 | role="bold"><ulink |
---|
63 | url= "http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941">download |
---|
64 | a prebuilt executable</ulink></emphasis> from SourceForge. |
---|
65 | If a prebuilt executable is not provided for your platform |
---|
66 | or you are using Boost's sources in an unreleased state, it |
---|
67 | may be necessary to <ulink |
---|
68 | url= "../../tools/build/jam_src/index.html#building_bjam">build <command>bjam</command> |
---|
69 | from sources</ulink> included in the Boost source tree. |
---|
70 | </simpara> |
---|
71 | </listitem> |
---|
72 | |
---|
73 | <listitem> |
---|
74 | <para> |
---|
75 | |
---|
76 | To install Boost.Jam, copy the executable, |
---|
77 | called <command>bjam</command> |
---|
78 | or <command>bjam.exe</command> to a location accessible in |
---|
79 | your <envar>PATH</envar>. Go to the Boost.Build root |
---|
80 | directory and |
---|
81 | run <command>bjam <option>--version</option></command>. You |
---|
82 | should see: |
---|
83 | |
---|
84 | <screen> |
---|
85 | Boost.Build V2 (Milestone N) |
---|
86 | Boost.Jam xx.xx.xx |
---|
87 | </screen> |
---|
88 | |
---|
89 | where N is the version of Boost.Build you're using. |
---|
90 | </para> |
---|
91 | </listitem> |
---|
92 | |
---|
93 | <listitem> |
---|
94 | <simpara> |
---|
95 | Configure Boost.Build to recognize the build resources (such |
---|
96 | as compilers and libraries) you have installed on your |
---|
97 | system. Open the |
---|
98 | <filename>user-config.jam</filename> file in the Boost.Build |
---|
99 | root directory and follow the instructions there to describe |
---|
100 | your toolsets and libraries, and, if necessary, where they |
---|
101 | are located. |
---|
102 | </simpara> |
---|
103 | </listitem> |
---|
104 | |
---|
105 | <listitem> |
---|
106 | <simpara> |
---|
107 | You should now be able to go to the |
---|
108 | <filename>example/hello/</filename> directory and run |
---|
109 | <command>bjam</command> there. A simple application will be |
---|
110 | built. You can also play with other projects in the |
---|
111 | <filename>example/</filename> directory. |
---|
112 | <!-- This part should not go into intoduction docs, but we need to |
---|
113 | place it somewhere. |
---|
114 | |
---|
115 | <para>It is slighly better way is to copy |
---|
116 | <filename>new/user-config.jam</filename> into one of the locations |
---|
117 | where it can be found (given in <link linkend= |
---|
118 | "bbv2.reference.init.config">this table</link>). This prevent you |
---|
119 | from accidentally overwriting your config when updating.</para> |
---|
120 | |
---|
121 | --> |
---|
122 | </simpara> |
---|
123 | </listitem> |
---|
124 | </orderedlist> |
---|
125 | |
---|
126 | <para> |
---|
127 | If you are using Boost's CVS state, be sure to |
---|
128 | rebuild <command>bjam</command> even if you have a previous |
---|
129 | version. The CVS version of Boost.Build requires the CVS |
---|
130 | version of Boost.Jam. |
---|
131 | </para> |
---|
132 | |
---|
133 | <para> |
---|
134 | When <command>bjam</command> is invoked, it always needs to be |
---|
135 | able to find the Boost.Build root directory, where the |
---|
136 | interpreted source code of Boost.Build is located. There are |
---|
137 | two ways to tell <command>bjam</command> about the root directory: |
---|
138 | </para> |
---|
139 | |
---|
140 | <itemizedlist> |
---|
141 | <listitem> |
---|
142 | <simpara> |
---|
143 | Set the environment variable <envar>BOOST_BUILD_PATH</envar> |
---|
144 | to the absolute path of the Boost.Build root directory. |
---|
145 | </simpara> |
---|
146 | </listitem> |
---|
147 | |
---|
148 | <listitem> |
---|
149 | <para> |
---|
150 | At the root directory of your project or in any of its |
---|
151 | parent directories, create a file called |
---|
152 | <filename>boost-build.jam</filename>, with a single line: |
---|
153 | |
---|
154 | <programlisting> |
---|
155 | boost-build <replaceable>/path/to/boost.build</replaceable> ; |
---|
156 | </programlisting> |
---|
157 | |
---|
158 | </para> |
---|
159 | </listitem> |
---|
160 | </itemizedlist> |
---|
161 | |
---|
162 | <para><emphasis role="bold">N.B.</emphasis> |
---|
163 | When <command>bjam</command> is invoked from anywhere in the Boost |
---|
164 | directory tree <emphasis>other than</emphasis> the Boost.Build root |
---|
165 | and its subdirectories, <ulink url="../../tools/build/index.html">Boost.Build |
---|
166 | v1</ulink> is used by default. To override the default and use |
---|
167 | Boost.Build v2, you have to add the <option>--v2</option> command |
---|
168 | line option to all <command>bjam</command> invocations.</para> |
---|
169 | |
---|
170 | </chapter> |
---|