Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Building BJam 構建 BJam

Installing BJam after building it is simply a matter of copying the generated executables someplace in your PATH. For building the executables there are a set of build bootstrap scripts to accomodate particular environments. The scripts take one optional argument, the name of the toolset to build with. When the toolset is not given an attempt is made to detect an available toolset and use that. The build scripts accept these arguments:
在構建 BJam 完成後的安裝,只需將生成的可執行程序複製到你的 PATH 中的某個目錄中即可。而對於可執行程序的構建,則有一組 build bootstrap 腳本來適應特定的環境。這些腳本帶有一個選項參數,即要構建的工具集的名字。如果沒有給定工具集,則會嘗試檢測可用的工具集並使用它。構建腳本接受如下參數:

build [toolset]

Running the scripts without arguments will give you the best chance of success. On Windows platforms from a command console do:
不帶參數地運行該腳本將最有機會成功。在 Windows 平台上,從一個命令控制台執行:

cd jam source location
.\build.bat

On Unix type platforms do:
在 Unix 類型的平台上,則執行:

cd jam source location
sh ./build.sh

For the Boost.Jam source included with the Boost distribution the jam source location is BOOST_ROOT/tools/jam/src.
對於 Boost 發佈包所帶的 Boost.Jam 源代碼,jam 源碼的位置BOOST_ROOT/tools/jam/src

If the scripts fail to detect an appropriate toolset to build with your particular toolset may not be auto-detectable. In that case, you can specify the toolset as the first argument, this assumes that the toolset is readily available in the PATH.
如果該腳本無法檢測到合適的工具集來構建,可能你的特定工具集不能被自動檢測到。這種情況下,你可以以第一參數指定該工具集,它假設廖工具集已經在 PATH 中。

[Note] Note 說明

The toolset used to build Boost.Jam is independent of the toolsets used for Boost.Build. Only one version of Boost.Jam is needed to use Boost.Build.

用於構建 Boost.Jam 的工具集與用於 Boost.Build 的工具集是無關的。只有一個版本的 Boost.Jam 需要使用 Boost.Build。

The supported toolsets, and wether they are auto-detected, are:
以下是可支持的工具集,以及是否可自動檢測:

Table 27.1. Supported Toolsets
表 27.1. 可支持的工具集

Script 腳本

Platform 平台

Toolset 工具集

Detection and Notes 檢測與說明

build.bat

Windows NT, 2000, and XP

borland
Borland C++Builder (BCC 5.5)

  • Common install location: "C:\Borland\BCC55"
    常見的安裝位置:"C:\Borland\BCC55"
  • BCC32.EXE in PATH

como
Comeau Computing C/C++

gcc
GNU GCC

gcc-nocygwin
GNU GCC

intel-win32
Intel C++ Compiler for Windows

  • ICL.EXE in PATH

metrowerks
MetroWerks CodeWarrior C/C++ 7.x, 8.x, 9.x

  • CWFolder variable configured
    CWFolder 變量已配置
  • MWCC.EXE in PATH

mingw
GNU GCC as the MinGW configuration

  • Common install location: "C:\MinGW"
    常見的安裝位置:"C:\MinGW"

msvc
Microsoft Visual C++ 6.x

  • VCVARS32.BAT already configured
    VCVARS32.BAT 已配置
  • %MSVCDir% is present in environment
    %MSVCDir% 在環境變量中
  • Common install locations: "%ProgramFiles%\Microsoft Visual Studio", "%ProgramFiles%\Microsoft Visual C++"
    常見的安裝位置:"%ProgramFiles%\Microsoft Visual Studio", "%ProgramFiles%\Microsoft Visual C++"
  • CL.EXE in PATH

vc7
Microsoft Visual C++ 7.x

  • VCVARS32.BAT or VSVARS32.BAT already configured
    VCVARS32.BATVSVARS32.BAT 已配置
  • %VS71COMNTOOLS% is present in environment
    %VS71COMNTOOLS% 已在環境變量中
  • %VCINSTALLDIR% is present in environment
    %VCINSTALLDIR% 已在環境變量中
  • Common install locations: "%ProgramFiles%\Microsoft Visual Studio .NET", "%ProgramFiles%\Microsoft Visual Studio .NET 2003"
    常見的安裝位置:"%ProgramFiles%\Microsoft Visual Studio .NET", "%ProgramFiles%\Microsoft Visual Studio .NET 2003"
  • CL.EXE in PATH

vc8 and vc9
Microsoft Visual C++ 8.x and 9.x

Detection: 

檢測:

  • VCVARSALL.BAT already configured
    VCVARSALL.BAT 已配置
  • %VS90COMNTOOLS% is present in environment
    %VS90COMNTOOLS% 已在環境變量中
  • Common install location: "%ProgramFiles%\Microsoft Visual Studio 9"
    常見的安裝位置:"%ProgramFiles%\Microsoft Visual Studio 9"
  • %VS80COMNTOOLS% is present in environment
    %VS80COMNTOOLS% 已在環境變量中
  • Common install location: "%ProgramFiles%\Microsoft Visual Studio 8"
    常見的安裝位置:"%ProgramFiles%\Microsoft Visual Studio 8"
  • CL.EXE in PATH

Notes:
說明:

  • If VCVARSALL.BAT is called to set up the toolset, it is passed all the extra arguments, see below for what those arguments are. This can be used to build, for example, a Win64 specific version of bjam. Consult the VisualStudio documentation for what the possible argument values to the VCVARSALL.BAT are.
    如果調用 VCVARSALL.BAT 來設置工具集,需要傳入所有額外參數,需要哪些參數請見下文。例如,這可以用於構建一個 Win64 特殊版本的 bjam。有哪些參數值可用於 VCVARSALL.BAT ,請參考 VisualStudio 文檔。

build.sh

Unix, Linux, Cygwin, etc.

acc
HP-UX aCC

  • aCC in PATH
  • uname is "HP-UX"

como
Comeau Computing C/C++

  • como in PATH

gcc
GNU GCC

  • gcc in PATH

intel-linux
Intel C++ for Linux

  • icc in PATH
  • Common install locations: "/opt/intel/cc/9.0", "/opt/intel_cc_80", "/opt/intel/compiler70", "/opt/intel/compiler60", "/opt/intel/compiler50"
    常見的安裝位置:"/opt/intel/cc/9.0", "/opt/intel_cc_80", "/opt/intel/compiler70", "/opt/intel/compiler60", "/opt/intel/compiler50"

kcc
Intel KAI C++

  • KCC in PATH

kylix
Borland C++Builder

  • bc++ in PATH

mipspro
SGI MIPSpro C

  • uname is "IRIX" or "IRIX64"

sunpro
Sun Workshop 6 C++

  • Standard install location: "/opt/SUNWspro"
    標準的安裝位置:"/opt/SUNWspro"

qcc
QNX Neutrino

  • uname is "QNX" and qcc in PATH

true64cxx
Compaq C++ Compiler for True64 UNIX

  • uname is "OSF1"

vacpp
IBM VisualAge C++

  • xlc in PATH

MacOS X

darwin
Apple MacOS X GCC

  • uname is "Darwin"

 

Windows NT, 2000, and XP

mingw
GNU GCC as the MinGW configuration with the MSYS shell

  • Common install location: "/mingw"
    常見的安裝位置:"/mingw"


The built executables are placed in a subdirectory specific to your platform. For example, in Linux running on an Intel x86 compatible chip, the executables are placed in: "bin.linuxx86". The bjam[.exe] executable can be used to invoke Boost.Build.
構建好的可執行文件被置於一個由平台決定的子目錄中。例如,在運行在 Intel x86 兼容芯片上的 Linux 中,可執行文件被置於:"bin.linuxx86"。bjam[.exe] 可用於調用 Boost.Build。

The build scripts support additional invocation arguments for use by developers of Boost.Jam and for additional setup of the toolset. The extra arguments come after the toolset:
build 腳本支持其它的參數,可用於 Boost.Jam 的開發者和對工具集的額外設置。以下參數跟在工具集的後面:

build [toolset] [setup*] [--option+ target*]

The arguments immediately after the toolset are passed directly to the setup script of the toolset, if available and if it needs to be invoked. This allows one to configure the toolset ass needed to do non-default builds of bjam. For example to build a Win64 version with vc8. See the toolset descriptiona above for when particular toolsets support this.
緊跟在工具集之後的參數,被直接傳遞給工具集的配置腳本,如果配置腳本可用且需要被調用。這可以讓你在需要進行 bjam 的非缺省構建時對工具集進行配置。例如,在使用 vc8 構建一個 Win64 版本時。有關特定工具集何時支持此選項,請查看前文的工具集說明。

The arguments starting with the "--option" forms are passed to the build.jam script and are used to further customize what gets built. Options and targets supported by the build.jam script:
從 "--option" 格式開始的參數被傳遞給 build.jam 腳本,用於對構建物進行進一步的定制。選項和目標都可以通過 build.jam 腳本來支持:

---

Empty option when one wants to only specify a target.
當你只想指定目標時的空選項

--release

The default, builds the optimized executable.
缺省值,構建優化的可執行文件

--debug

Builds debugging versions of the executable. When built they are placed in their own directory "bin./platform/.debug".
構建調試版本的可執行文件。在構建結束時它們被置於自身的目錄 "bin./platform/.debug" 下。

--grammar

Normally the Jam language grammar parsing files are not regenerated. This forces building of the grammar, although it may not force the regeneration of the grammar parser. If the parser is out of date it will be regenerated and subsequently built.
正常來說 Jam 語言的語法分析文件不用重新生成。這將迫使語法的構建,雖然它可能不會迫使重新生成語法分析器。如果分析器過期了,則會被重新生成並構建。

--with-python=path

Enables Python integration, given a path to the Python libraries.
打開 Python 集成,給定至 Python 庫的路徑。

--gc

Enables use of the Boehm Garbage Collector. The build will look for the Boehm-GC source in a "boehm_gc" subdirectory from the bjam sources.
打開對 Boehm 垃圾收集器的使用。build 將從 bjam 源碼的 "boehm_gc" 子目錄中查找 Boehm-GC 源碼。

--duma

Enables use of the DUMA (Detect Uintended Memory Access) debugging memory allocator. The build expects to find the DUMA source files in a "duma" subdirectory from the bjam sources.
打開對 DUMA 可調試內存分配器的使用。build 從 bjam 源碼的 "duma" 子目錄中查找 DUMA 源文件。

--toolset-root=path

Indicates where the toolset used to build is located. This option is passed in by the bootstrap (build.bat or build.sh) script.
表示用於構建的工具集位於何處。該選項由 bootstrap (build.batbuild.sh) 腳本傳入。

--show-locate-target

For information, prints out where it will put the built executable.
用於信息顯示,顯示將構建好的可執行文件置於何處。

--noassert

Disable debug assertions, even if building the debug version of the executable.
關閉調試斷言,即使是構建可執行文件的調試版本。

dist

Generate packages (compressed archives) as appropriate for distribution in the platform, if possible.
如果可能,生成適合於該平台的發行包(壓縮存檔)。

clean

Remove all the built executables and objects.
刪除所有已構建的可執行文件和對象。


PrevUpHomeNext