]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/Jamroot
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / Jamroot
CommitLineData
7c673cae
FG
1# Copyright Vladimir Prus 2002-2006.
2# Copyright Dave Abrahams 2005-2006.
3# Copyright Rene Rivera 2005-2007.
4# Copyright Douglas Gregor 2005.
5#
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)
9
10# Usage:
11#
12# b2 [options] [properties] [install|stage]
13#
14# Builds and installs Boost.
15#
16# Targets and Related Options:
17#
18# install Install headers and compiled library files to the
19# ======= configured locations (below).
20#
21# --prefix=<PREFIX> Install architecture independent files here.
92f5a8d4
TL
22# Default: C:\Boost on Windows
23# Default: /usr/local on Unix, Linux, etc.
7c673cae
FG
24#
25# --exec-prefix=<EPREFIX> Install architecture dependent files here.
92f5a8d4 26# Default: <PREFIX>
7c673cae 27#
92f5a8d4
TL
28# --libdir=<LIBDIR> Install library files here.
29# Default: <EPREFIX>/lib
7c673cae
FG
30#
31# --includedir=<HDRDIR> Install header files here.
92f5a8d4
TL
32# Default: <PREFIX>/include
33#
34# --cmakedir=<CMAKEDIR> Install CMake configuration files here.
35# Default: <LIBDIR>/cmake
36#
37# --no-cmake-config Do not install CMake configuration files.
7c673cae
FG
38#
39# stage Build and install only compiled library files to the
40# ===== stage directory.
41#
42# --stagedir=<STAGEDIR> Install library files here
92f5a8d4 43# Default: ./stage
7c673cae
FG
44#
45# Other Options:
46#
47# --build-type=<type> Build the specified pre-defined set of variations of
48# the libraries. Note, that which variants get built
49# depends on what each library supports.
50#
51# -- minimal -- (default) Builds a minimal set of
52# variants. On Windows, these are static
53# multithreaded libraries in debug and release
54# modes, using shared runtime. On Linux, these are
55# static and shared multithreaded libraries in
56# release mode.
57#
58# -- complete -- Build all possible variations.
59#
60# --build-dir=DIR Build in this location instead of building within
61# the distribution tree. Recommended!
62#
63# --show-libraries Display the list of Boost libraries that require
64# build and installation steps, and then exit.
65#
66# --layout=<layout> Determine whether to choose library names and header
67# locations such that multiple versions of Boost or
68# multiple compilers can be used on the same system.
69#
70# -- versioned -- Names of boost binaries include
71# the Boost version number, name and version of
72# the compiler and encoded build properties. Boost
73# headers are installed in a subdirectory of
74# <HDRDIR> whose name contains the Boost version
75# number.
76#
77# -- tagged -- Names of boost binaries include the
78# encoded build properties such as variant and
79# threading, but do not including compiler name
80# and version, or Boost version. This option is
81# useful if you build several variants of Boost,
82# using the same compiler.
83#
84# -- system -- Binaries names do not include the
85# Boost version number or the name and version
86# number of the compiler. Boost headers are
87# installed directly into <HDRDIR>. This option is
88# intended for system integrators building
89# distribution packages.
90#
91# The default value is 'versioned' on Windows, and
92# 'system' on Unix.
93#
94# --buildid=ID Add the specified ID to the name of built libraries.
95# The default is to not add anything.
96#
97# --python-buildid=ID Add the specified ID to the name of built libraries
98# that depend on Python. The default is to not add
99# anything. This ID is added in addition to --buildid.
100#
101# --help This message.
102#
103# --with-<library> Build and install the specified <library>. If this
104# option is used, only libraries specified using this
105# option will be built.
106#
107# --without-<library> Do not build, stage, or install the specified
108# <library>. By default, all libraries are built.
109#
110# Properties:
111#
112# toolset=toolset Indicate the toolset to build with.
113#
114# variant=debug|release Select the build variant
115#
116# link=static|shared Whether to build static or shared libraries
117#
118# threading=single|multi Whether to build single or multithreaded binaries
119#
120# runtime-link=static|shared
121# Whether to link to static or shared C and C++
122# runtime.
123#
124
125# TODO:
126# - handle boost version
127# - handle python options such as pydebug
128
129import boostcpp ;
130import package ;
131
132import sequence ;
133import xsltproc ;
134import set ;
135import path ;
136import link ;
11fdf7f2
TL
137import notfile ;
138import virtual-target ;
139import "class" : new ;
140import property-set ;
b32b8144 141import threadapi-feature ;
11fdf7f2 142import option ;
92f5a8d4
TL
143# Backslash because of `bcp --namespace`
144import tools/boost\_install/boost-install ;
7c673cae
FG
145
146path-constant BOOST_ROOT : . ;
1e59de90 147constant BOOST_VERSION : 1.79.0 ;
7c673cae
FG
148constant BOOST_JAMROOT_MODULE : $(__name__) ;
149
20effc67
TL
150# Allow subprojects to simply `import config : requires ;` to get access to the requires rule
151modules.poke : BOOST_BUILD_PATH : $(BOOST_ROOT)/libs/config/checks [ modules.peek : BOOST_BUILD_PATH ] ;
152
7c673cae
FG
153boostcpp.set-version $(BOOST_VERSION) ;
154
155use-project /boost/architecture : libs/config/checks/architecture ;
156
157local all-headers =
158 [ MATCH .*libs/(.*)/include/boost : [ glob libs/*/include/boost libs/*/*/include/boost ] ] ;
159
160for dir in $(all-headers)
161{
162 link-directory $(dir)-headers : libs/$(dir)/include/boost : <location>. ;
163 explicit $(dir)-headers ;
164}
165
166if $(all-headers)
167{
168 constant BOOST_MODULARLAYOUT : $(all-headers) ;
169}
170
171project boost
172 : requirements <include>.
173
174 [ boostcpp.architecture ]
175 [ boostcpp.address-model ]
176
177 # Disable auto-linking for all targets here, primarily because it caused
178 # troubles with V2.
179 <define>BOOST_ALL_NO_LIB=1
180 # Used to encode variant in target name. See the 'tag' rule below.
181 <tag>@$(__name__).tag
182 <conditional>@handle-static-runtime
183 # Comeau does not support shared lib
184 <toolset>como:<link>static
185 <toolset>como-linux:<define>_GNU_SOURCE=1
186 # When building docs within Boost, we want the standard Boost style
187 <xsl:param>boost.defaults=Boost
b32b8144 188 <conditional>@threadapi-feature.detect
7c673cae 189 : usage-requirements <include>.
92f5a8d4
TL
190 : default-build
191 <visibility>hidden
192 <threading>multi
7c673cae
FG
193 : build-dir bin.v2
194 ;
195
196# This rule is called by Boost.Build to determine the name of target. We use it
197# to encode the build variant, compiler name and boost version in the target
198# name.
199#
200rule tag ( name : type ? : property-set )
201{
202 return [ boostcpp.tag $(name) : $(type) : $(property-set) ] ;
203}
204
205rule python-tag ( name : type ? : property-set )
206{
207 return [ boostcpp.python-tag $(name) : $(type) : $(property-set) ] ;
208}
209
210rule handle-static-runtime ( properties * )
211{
212 # Using static runtime with shared libraries is impossible on Linux, and
213 # dangerous on Windows. Therefore, we disallow it. This might be drastic,
214 # but it was disabled for a while without anybody complaining.
215
1e59de90 216 local argv = [ modules.peek : ARGV ] ;
b32b8144 217
1e59de90
TL
218 if <link>shared in $(properties)
219 && <runtime-link>static in $(properties)
220 # For CW, static runtime is needed so that std::locale works.
221 && ! ( <toolset>cw in $(properties) )
222 && ! --allow-shared-static in $(argv)
223 {
224 boostcpp.emit-shared-static-warning ;
b32b8144 225 return <build>no ;
7c673cae
FG
226 }
227}
228
229all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
230 [ glob libs/*/build/Jamfile ] ] ;
231
232all-libraries = [ sequence.unique $(all-libraries) ] ;
233# The function_types library has a Jamfile, but it's used for maintenance
234# purposes, there's no library to build and install.
235all-libraries = [ set.difference $(all-libraries) : function_types ] ;
236
237# Setup convenient aliases for all libraries.
238
239local rule explicit-alias ( id : targets + )
240{
241 alias $(id) : $(targets) ;
242 explicit $(id) ;
243}
244
245# First, the complicated libraries: where the target name in Jamfile is
246# different from its directory name.
247explicit-alias prg_exec_monitor : libs/test/build//boost_prg_exec_monitor ;
248explicit-alias test_exec_monitor : libs/test/build//boost_test_exec_monitor ;
249explicit-alias unit_test_framework : libs/test/build//boost_unit_test_framework ;
250explicit-alias bgl-vis : libs/graps/build//bgl-vis ;
251explicit-alias serialization : libs/serialization/build//boost_serialization ;
252explicit-alias wserialization : libs/serialization/build//boost_wserialization ;
253for local l in $(all-libraries)
254{
92f5a8d4 255 if ! $(l) in test graph serialization headers
7c673cae
FG
256 {
257 explicit-alias $(l) : libs/$(l)/build//boost_$(l) ;
258 }
259}
260
261# Log has an additional target
262explicit-alias log_setup : libs/log/build//boost_log_setup ;
263
11fdf7f2
TL
264rule do-nothing { }
265
266rule generate-alias ( project name : property-set : sources * )
267{
268 local action-name = [ $(property-set).get <action> ] ;
269 local m = [ MATCH ^@(.*) : $(action-name) ] ;
270 property-set = [ property-set.empty ] ;
271 local action = [ new action $(sources) : $(m[1]) : $(property-set) ] ;
272 local t = [ new notfile-target $(name) : $(project) : $(action) ] ;
273 return [ virtual-target.register $(t) ] ;
274}
275
276generate headers : $(all-headers)-headers : <generating-rule>@generate-alias <action>@do-nothing : : <include>. ;
277
278#alias headers : $(all-headers)-headers : : : <include>. ;
7c673cae
FG
279explicit headers ;
280
281# Make project ids of all libraries known.
282for local l in $(all-libraries)
283{
284 use-project /boost/$(l) : libs/$(l)/build ;
285}
286
b32b8144 287if [ path.exists $(BOOST_ROOT)/tools/inspect/build ]
7c673cae
FG
288{
289 use-project /boost/tools/inspect : tools/inspect/build ;
290}
291
b32b8144 292if [ path.exists $(BOOST_ROOT)/libs/wave/tool/build ]
7c673cae
FG
293{
294 use-project /boost/libs/wave/tool : libs/wave/tool/build ;
295}
296
92f5a8d4
TL
297# Make the boost-install rule visible in subprojects
298
7c673cae
FG
299# This rule should be called from libraries' Jamfiles and will create two
300# targets, "install" and "stage", that will install or stage that library. The
301# --prefix option is respected, but --with and --without options, naturally, are
302# ignored.
303#
304# - libraries -- list of library targets to install.
92f5a8d4 305
7c673cae
FG
306rule boost-install ( libraries * )
307{
92f5a8d4 308 boost-install.boost-install $(libraries) ;
7c673cae
FG
309}
310
311# Creates a library target, adding autolink support and also creates
312# stage and install targets via boost-install, above.
313rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * )
314{
92f5a8d4 315 autolink = <link>shared:<define>BOOST_$(name:U)_DYN_LINK=1 ;
7c673cae 316 name = boost_$(name) ;
7c673cae
FG
317 lib $(name)
318 : $(sources)
319 : $(requirements) $(autolink)
320 : $(default-build)
321 : $(usage-requirements) $(autolink)
322 ;
323 boost-install $(name) ;
324}
325
326
7c673cae
FG
327# Declare special top-level targets that build and install the desired variants
328# of the libraries.
92f5a8d4 329boostcpp.declare-targets $(all-libraries) ;