1 # Copyright Vladimir Prus 2002-2006.
2 # Copyright Dave Abrahams 2005-2006.
3 # Copyright Rene Rivera 2005-2007.
4 # Copyright Douglas Gregor 2005.
6 # Distributed under the Boost Software License, Version 1.0.
7 # (See accompanying file LICENSE_1_0.txt or copy at
8 # http://www.boost.org/LICENSE_1_0.txt)
12 # bjam [options] [properties] [install|stage]
14 # Builds and installs Boost.
16 # Targets and Related Options:
18 # install Install headers and compiled library files to the
19 # ======= configured locations (below).
21 # --prefix=<PREFIX> Install architecture independent files here.
22 # Default; C:\Boost on Win32
23 # Default; /usr/local on Unix. Linux, etc.
25 # --exec-prefix=<EPREFIX> Install architecture dependent files here.
28 # --libdir=<DIR> Install library files here.
29 # Default; <EPREFIX>/lib
31 # --includedir=<HDRDIR> Install header files here.
32 # Default; <PREFIX>/include
34 # stage Build and install only compiled library files
35 # ===== to the stage directory.
37 # --stagedir=<STAGEDIR> Install library files here
42 # --build-type=<type> Build the specified pre-defined set of variations
43 # of the libraries. Note, that which variants get
44 # built depends on what each library supports.
46 # minimal (default) - Builds a minimal set of
47 # variants. On Windows, these are static
48 # multithreaded libraries in debug and release
49 # modes, using shared runtime. On Linux, these
50 # are static and shared multithreaded libraries
53 # complete - Build all possible variations.
55 # --build-dir=DIR Build in this location instead of building
56 # within the distribution tree. Recommended!
58 # --show-libraries Displays the list of Boost libraries that require
59 # build and installation steps, then exit.
61 # --layout=<layout> Determines whether to choose library names
62 # and header locations such that multiple
63 # versions of Boost or multiple compilers can
64 # be used on the same system.
66 # versioned - Names of boost binaries
67 # include the Boost version number, name and
68 # version of the compiler and encoded build
69 # properties. Boost headers are installed in a
70 # subdirectory of <HDRDIR> whose name contains
71 # the Boost version number.
73 # tagged -- Names of boost binaries include the
74 # encoded build properties such as variant and
75 # threading, but do not including compiler name
76 # and version, or Boost version. This option is
77 # useful if you build several variants of Boost,
78 # using the same compiler.
80 # system - Binaries names do not include the
81 # Boost version number or the name and version
82 # number of the compiler. Boost headers are
83 # installed directly into <HDRDIR>. This option
84 # is intended for system integrators who are
85 # building distribution packages.
87 # The default value is 'versioned' on Windows, and
90 # --buildid=ID Adds the specified ID to the name of built
91 # libraries. The default is to not add anything.
93 # --python-buildid=ID Adds the specified ID to the name of built
94 # libraries that depend on Python. The default
95 # is to not add anything. This ID is added in
96 # addition to --buildid.
99 # --help This message.
101 # --with-<library> Build and install the specified <library>
102 # If this option is used, only libraries
103 # specified using this option will be built.
105 # --without-<library> Do not build, stage, or install the specified
106 # <library>. By default, all libraries are built.
110 # toolset=toolset Indicates the toolset to build with.
112 # variant=debug|release Select the build variant
114 # link=static|shared Whether to build static or shared libraries
116 # threading=single|multi Whether to build single or multithreaded binaries
118 # runtime-link=static|shared
119 # Whether to link to static or shared C and C++ runtime.
123 # - handle boost version
124 # - handle python options such as pydebug
134 path-constant BOOST_ROOT : . ;
135 constant BOOST_VERSION : 1.51.0 ;
136 constant BOOST_JAMROOT_MODULE : $(__name__) ;
138 boostcpp.set-version $(BOOST_VERSION) ;
141 : requirements <include>.
142 # Disable auto-linking for all targets here, primarily because it caused
144 <define>BOOST_ALL_NO_LIB=1
145 # Used to encode variant in target name. See the 'tag' rule below.
146 <tag>@$(__name__).tag
147 <conditional>@handle-static-runtime
148 # The standard library Sun compilers use by default has no chance
149 # of working with Boost. Override it.
150 <toolset>sun:<stdlib>sun-stlport
151 # Comeau does not support shared lib
152 <toolset>como:<link>static
153 <toolset>como-linux:<define>_GNU_SOURCE=1
154 # When building docs within Boost, we want the standard Boost style
155 <xsl:param>boost.defaults=Boost
156 : usage-requirements <include>.
160 # This rule is called by Boost.Build to determine the name of target. We use it
161 # to encode the build variant, compiler name and boost version in the target
164 rule tag ( name : type ? : property-set )
166 return [ boostcpp.tag $(name) : $(type) : $(property-set) ] ;
169 rule handle-static-runtime ( properties * )
171 # Using static runtime with shared libraries is impossible on Linux,
172 # and dangerous on Windows. Therefore, we disallow it. This might
173 # be drastic, but it was disabled for a while with nobody complaining.
175 # For CW, static runtime is needed so that std::locale works.
176 if <link>shared in $(properties) && <runtime-link>static in $(properties) &&
177 ! ( <toolset>cw in $(properties) )
179 ECHO "error: link=shared together with runtime-link=static is not allowed" ;
180 ECHO "error: such property combination is either impossible " ;
181 ECHO "error: or too dangerious to be of any use" ;
186 all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
187 [ glob libs/*/build/Jamfile ] ]
190 all-libraries = [ sequence.unique $(all-libraries) ] ;
191 # The function_types library has a Jamfile, but it's used for maintenance
192 # purposes, there's no library to build and install.
193 all-libraries = [ set.difference $(all-libraries) : function_types ] ;
195 # Setup convenient aliases for all libraries.
197 local rule explicit-alias ( id : targets + )
199 alias $(id) : $(targets) ;
203 # First, the complicated libraries: where the target name in Jamfile is
204 # different from its directory name.
205 explicit-alias prg_exec_monitor : libs/test/build//boost_prg_exec_monitor ;
206 explicit-alias test_exec_monitor : libs/test/build//boost_test_exec_monitor ;
207 explicit-alias unit_test_framework : libs/test/build//boost_unit_test_framework ;
208 explicit-alias bgl-vis : libs/graps/build//bgl-vis ;
209 explicit-alias serialization : libs/serialization/build//boost_serialization ;
210 explicit-alias wserialization : libs/serialization/build//boost_wserialization ;
211 for local l in $(all-libraries)
213 if ! $(l) in test graph serialization
215 explicit-alias $(l) : libs/$(l)/build//boost_$(l) ;
219 alias headers : : : : <include>. ;
222 # Make project ids of all libraries known.
223 for local l in $(all-libraries)
225 use-project /boost/$(l) : libs/$(l)/build ;
228 # This rule should be called from libraries' Jamfiles and will create two
229 # targets, "install" and "stage", that will install or stage that library. The
230 # --prefix option is respected, but --with and --without options, naturally, are
233 # - libraries -- list of library targets to install.
235 rule boost-install ( libraries * )
237 package.install install
238 : <dependency>/boost//install-proper-headers $(install-requirements)
241 : # No headers, it is handled by the dependency.
244 install stage : $(libraries) : <location>$(BOOST_STAGE_LOCATE) ;
246 module [ CALLER_MODULE ]
254 # The .SUNWCCh files are present in tr1 include directory and have to be installed,
255 # see http://lists.boost.org/Archives/boost/2007/05/121430.php
256 [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ]
257 [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* : CVS .svn ]
258 [ path.glob boost/tr1/tr1 : * : bcc32 sun CVS .svn ]
261 # Declare special top-level targets that build and install the desired variants
263 boostcpp.declare-targets $(all-libraries) : $(headers) ;