3
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4
<title>Getting Started</title>
5
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8
<link rel="up" href="../../boostbook.html" title="Chapter 36. The BoostBook Documentation Format">
9
<link rel="prev" href="../../boostbook.html" title="Chapter 36. The BoostBook Documentation Format">
10
<link rel="next" href="../documenting.html" title="Documenting libraries">
12
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13
<table cellpadding="2" width="100%"><tr>
14
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15
<td align="center"><a href="../../../../index.html">Home</a></td>
16
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19
<td align="center"><a href="../../../../more/index.htm">More</a></td>
22
<div class="spirit-nav">
23
<a accesskey="p" href="../../boostbook.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boostbook.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="../documenting.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
26
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
27
<a name="boostbook.getting.started"></a>Getting Started</h2></div></div></div>
29
<dt><span class="section"><a href="started.html#boostbook.setup.autounix">Automatic setup for Unix-like systems</a></span></dt>
30
<dt><span class="section"><a href="started.html#boostbook.setup.manual">Manual setup for all systems</a></span></dt>
31
<dt><span class="section"><a href="started.html#boostbook.setup.running">Running BoostBook</a></span></dt>
32
<dt><span class="section"><a href="started.html#boostbook.setup.troubleshooting">Troubleshooting</a></span></dt>
34
<p>To use the Boost documentation tools, you will need several tools:</p>
35
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
37
<p class="simpara"><span class="command"><strong>xsltproc</strong></span>:</p>
38
<div class="itemizedlist"><ul class="itemizedlist" type="circle">
39
<li class="listitem">Windows with <a href="http://www.cygwin.com/" target="_top">Cygwin</a>: select the libxml2 and libxslt packages.</li>
40
<li class="listitem">Windows without Cygwin: Download the <a href="http://www.zlatkovic.com/pub/libxml/" target="_top">binary packages</a>
41
from Igor Zlatkovic. At the very least, you'll need iconv, zlib, libxml2 and libxslt.</li>
42
<li class="listitem">Mac OS X with Fink: Get the <code class="computeroutput">libxslt</code> package.</li>
43
<li class="listitem">Mac OS X without Fink: <a href="http://www.zveno.com/open_source/libxml2xslt.html" target="_top">Download the libxslt binaries</a>
45
<li class="listitem">Any platform: <a href="http://xmlsoft.org/XSLT/" target="_top">libxslt source</a>.</li>
49
<p class="simpara"><span class="command"><strong>doxygen</strong></span>:</p> Available from <a href="http://www.doxygen.org" target="_top">http://www.doxygen.org</a>
53
<div class="titlepage"><div><div><h3 class="title">
54
<a name="boostbook.setup.autounix"></a>Automatic setup for Unix-like systems</h3></div></div></div>
55
<p>BoostBook provides a nearly-automatic setup script. Once
56
you have downloaded and
57
installed <span class="command"><strong>xsltproc</strong></span>, <span class="command"><strong>doxygen</strong></span>,
58
and (optionally) <span class="command"><strong>java</strong></span>, the setup script can
59
download the required DocBook stylesheets, DocBook DTD, and
60
(when Java is enabled) Apache FOP for PDF output. It will then
61
configure Boost.Build version 2 to build BoostBook
63
<p>The script requires: <span class="command"><strong>sh</strong></span>,
64
<span class="command"><strong>curl</strong></span> and <span class="command"><strong>gunzip</strong></span>.
65
To perform the installation, execute the
66
script <span class="command"><strong>tools/boostbook/setup_boostbook.sh</strong></span>
67
from a directory where you would like the resulting XSL, DTD,
68
and Apache FOP installations to occur. </p>
71
<div class="titlepage"><div><div><h3 class="title">
72
<a name="boostbook.setup.manual"></a>Manual setup for all systems</h3></div></div></div>
74
<dt><span class="section"><a href="started.html#boostbook.setup.xsltproc">Configuring <span class="command"><strong>xsltproc</strong></span></a></span></dt>
75
<dt><span class="section"><a href="started.html#boostbook.setup.docbook">Configuring local DocBook XSL and DTD distributions</a></span></dt>
76
<dt><span class="section"><a href="started.html#boostbook.setup.doxygen">Configuring Doxygen for Documentation Extraction</a></span></dt>
77
<dt><span class="section"><a href="started.html#boostbook.setup.fop">Configuring Apache FOP</a></span></dt>
79
<p>This section describes how to manually configure Boost
80
Boost version 2 (BBv@) for BoostBook. If you can use the
81
automatic setup script, you should. All configuration will
82
happen in the BBv2 user configuration file,
83
<code class="filename">user-config.jam</code>. If you do not have a copy
84
of this file in your home directory, you should copy the one
85
that resides in <code class="computeroutput">tools/build/v2</code> to your home
86
directory. Alternatively, you can edit
87
<code class="filename">tools/build/v2/user-config.jam</code> directly or
88
a site-wide <code class="filename">site-config.jam</code> file.</p>
90
<div class="titlepage"><div><div><h4 class="title">
91
<a name="boostbook.setup.xsltproc"></a>Configuring <span class="command"><strong>xsltproc</strong></span>
92
</h4></div></div></div>
93
<p>To configure <span class="command"><strong>xsltproc</strong></span> manually, you
94
will need to add a directive to
95
<code class="filename">user-config.jam</code> telling it where to find
96
<span class="command"><strong>xsltproc</strong></span>. If the program is in your path,
97
just add the following line to
98
<code class="filename">user-config.jam</code>:</p>
99
<pre class="programlisting">using xsltproc ;</pre>
100
<p>If <span class="command"><strong>xsltproc</strong></span> is somewhere else, use
101
this directive, where <code class="computeroutput">XSLTPROC</code> is the full
102
pathname to <span class="command"><strong>xsltproc</strong></span> (including
103
<span class="command"><strong>xsltproc</strong></span>):</p>
104
<pre class="programlisting">using xsltproc : XSLTPROC ;</pre>
106
<div class="section">
107
<div class="titlepage"><div><div><h4 class="title">
108
<a name="boostbook.setup.docbook"></a>Configuring local DocBook XSL and DTD distributions</h4></div></div></div>
109
<p>This section describes how to configure Boost.Build to
110
use local copies of the DocBook DTD and XSL stylesheets to
111
improve processing time. You will first need to download two
115
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
116
<li class="listitem"><p>Norman Walsh's DocBook XSL stylesheets,
117
available at the <a href="http://docbook.sourceforge.net" target="_top">DocBook sourceforge
118
site</a>. Extract the DocBook XSL stylesheets to a
119
directory on your hard disk (which we'll refer to as the
120
<code class="computeroutput">DOCBOOK_XSL_DIR</code>).</p></li>
121
<li class="listitem"><p>The DocBook DTD, available as a ZIP archive
122
at the <a href="http://www.oasis-open.org/docbook/xml/4.2/" target="_top">OASIS
123
DocBook site</a>. The package is called "DocBook XML
124
4.2". Extract the DocBook DTD to a directory on your hard
125
disk (which we'll refer to as the
126
<code class="computeroutput">DOCBOOK_DTD_DIR</code>). You will want to extract this
127
archive in a subdirectory!</p></li>
131
<p>Add the following directive telling BBv2 where to find
132
the DocBook DTD and XSL stylesheets:</p>
133
<pre class="programlisting"># BoostBook configuration
138
<p>Whenever you change this directive, you will need to
139
remove the <code class="computeroutput">bin.v2</code> directory that BBv2 generates.
140
This is due to longstanding bug we are trying to fix.</p>
141
<p>At this point, you should be able to build HTML
142
documentation for libraries that do not require Doxygen. To
143
test this, change into the directory <code class="filename">$BOOST_ROOT/libs/function/doc</code> and
144
run the command <code class="computeroutput">bjam</code>: it should produce HTML
145
documentation for the Boost.Function library in the
146
<code class="computeroutput">html</code> subdirectory.</p>
148
<div class="section">
149
<div class="titlepage"><div><div><h4 class="title">
150
<a name="boostbook.setup.doxygen"></a>Configuring Doxygen for Documentation Extraction</h4></div></div></div>
151
<p>Doxygen is required to build the documentation for
152
several Boost libraries. You will need a recent version of
153
<a href="http://www.doxygen.org" target="_top">Doxygen</a> (most of
154
the 1.3.x and 1.4.x versions will suffice). BBv2 by adding the
155
following directive to
156
<code class="filename">user-config.jam</code>:</p>
157
<pre class="programlisting">using doxygen : DOXYGEN ;</pre>
158
<p><code class="filename">DOXYGEN</code> should be replaced with the
159
name of the <span class="command"><strong>doxygen</strong></span> executable (with full
160
path name). If the right <span class="command"><strong>doxygen</strong></span> executable
161
can be found via the path, this parameter can be
163
<pre class="programlisting">using doxygen ;</pre>
164
<div class="important"><table border="0" summary="Important">
166
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../doc/src/images/important.png"></td>
167
<th align="left">Important</th>
169
<tr><td align="left" valign="top"><p>The relative order of declarations in
170
<code class="filename">user-config.jam</code> /
171
<code class="filename">site-config.jam</code> files is
172
significant. In particular, the <code class="literal">using
173
doxygen</code> line should come
174
<span class="emphasis"><em>after</em></span> the <code class="literal">using
175
boostbook</code> declaration.
179
<div class="section">
180
<div class="titlepage"><div><div><h4 class="title">
181
<a name="boostbook.setup.fop"></a>Configuring Apache FOP</h4></div></div></div>
182
<p>In order to generate PDF and PostScript output using
183
Apache FOP, you will need a <a href="http://java.sun.com" target="_top">Java interpreter</a> and <a href="http://xml.apache.org/fop/download.html" target="_top">Apache FOP</a>
184
(version 0.20.5 is best). Unpack Apache FOP to some
185
directory. The top level directory of the FOP tool should
186
contain a main script called <code class="filename">fop.sh</code> on Unix
187
and <code class="filename">fop.bat</code> on Windows. You need to specify
188
the location of that script and Java location to
189
Boost.Build. Add the following to your
190
<code class="filename">user-config.jam</code> or
191
<code class="filename">site-config.jam</code>:
193
<pre class="programlisting">
194
using fop : FOP_COMMAND
199
<code class="computeroutput">FOP_COMMAND</code> with the full path to the FOP main script, and
200
replacing <code class="computeroutput">JAVA_HOME</code> with the directory where Java is
201
installed. If the <code class="envar">JAVA_HOME</code> environment variable is
202
already set, you don't need to specify it above.
205
Proper generation of images in PDFs depends on the <a href="http://java.sun.com/products/jimi/#" target="_top">Jimi Image
206
Library</a>. To get FOP to use Jimi, extract the
207
<code class="filename">JimiProClasses.zip</code> file from the Jimi SDK
208
and rename it—if on Windows, to
209
<code class="filename">jimi-1.0.jar</code>, or if on *nix, to
210
<code class="filename">JimiProClasses.jar</code>—and place it in the
211
<code class="filename">lib/</code> subdirectory of your FOP
214
<p>To test PDF generation, switch to the directory <code class="filename">$BOOST_ROOT/libs/function/doc</code> and
215
execute the command <span class="command"><strong>bjam pdf</strong></span>. In the
216
absence of any errors, Apache FOP will be executed to transform
217
the XSL:FO output of DocBook into a PDF file.</p>
220
<div class="section">
221
<div class="titlepage"><div><div><h3 class="title">
222
<a name="boostbook.setup.running"></a>Running BoostBook</h3></div></div></div>
223
<p>Once BoostBook has been configured, we can build some
224
documentation. First, change to the directory
225
<code class="computeroutput">$BOOST_ROOT/doc</code> and remove (or make writable) the
226
<code class="computeroutput">.html</code> files in
227
<code class="computeroutput">$BOOST_ROOT/doc/html</code>. Then, run <code class="computeroutput">bjam</code>
228
to build HTML documentation. You should see several
229
warnings like these while DocBook documentation is being built
230
from BoostBook documentation:</p>
231
<pre class="programlisting">Cannot find function named 'checked_delete'
232
Cannot find function named 'checked_array_delete'
233
Cannot find function named 'next'</pre>
234
<p>These warnings are emitted when the Boost documentation
235
tools cannot find documentation for functions, methods, or classes
236
that are referenced in the source, and are not harmful in any
237
way. Once Boost.Jam has completed its execution, HTML
238
documentation for Boost will be available in
239
<code class="computeroutput">$BOOST_ROOT/doc/html</code>. You can also create HTML
240
documentation in a single (large!) HTML file with the command line
241
<code class="computeroutput">bjam onehtml</code>, or Unix man pages with the command
242
line <code class="computeroutput">bjam man</code>. The complete list of output
243
formats is listed in <a class="xref" href="started.html#boostbook.output.formats" title="Table 36.1. BoostBook Output Formats">Table 36.1, “BoostBook Output Formats”</a>. Several output formats can
244
be passed to a single invocation of <code class="computeroutput">bjam</code>, e.g.,
245
<code class="computeroutput">bjam html man docbook</code> would generate HTML
246
(multiple files), man pages, and DocBook documentation.</p>
248
<a name="boostbook.output.formats"></a><p class="title"><b>Table 36.1. BoostBook Output Formats</b></p>
249
<div class="table-contents"><table class="table" summary="BoostBook Output Formats">
261
<td><p>HTML output (multiple files). This is the default</p></td>
265
<td><p>HTML output in a single HTML file.</p></td>
269
<td><p>Unix man pages.</p></td>
273
<td><p>PDF. Requires <a href="http://xml.apache.org/fop/index.html" target="_top">Apache FOP</a>.</p></td>
277
<td><p>Postscript. Requires <a href="http://xml.apache.org/fop/index.html" target="_top">Apache FOP</a>.</p></td>
282
<a href="http://www.docbook.org/" target="_top">DocBook</a>.</td>
286
<td><a href="http://www.w3.org/TR/xsl/" target="_top">XSL Formatting Objects</a></td>
291
<br class="table-break">
293
<div class="section">
294
<div class="titlepage"><div><div><h3 class="title">
295
<a name="boostbook.setup.troubleshooting"></a>Troubleshooting</h3></div></div></div>
296
<p>The Boost documentation tools are still in their early phase of
297
development, and some things don't work as seamlessly as we would like
298
them to, yet. In particular, error messages can be somewhat
299
uninformative at times. If you find yourself in the situation when
300
you have double checked everything, and yet things still don't work as
301
expected, consider helping the tools by deleting
302
<code class="literal">bin.v2</code> build directory.
306
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
307
<td align="left"></td>
308
<td align="right"><div class="copyright-footer">Copyright © 2003-2005 Douglas Gregor<p>Distributed under the Boost Software License, Version 1.0.
309
(See accompanying file LICENSE_1_0.txt or copy at
310
<a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
315
<div class="spirit-nav">
316
<a accesskey="p" href="../../boostbook.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boostbook.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="../documenting.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>