Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Installation and configuration 安裝與配置

Mac OS X
Windows 2000, XP, 2003, Vista
Debian, Ubuntu

This section provides some guidelines on how to install and configure BoostBook and Quickbook under several operating systems.
這一節提供有關在多個操作系統下如何安裝和配置 BoostBook 及 Quickbook 的指引。

Before continuing, it is very important that you keep this in mind: if you try to build some documents and the process breaks due to misconfiguration, be absolutely sure to delete any bin and bin.v2 directories generated by the build before trying again. Otherwise your configuration fixes will not take any effect.
在繼續之前,很重要的一點是,你要記住:如果你嘗試構建一些文檔且構建過程由於配置錯誤而中斷,在重試之前要絕對確保刪掉所有由構建生成的 binbin.v2 目錄。否則你的配置修改不會有任何效果。

Section contributed by Julio M. Merino Vidal
本節由 Julio M. Merino Vidal 貢獻

The following instructions explain how to install Docbook XML, Docbook XSL and Doxygen in a Mac OS X system, how to configure Boost.Build v2 to recognize them and how to build and install Quickbook. They were taken from a 10.4 (Tiger) machine so it is likely that they also apply to future versions; they may not work with older ones, though.
以下說明解釋了如何在 Mac OS X 系統中安裝 Docbook XML, Docbook XSL 和 Doxygen,如果配置 Boost.Build v2 以識別到它們,以及如何構建和安裝 Quickbook。以下說明來自一台 10.4 (Tiger) 機器,很可能也適用於以後的版本;不過它們不適用於舊版本。

The text below assumes you want to install all the necessary utilities in a system-wide location, allowing any user in the machine to have access to them. Therefore, all files will be put in the /usr/local hierarchy. If you do not want this, you can choose any other prefix such as ~/Applications for a single-user installation.
以下文字假定你想將所有需要的工具安裝在一個系統範圍的位置,允許機器中的所有用戶訪問它們。因此,所有文件都被放在 /usr/local 下。如果你不想這樣,可以為單用戶安裝選擇其它前綴,如 ~/Applications。 

Mac OS X comes with xsltproc and all related libraries preinstalled, so you do not need to take any extra steps to set them up. It is probable that future versions will include them too, but these instructions may not apply to older versions.
Mac OS X 本身帶有 xsltproc 且所有相關庫都已預安裝,因此你不需要額外的步驟來設置它們。很可能以後的版本也都會包含它們,但是這些指令不適用於舊版本。

To get started:
開始:

  1. Download Docbook XML 4.2 and unpack it inside /usr/local/share/xml/docbook/4.2.
    下載 Docbook XML 4.2,並把它解壓到 /usr/local/share/xml/docbook/4.2.
  2. Download the latest Docbook XSL version and unpack it. Put the results in /usr/local/share/xsl/docbook, thus effectively removing the version number from the directory name (for simplicity).
    下載最新版本的 Docbook XSL 並解壓。將結果放在 /usr/local/share/xsl/docbook,從而有效地從目錄名中去掉版本號(為簡單起見)。
  3. Add the following to your user-config.jam file, which should live in your home directory (/Users/<your_username>). You must already have it somewhere or otherwise you could not be building Boost (i.e. missing tools configuration).
    將以下文本增加到你的 user-config.jam 文件中,該文件應位於你的主目錄(/Users/<your_username>)。你必須完成這一工作,否則你無法構建 Boost (無工具配置)。
using xsltproc ;

using boostbook
    : "/usr/local/share/xsl/docbook"
    : "/usr/local/share/xml/docbook/4.2"
    ;

The above steps are enough to get a functional BoostBook setup. Quickbook will be automatically built when needed. If you want to avoid these rebuilds and install a system-wide Quickbook instead:
以上步驟已經可以獲得一個有效的 BoostBook 設置。Quickbook 將在有需要時進行自動構建。如果你想避免這些重構建,或代之以一個系統範圍的 Quickbook,則:

  1. Go to Quickbook's source directory (BOOST_ROOT/tools/quickbook).
    轉至 Quickbook 的源目錄(BOOST_ROOT/tools/quickbook)。
  2. Build the utility by issuing bjam --v2.
    執行 bjam --v2 構建該工具。
  3. Copy the resulting quickbook binary (located under the BOOST_ROOT/bin.v2 hierarchy) to a safe place. Following our previous example, you can install it into: /usr/local/bin.
    將得到的 quickbook 二進制文件(位於 BOOST_ROOT/bin.v2 下)複製到一個安全的位置。按我們前面的例子,你可以將它安裝到 /usr/local/bin.
  4. Add the following to your user-config.jam file:
    將以下文本增加到你的 user-config.jam 文件中:
using quickbook
    : "/usr/local/bin/quickbook" ;
    ;

Additionally, if you need to build documentation that uses Doxygen, you will need to install it too:
另外,如果你需要構建使用 Doxygen 的文檔,你還要安裝它:

  1. Go to the downloads section and get the disk image (dmg file) for Mac OS X.
    downloads section 獲取用於 Mac OS X 的磁盤映像(dmg 文件)。
  2. Open the disk image and drag the Doxygen application to your Applications folder to install it.
    打開磁盤映像並將 Doxygen 應用程序拖到你的 Applications 文件夾中進行安裝。
  3. Add the following to your user-config.jam file:
    將以下文本增加到你的 user-config.jam 文件中:
using doxygen
    : /Applications/Doxygen.app/Contents/Resources/doxygen
    ;

Alternatively, you may want to install all the prerequistes through a package system to avoid manual management of the installations. In that case, check out pkgsrc.
或者,你可能想通過一個包系統來安裝所有的東西,以避免對安裝進行手工管理。這種情況下,請檢出 pkgsrc

Section contributed by Julio M. Merino Vidal
本節由 Julio M. Merino Vidal 貢獻

The following instructions apply to any Windows system based on Windows 2000, including Windows XP, Windows 2003 Server and Windows Vista. The paths shown below are taken from a Windows Vista machine; you will need to adjust them to match your system in case you are running an older version.
以 下說明適用於任何基於 Windows 2000 的 Windows 系統,包括 Windows XP, Windows 2003 Server 和 Windows Vista。以下所示的路徑來自於一台 Windows Vista 機器;如果你使用的是舊版本,那麼你可能需要對它們進行調整以符合你的系統。

  1. First of all you need to have a copy of xsltproc for Windows. There are many ways to get this tool, but to keep things simple, use the binary packages made by Igor Zlatkovic. At the very least, you need to download the following packages: iconv, zlib, libxml2 and libxslt.
    首先你需要有一個用於 Windows 的 xsltproc 拷貝。有多種方法可以獲得該工具,不過簡單起見,請使用由 Igor Zlatkovic 製作的 二進制包。還有一點,你需要下載以下包:iconv, zlib, libxml2libxslt.
  2. Unpack all these packages in the same directory so that you get unique bin, include and lib directories within the hierarchy. These instructions use C:\Users\example\Documents\boost\xml as the root for all files.
    將所有包解壓到同一個目錄下,這樣你可以得到唯一的 bin, includelib 目錄層次。這些指令以 C:\Users\example\Documents\boost\xml 作為所有文件的根目錄。
  3. From the command line, go to the bin directory and launch xsltproc.exe to ensure it works. You should get usage information on screen.
    從命令行中進入 bin 目錄,執行 xsltproc.exe 並確認它正常工作。你可以從屏幕上得到使用信息。
  4. Download Docbook XML 4.2 and unpack it in the same directory used above. That is: C:\Users\example\Documents\boost\xml\docbook-xml.
    下載 Docbook XML 4.2 並將它解壓到上述目錄中。即:C:\Users\example\Documents\boost\xml\docbook-xml.
  5. Download the latest Docbook XSL version and unpack it, again in the same directory used before. To make things easier, rename the directory created during the extraction to docbook-xsl (bypassing the version name): C:\Users\example\Documents\boost\xml\docbook-xsl.
    下載最新版本的 Docbook XSL 並解壓,還是在同一個目錄中。為簡單起見,在解壓時將創建的目錄更名為 docbook-xsl (忽略版本號): C:\Users\example\Documents\boost\xml\docbook-xsl.
  6. Add the following to your user-config.jam file, which should live in your home directory (%HOMEDRIVE%%HOMEPATH%). You must already have it somewhere or otherwise you could not be building Boost (i.e. missing tools configuration).
    將以下文本增加以你的 user-config.jam 文件中,該文件應位於你的主目錄(%HOMEDRIVE%%HOMEPATH%)。你必須完成這一工作,否則你無法構建 Boost (無工具配置)。
using xsltproc
    : "C:/Users/example/Documents/boost/xml/bin/xsltproc.exe"
    ;

using boostbook
    : "C:/Users/example/Documents/boost/xml/docbook-xsl"
    : "C:/Users/example/Documents/boost/xml/docbook-xml"
    ;

The above steps are enough to get a functional BoostBook setup. Quickbook will be automatically built when needed. If you want to avoid these rebuilds:
以上步驟已經可以獲得一個有效的 BoostBook 設置。Quickbook 將在有需要時進行自動構建。如果你想避免這些重構建,則:

  1. Go to Quickbook's source directory (BOOST_ROOT\tools\quickbook).
    轉到 Quickbook 的源目錄(BOOST_ROOT\tools\quickbook).
  2. Build the utility by issuing bjam --v2.
    執行 bjam --v2 構建該工具。
  3. Copy the resulting quickbook.exe binary (located under the BOOST_ROOT\bin.v2 hierarchy) to a safe place. Following our previous example, you can install it into: C:\Users\example\Documents\boost\xml\bin.
    將得到的 quickbook.exe 二進制文件(位於 BOOST_ROOT\bin.v2 下)複製到一個安全的位置。按我們前面的例子,你可以將它安裝到: C:\Users\example\Documents\boost\xml\bin.
  4. Add the following to your user-config.jam file:
    將以下文本增加到你的 user-config.jam 文件中:
using quickbook
    : "C:/Users/example/Documents/boost/xml/bin/quickbook.exe"
    ;

The following instructions apply to Debian and its derivatives. They are based on a Ubuntu Edgy install but should work on other Debian based systems.
以下說明適用於 Debian 及其衍生系統。它們基於一個 Ubuntu Edgy 安裝,不過也可用於其它基於 Debian 的系統。

First install the bjam, xsltproc, docbook-xsl and docbook-xml packages. For example, using apt-get:
首先安裝 bjam, xsltproc, docbook-xsldocbook-xml 包。例如,使用 apt-get:

sudo apt-get install xsltproc docbook-xsl docbook-xml

If you're planning on building boost's documentation, you'll also need to install the doxygen package as well.
如果你計劃構建 boost 的文檔,你還需要安裝 doxygen 包。

Next, we need to configure Boost Build to compile BoostBook files. Add the following to your user-config.jam file, which should be in your home directory. If you don't have one, create a file containing this text. For more information on setting up user-config.jam, see the Boost Build documentation.
接著,我們需要配置 Boost Build 以編譯 BoostBook 文件。將以下文本增加到你的 user-config.jam 文件中,該文件應位於你的主目錄中。如果沒有這個文件,則創建一個包含以下文本的文件。有關設置 user-config.jam 的更多信息,請見 Boost Build 文檔

using xsltproc ;

using boostbook
    : /usr/share/xml/docbook/stylesheet/nwalsh
    : /usr/share/xml/docbook/schema/dtd/4.2
    ;

# Remove this line if you're not using doxygen
using doxygen ;

The above steps are enough to get a functional BoostBook setup. Quickbook will be automatically built when needed. If you want to avoid these rebuilds:
以上步驟已經可以獲得一個有效的 BoostBook 設置。Quickbook 將在有需要時進行自動構建。如果你想避免這些重構建,則:

  1. Go to Quickbook's source directory (BOOST_ROOT/tools/quickbook).
    轉到 Quickbook 的源目錄(BOOST_ROOT/tools/quickbook).
  2. Build the utility by issuing bjam --v2.
    執行 bjam --v2 構建該工具。
  3. Copy the resulting quickbook binary (located under the BOOST_ROOT/bin.v2 hierarchy) to a safe place. The traditional location is /usr/local/bin.
    將得到的 quickbook 二進制文件(位於 BOOST_ROOT/bin.v2 下)複製到一個安全的位置。按我們前面的例子,你可以將它安裝到 /usr/local/bin.
  4. Add the following to your user-config.jam file, using the full path of the quickbook executable:
    將以下文本增加到你的 user-config.jam 文件中,使用 quickbook 可執行文件的全路徑:
using quickbook
    : /usr/local/bin/quickbook
    ;

PrevUpHomeNext