• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[/
2    Copyright 2013-2018 Daniel James
3
4    Distributed under the Boost Software License, Version 1.0.
5    (See accompanying file LICENSE_1_0.txt or copy at
6    http://www.boost.org/LICENSE_1_0.txt)
7]
8
9[chapter Installing Boostbook and Quickbook
10[id boost_doc_tools.install]
11[quickbook 1.5]
12[source-mode teletype]
13]
14
15[section:intro Introduction]
16
17This chapter describes how to install the basic documentation tools that make
18up the Boost documentation toolchain. This isn't enough for building the full
19Boost documentation, but it's enough to start using quickbook or boostbook.
20The basic requirements are:
21
22* Boost Build
23* `xsltproc`, which is a part of [@http://xmlsoft.org/XSLT/ `libxslt`].
24* [@http://docbook.sourceforge.net/ Norman Walsh's DocBook XSL
25  stylesheets] - Note that sourceforge has organized these files so that
26  the documentation for the stylesheets is the first set of files
27  offered for download; you have to look farther down for the actual
28  stylesheets.
29* [@http://www.oasis-open.org/docbook/xml/4.2/ The DocBook DTD]
30
31Installing all of these parts can be quite tricky, so the next section
32contains recipes to set them up for [link install_windows Windows],
33[link install_mac OS X], [link install_debian Debian and Ubuntu].
34Other configurations are of course possible, but we've found these ones
35effective.
36
37They assume that you have already installed Boost.Build and are familiar with
38the basics of using it, see [@boost:/more/getting_started/index.html the
39getting started guide] for an introduction. It's generally a good idea to
40install Boost.Build from source, the prebuilt packages are often out of date.
41
42[endsect]
43
44[section:recipes Installation Recipes]
45
46[#install_windows]
47[section:windows Windows]
48
49Since most of these command line tools were developed for Unix, and Unix style,
50platforms they are an awkward fit for windows and recipes requires more effort.
51This leads to two possible techniques, firstly install with cygwin which
52handles much of the complexity for you, but requires that you always use it
53from within Cygwin. The other is to manually install the toolchain for use from
54the windows command prompt. This gives a more integrated user experience but is
55quite fiddly to get right.
56
57[section:cygwin Cygwin Install]
58
59These instruction assume that cygwin has been installed to [^c:\\cygwin].
60
61Install these packages:
62
63* [^ Libs/libxml2]
64* [^ Libs/libxslt]
65* [^ Text/docbook-xml42]
66* [^ Text/docbook-xsl]
67* [^ Devel/gcc4-g++] (optional, if you don't have a compiler).
68* [^ Devel/doxygen] (optional, for generating reference documentation
69  from C++ source files).
70
71Now we need to configure Boost.Build to use these tools. This step is different
72depending on whether you're using Boost.Build built with cygwin, or for native
73windows. For cygwin you need to add to your `user-config.jam` file:
74
75    using xsltproc ;
76
77    using boostbook
78        : /usr/share/docbook-xsl
79        : /usr/share/xml/docbook/4.2
80        ;
81
82    using quickbook ;
83
84    # If you installed doxygen:
85    using doxygen ;
86
87When using a native (non-Cygwin) Boost.Build, you'll need to specify the
88windows paths to the various tools:
89
90    # Adjust this path to the location of your cygwin install.
91    CYGWIN_DIR = c:/cygwin ;
92
93    using xsltproc
94        : $(CYGWIN_DIR)/bin/xsltproc.exe ;
95
96    using boostbook
97        : $(CYGWIN_DIR)/usr/share/docbook-xsl
98        : $(CYGWIN_DIR)/usr/share/xml/docbook/4.2
99        ;
100
101    using quickbook ;
102
103    # If you installed doxygen:
104    using doxygen
105        : $(CYGWIN_DIR)/bin/doxygen.exe
106        ;
107
108[endsect] [/ cygwin ]
109
110[section:manual Manually installing windows native tools]
111
112In order to install the tools under windows, we need to create a directory
113structure somewhat similar to the unix filesystem. We're going to place this
114in [^c:\\boost-tools], if you want to put it elsewhere, just follow the
115instructions, adjusting the paths accordingly. This is also a good location
116to use as the prefix when installing Boost.Build.
117
118* Create directory for boost tools, say [^ c:\\boost-tools].
119* Create directory for binaries, [^ c:\\boost-tools\\bin].
120* Add the [^bin] directory to the path (e.g. in Xp, right click on 'My
121  Computer', click on 'Properties', then the 'Advanced' tab and click on
122  'Environment variables' to open a dialog where you can edit the PATH
123  variable).
124
125Next you need to download several xml tools from
126[@http://www.zlatkovic.com/pub/libxml/ Igor Zlatkovic].
127You require: [^ iconv], [^ libxml2] and [^ libxslt], [^ zlib].
128Then unzip these into the [^c:\\boost-tools] directory.
129This should place the `xsltproc` exectuable in [^c:\\boost-tools\\bin].
130
131Next make a directory for xml processing files at [^ c:\\boost-tools\\xml].
132
133* [@http://docbook.sourceforge.net/ Norman Walsh's DocBook XSL
134  stylesheets] from their
135  [@http://sourceforge.net/project/showfiles.php?group_id=21935&
136  package_id=16608 Sourceforge download page] to
137  [^ c:\\boost-tools\\xml\\docbook-xsl].
138* [@http://www.oasis-open.org/docbook/xml/4.2/ The DocBook DTD] to
139  [^ c:\\boost-tools\\xml\\docbook-xml].
140
141[^ user-config.jam] in the boost build search path,
142for most people this will be [^ C:\\Documents and Settings\\['username]].
143
144    BOOST_TOOLS_DIR = c:/boost-tools ;
145    using xsltproc
146        : $(BOOST_TOOLS_DIR)/bin/xsltproc.exe"
147        ;
148
149    using boostbook
150        : $(BOOST_TOOLS_DIR)/xml/docbook-xsl
151        : $(BOOST_TOOLS_DIR)/xml/docbook-xml
152        ;
153
154    using quickbook ;
155
156Also, if you wish to use doxygen to generate reference documentation from
157C++ source headers, you'll need to install it. You can download it from
158[@http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc the doxygen
159website]. The installer should add the executable to your path, so you just
160need to add to your [^ user-config.jam]:
161
162    using doxygen ;
163
164[endsect] [/ manual ]
165
166[endsect] [/ windows ]
167
168[#install_mac]
169[section:mac OS X]
170
171If you're using Snow Leopard (OS X 10.6) or later, then you should already have
172the xml tools installed, so you just need to install the docbook xml and xslt
173files.  The easiest way to do that is probably to use macports, install them
174with:
175
176    sudo port install docbook-xml-4.2 docbook-xsl
177
178For earlier versions of OS X, you'll also need to install `libxslt` to get
179an up to date version of `xsltproc`:
180
181    sudo port install libxslt docbook-xml-4.2 docbook-xsl
182
183You can also install `doxygen`, for generating reference documentation from
184C++ source files:
185
186    sudo port install doxygen
187
188Boost.Build knows the default install location for macports, so all you need
189to add to your `user-config.jam` is an instruction to use them:
190
191    using boostbook ;
192    using quickbook ;
193
194    # If you've installed doxygen:
195    using doxygen ;
196
197[endsect] [/ mac]
198
199[#install_debian]
200[section:debian Debian and Ubuntu]
201
202Installing on Debian and Ubuntu is pretty easy, just install the packages using
203`apt-get` (or an alternative, such as `aptitude`):
204
205    sudo apt-get install xsltproc docbook-xsl docbook-xml
206
207You can also install `doxygen`, for generating reference documentation from
208C++ source files:
209
210    sudo apt-get install doxygen
211
212Boost.Build should be to find these packages without an explicit path, so just
213add to your `user-config.jam`:
214
215    using boostbook ;
216    using quickbook ;
217
218    # If you've installed doxygen:
219    using doxygen ;
220
221[endsect] [/ debian]
222
223[endsect]
224
225[section:quickbook Pre-build quickbook]
226
227Boost.Build automatically builds Quickbook when required to build the
228documentation, but as it
229takes a little while to build you might prefer to build it in advance.
230To do this, in the command line type (replacing [^$BOOST_ROOT] with the
231root directory of boost):
232
233    cd $BOOST_ROOT/tools/quickbook
234    b2 dist-bin
235
236Or for windows:
237
238    cd $BOOST_ROOT\\tools\\quickbook
239    b2 dist-bin
240
241Change [^ using quickbook] in [^ user-config.jam] to (replacing [^
242$BOOST_ROOT] with the root directory of boost, as before):
243
244    using quickbook : $BOOST_ROOT/dist/bin/quickbook ;
245
246Windows:
247
248    using quickbook : $BOOST_ROOT\\dist\\bin\\quickbook ;
249
250[endsect] [/quickbook]
251