Jamroot 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  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. # Usage:
  10. #
  11. # bjam [options] [properties] [install|stage]
  12. #
  13. # Builds and installs Boost.
  14. #
  15. # Targets and Related Options:
  16. #
  17. # install Install headers and compiled library files to the
  18. # ======= configured locations (below).
  19. #
  20. # --prefix=<PREFIX> Install architecture independent files here.
  21. # Default; C:\Boost on Win32
  22. # Default; /usr/local on Unix. Linux, etc.
  23. #
  24. # --exec-prefix=<EPREFIX> Install architecture dependent files here.
  25. # Default; <PREFIX>
  26. #
  27. # --libdir=<DIR> Install library files here.
  28. # Default; <EPREFIX>/lib
  29. #
  30. # --includedir=<HDRDIR> Install header files here.
  31. # Default; <PREFIX>/include
  32. #
  33. # stage Build and install only compiled library files
  34. # ===== to the stage directory.
  35. #
  36. # --stagedir=<STAGEDIR> Install library files here
  37. # Default; ./stage
  38. #
  39. # Other Options:
  40. #
  41. # --build-type=<type> Build the specified pre-defined set of variations
  42. # of the libraries. Note, that which variants get
  43. # built depends on what each library supports.
  44. #
  45. # minimal (default) - Builds a minimal set of
  46. # variants. On Windows, these are static
  47. # multithreaded libraries in debug and release
  48. # modes, using shared runtime. On Linux, these
  49. # are static and shared multithreaded libraries
  50. # in release mode.
  51. #
  52. # complete - Build all possible variations.
  53. #
  54. # --build-dir=DIR Build in this location instead of building
  55. # within the distribution tree. Recommended!
  56. #
  57. # --show-libraries Displays the list of Boost libraries that require
  58. # build and installation steps, then exit.
  59. #
  60. # --layout=<layout> Determines whether to choose library names
  61. # and header locations such that multiple
  62. # versions of Boost or multiple compilers can
  63. # be used on the same system.
  64. #
  65. # versioned - Names of boost binaries
  66. # include the Boost version number, name and
  67. # version of the compiler and encoded build
  68. # properties. Boost headers are installed in a
  69. # subdirectory of <HDRDIR> whose name contains
  70. # the Boost version number.
  71. #
  72. # tagged -- Names of boost binaries include the
  73. # encoded build properties such as variant and
  74. # threading, but do not including compiler name
  75. # and version, or Boost version. This option is
  76. # useful if you build several variants of Boost,
  77. # using the same compiler.
  78. #
  79. # system - Binaries names do not include the
  80. # Boost version number or the name and version
  81. # number of the compiler. Boost headers are
  82. # installed directly into <HDRDIR>. This option
  83. # is intended for system integrators who are
  84. # building distribution packages.
  85. #
  86. # The default value is 'versioned' on Windows, and
  87. # 'system' on Unix.
  88. #
  89. # --buildid=ID Adds the specified ID to the name of built
  90. # libraries. The default is to not add anything.
  91. #
  92. # --help This message.
  93. #
  94. # --with-<library> Build and install the specified <library>
  95. # If this option is used, only libraries
  96. # specified using this option will be built.
  97. #
  98. # --without-<library> Do not build, stage, or install the specified
  99. # <library>. By default, all libraries are built.
  100. #
  101. # Properties:
  102. #
  103. # toolset=toolset Indicates the toolset to build with.
  104. #
  105. # variant=debug|release Select the build variant
  106. #
  107. # link=static|shared Whether to build static or shared libraries
  108. #
  109. # threading=single|multi Whether to build single or multithreaded binaries
  110. #
  111. # runtime-link=static|shared
  112. # Whether to link to static or shared C and C++ runtime.
  113. #
  114. # TODO:
  115. # - handle boost version
  116. # - handle python options such as pydebug
  117. import generate ;
  118. import modules ;
  119. import set ;
  120. import stage ;
  121. import package ;
  122. import path ;
  123. import common ;
  124. import os ;
  125. import regex ;
  126. import errors ;
  127. import "class" : new ;
  128. import common ;
  129. import sequence ;
  130. import symlink ;
  131. import targets ;
  132. import project ;
  133. import option ;
  134. import xsltproc ;
  135. import build-system ;
  136. import configure ;
  137. path-constant BOOST_ROOT : . ;
  138. constant BOOST_VERSION : 1.43.0 ;
  139. constant BOOST_JAMROOT_MODULE : $(__name__) ;
  140. local version-tag = [ MATCH "^([^.]+)[.]([^.]+)[.]([^.]+)" : $(BOOST_VERSION) ]
  141. ;
  142. if $(version-tag[3]) = 0
  143. {
  144. version-tag = $(version-tag[1-2]) ;
  145. }
  146. constant BOOST_VERSION_TAG : $(version-tag:J="_") ;
  147. # Option to choose how many variants to build. The default is "minimal".
  148. local build-type = [ MATCH "^--build-type=(.*)" : [ modules.peek : ARGV ] ] ;
  149. build-type ?= minimal ;
  150. if ! ( $(build-type) in minimal complete )
  151. {
  152. ECHO "The value of the --build-type option should be either 'complete' or 'minimal'" ;
  153. EXIT ;
  154. }
  155. rule handle-static-runtime ( properties * )
  156. {
  157. # Using static runtime with shared libraries is impossible on Linux,
  158. # and dangerous on Windows. Therefore, we disallow it. This might
  159. # be drastic, but it was disabled for a while with nobody complaining.
  160. # For CW, static runtime is needed so that std::locale works.
  161. if <link>shared in $(properties) && <runtime-link>static in $(properties) &&
  162. ! ( <toolset>cw in $(properties) )
  163. {
  164. ECHO "error: link=shared together with runtime-link=static is not allowed" ;
  165. ECHO "error: such property combination is either impossible " ;
  166. ECHO "error: or too dangerious to be of any use" ;
  167. EXIT ;
  168. }
  169. }
  170. project boost
  171. : requirements <include>.
  172. # Disable auto-linking for all targets here, primarily because it caused
  173. # troubles with V2.
  174. <define>BOOST_ALL_NO_LIB=1
  175. # Used to encode variant in target name. See the 'tag' rule below.
  176. <tag>@$(__name__).tag
  177. <conditional>@handle-static-runtime
  178. # The standard library Sun compilers use by default has no chance
  179. # of working with Boost. Override it.
  180. <toolset>sun:<stdlib>sun-stlport
  181. # Comeau does not support shared lib
  182. <toolset>como:<link>static
  183. <toolset>como-linux:<define>_GNU_SOURCE=1
  184. # When building docs within Boost, we want the standard Boost style
  185. <xsl:param>boost.defaults=Boost
  186. : usage-requirements <include>.
  187. : build-dir bin.v2
  188. ;
  189. # Setup convenient aliases for all libraries.
  190. all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
  191. [ glob libs/*/build/Jamfile ] ]
  192. ;
  193. all-libraries = [ sequence.unique $(all-libraries) ] ;
  194. # The function_types library has a Jamfile, but it's used for maintenance
  195. # purposes, there's no library to build and install.
  196. all-libraries = [ set.difference $(all-libraries) : function_types ] ;
  197. configure.register-components $(all-libraries) ;
  198. local rule explicit-alias ( id : targets + )
  199. {
  200. alias $(id) : $(targets) ;
  201. explicit $(id) ;
  202. }
  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)
  212. {
  213. if ! $(l) in test graph serialization
  214. {
  215. explicit-alias $(l) : libs/$(l)/build//boost_$(l) ;
  216. }
  217. }
  218. alias headers : : : : <include>. ;
  219. # Decides which libraries are to be installed by looking at --with-<library>
  220. # --without-<library> arguments. Returns the list of directories under "libs"
  221. # which must be built and installed.
  222. #
  223. rule libraries-to-install ( existing-libraries * )
  224. {
  225. local argv = [ modules.peek : ARGV ] ;
  226. local with-parameter = [ MATCH --with-(.*) : $(argv) ] ;
  227. local without-parameter = [ MATCH --without-(.*) : $(argv) ] ;
  228. if ! $(with-parameter) && ! $(without-parameter)
  229. {
  230. # Nothing is specified on command line. See if maybe
  231. # project-config.jam has some choices.
  232. local project-config-libs = [ modules.peek project-config : libraries ] ;
  233. with-parameter = [ MATCH --with-(.*) : $(project-config-libs) ] ;
  234. without-parameter = [ MATCH --without-(.*) : $(project-config-libs) ] ;
  235. }
  236. # Do some checks.
  237. if $(with-parameter) && $(without-parameter)
  238. {
  239. ECHO "error: both --with-<library> and --without-<library> specified" ;
  240. EXIT ;
  241. }
  242. local wrong = [ set.difference $(with-parameter) : $(existing-libraries) ] ;
  243. if $(wrong)
  244. {
  245. ECHO "error: wrong library name '$(wrong[1])' in the --with-<library> option." ;
  246. EXIT ;
  247. }
  248. local wrong = [ set.difference $(without-parameter) : $(existing-libraries) ] ;
  249. if $(wrong)
  250. {
  251. ECHO "error: wrong library name '$(wrong[1])' in the --without-<library> option." ;
  252. EXIT ;
  253. }
  254. if $(with-parameter)
  255. {
  256. return [ set.intersection $(existing-libraries) : $(with-parameter) ] ;
  257. }
  258. else
  259. {
  260. return [ set.difference $(existing-libraries) : $(without-parameter) ] ;
  261. }
  262. }
  263. # What kind of layout are we doing?
  264. layout = [ option.get layout : "" ] ;
  265. # On Windows, we used versioned layout by default in order to
  266. # be compatible with autolink. On other systems, we use system
  267. # layout which is what every other program uses. Note that windows
  268. # check is static, and won't
  269. if ! $(layout)
  270. {
  271. if [ modules.peek : NT ]
  272. {
  273. layout = versioned ;
  274. }
  275. else
  276. {
  277. layout = system ;
  278. }
  279. }
  280. layout-$(layout) = true ;
  281. if $(layout) = system && $(build-type) = complete
  282. {
  283. ECHO "error: Cannot use --layout=system with --build-type complete." ;
  284. ECHO "error: Please used either --layout=versioned or --layout=tagged " ;
  285. ECHO "error: if you wish to build multiple variants." ;
  286. if ! [ modules.peek : NT ]
  287. {
  288. ECHO "error: Note that --layout=system is default on Unix starting with Boost 1.40." ;
  289. }
  290. EXIT ;
  291. }
  292. # Possible stage only location.
  293. local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
  294. stage-locate ?= stage ;
  295. path-constant BOOST_STAGE_LOCATE : $(stage-locate) ;
  296. # Python location.
  297. local python-root = [ MATCH "^--with-python-root=(.*)" : [ modules.peek : ARGV ]
  298. ] ;
  299. PYTHON_ROOT ?= $(python-root) ;
  300. # Select the libraries to install.
  301. libraries = [ libraries-to-install $(all-libraries) ] ;
  302. configure.components-building $(libraries) ;
  303. if --show-libraries in [ modules.peek : ARGV ]
  304. {
  305. ECHO "The following libraries require building:" ;
  306. for local l in $(libraries)
  307. {
  308. ECHO " - $(l)" ;
  309. }
  310. EXIT ;
  311. }
  312. # Custom build ID.
  313. local build-id = [ MATCH "^--buildid=(.*)" : [ modules.peek : ARGV ] ] ;
  314. if $(build-id)
  315. {
  316. constant BUILD_ID : [ regex.replace $(build-id) "[*\\/:.\"\' ]" "_" ] ;
  317. }
  318. # This rule is called by Boost.Build to determine the name of target. We use it
  319. # to encode the build variant, compiler name and boost version in the target
  320. # name.
  321. #
  322. rule tag ( name : type ? : property-set )
  323. {
  324. if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
  325. {
  326. local result ;
  327. if $(layout) = versioned
  328. {
  329. result = [ common.format-name
  330. <base> <toolset> <threading> <runtime> -$(BOOST_VERSION_TAG)
  331. -$(BUILD_ID)
  332. : $(name) : $(type) : $(property-set) ] ;
  333. }
  334. else if $(layout) = tagged
  335. {
  336. result = [ common.format-name
  337. <base> <threading> <runtime>
  338. -$(BUILD_ID)
  339. : $(name) : $(type) : $(property-set) ] ;
  340. }
  341. else if $(layout) = system
  342. {
  343. result = [ common.format-name
  344. <base>
  345. -$(BUILD_ID)
  346. : $(name) : $(type) : $(property-set) ] ;
  347. }
  348. else
  349. {
  350. ECHO "error: invalid layout '$(layout)'" ;
  351. EXIT ;
  352. }
  353. # Optionally add version suffix. On NT, library with version suffix
  354. # will not be recognized by linkers. On CYGWIN, we get strage
  355. # duplicate symbol errors when library is generated with version
  356. # suffix. On OSX, version suffix is not needed -- the linker expects
  357. # the libFoo.1.2.3.dylib format. AIX linkers do not accept version
  358. # suffixes either. Pgi compilers can not accept library with version
  359. # suffix.
  360. if $(type) = SHARED_LIB &&
  361. ( ! ( [ $(property-set).get <target-os> ] in windows cygwin darwin aix ) &&
  362. ! ( [ $(property-set).get <toolset> ] in pgi ) )
  363. {
  364. result = $(result).$(BOOST_VERSION) ;
  365. }
  366. return $(result) ;
  367. }
  368. }
  369. # Install to system location.
  370. install-requirements = <install-source-root>$(BOOST_ROOT)/boost ;
  371. if $(layout-versioned)
  372. {
  373. install-requirements += <install-header-subdir>boost-$(BOOST_VERSION_TAG)/boost ;
  374. }
  375. else
  376. {
  377. install-requirements += <install-header-subdir>boost ;
  378. }
  379. if [ modules.peek : NT ]
  380. {
  381. install-requirements += <install-default-prefix>C:/Boost ;
  382. }
  383. else if [ modules.peek : UNIX ]
  384. {
  385. install-requirements += <install-default-prefix>/usr/local ;
  386. }
  387. local headers =
  388. # The .SUNWCCh files are present in tr1 include directory and have to be installed,
  389. # see http://lists.boost.org/Archives/boost/2007/05/121430.php
  390. [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ]
  391. [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* : CVS .svn ]
  392. [ path.glob boost/tr1/tr1 : * : bcc32 sun CVS .svn ]
  393. ;
  394. # Complete install.
  395. package.install install-proper
  396. : $(install-requirements) <install-no-version-symlinks>on
  397. :
  398. : libs/$(libraries)/build
  399. : $(headers)
  400. ;
  401. explicit install-proper ;
  402. # Install just library.
  403. install stage-proper
  404. : libs/$(libraries)/build
  405. : <location>$(stage-locate)/lib
  406. <install-dependencies>on <install-type>LIB
  407. <install-no-version-symlinks>on
  408. ;
  409. explicit stage-proper ;
  410. if $(layout-versioned) && ( [ modules.peek : NT ] || [ modules.peek : UNIX ] )
  411. {
  412. rule make-unversioned-links ( project name ? : property-set : sources * )
  413. {
  414. local result ;
  415. local filtered ;
  416. local pattern ;
  417. local nt = [ modules.peek : NT ] ;
  418. # Collect the libraries that have the version number in 'filtered'.
  419. for local s in $(sources)
  420. {
  421. local m ;
  422. if $(nt)
  423. {
  424. m = [ MATCH "(.*[.]lib)" : [ $(s).name ] ] ;
  425. }
  426. else
  427. {
  428. m = [ MATCH "(.*[.]so[.0-9]+)" "(.*[.]dylib)" "(.*[.]a)" :
  429. [ $(s).name ] ] ;
  430. }
  431. if $(m)
  432. {
  433. filtered += $(s) ;
  434. }
  435. }
  436. # Create links without version.
  437. for local s in $(filtered)
  438. {
  439. local name = [ $(s).name ] ;
  440. local ea = [ $(s).action ] ;
  441. local ep = [ $(ea).properties ] ;
  442. local a = [ new non-scanning-action $(s) : symlink.ln : $(ep) ] ;
  443. local noversion-file ;
  444. if $(nt)
  445. {
  446. noversion-file = [ MATCH "(.*)-[0-9_]+(.*[.]lib)" : $(name) ] ;
  447. }
  448. else
  449. {
  450. noversion-file =
  451. [ MATCH "(.*)-[0-9_]+(.*[.]so)[.0-9]*" : $(name) ]
  452. [ MATCH "(.*)-[0-9_]+(.*[.]dylib)" : $(name) ]
  453. [ MATCH "(.*)-[0-9_]+(.*[.]a)" : $(name) ]
  454. [ MATCH "(.*)-[0-9_]+(.*[.]dll[.]a)" : $(name) ] ;
  455. }
  456. local new-name =
  457. $(noversion-file[1])$(noversion-file[2]) ;
  458. result += [ new file-target $(new-name) exact : [ $(s).type ] : $(project)
  459. : $(a) ] ;
  460. }
  461. return $(result) ;
  462. }
  463. generate stage-unversioned : stage-proper :
  464. <generating-rule>@make-unversioned-links ;
  465. explicit stage-unversioned ;
  466. generate install-unversioned : install-proper :
  467. <generating-rule>@make-unversioned-links ;
  468. explicit install-unversioned ;
  469. }
  470. else
  471. {
  472. # Create do-nothing aliases.
  473. alias stage-unversioned ;
  474. explicit stage-unversioned ;
  475. alias install-unversioned ;
  476. explicit install-unversioned ;
  477. }
  478. # This is a special metatarget class that handles the --build-type=complete
  479. # option.
  480. class top-level-target : alias-target-class
  481. {
  482. import modules ;
  483. import errors ;
  484. rule __init__ ( name : project : sources * : requirements *
  485. : default-build * : usage-requirements * )
  486. {
  487. alias-target-class.__init__ $(name) : $(project) : $(sources) :
  488. $(requirements) : $(default-build) : $(usage-requirements) ;
  489. local m = [ $(project).project-module ] ;
  490. self.build-type = [ modules.peek $(m) : build-type ] ;
  491. # On Linux, we build release variant by default, since few users will
  492. # ever want to debug C++ Boost libraries, and there's no ABI
  493. # incompatibility between debug and release variants. We build
  494. # shared and static libraries since that's what most packages
  495. # seem to provide (.so in libfoo and .a in libfoo-dev).
  496. self.minimal-properties = [ property-set.create
  497. <variant>release <threading>multi <link>shared <link>static <runtime-link>shared ] ;
  498. # On Windows, new IDE projects use:
  499. #
  500. # runtime-link=dynamic, threading=multi, variant=(debug|release)
  501. #
  502. # and in addition, C++ Boost's autolink defaults to static linking.
  503. self.minimal-properties-win = [ property-set.create
  504. <variant>debug <variant>release <threading>multi <link>static <runtime-link>shared ] ;
  505. self.complete-properties = [ property-set.create
  506. <variant>debug <variant>release
  507. <threading>single <threading>multi
  508. <link>shared <link>static
  509. <runtime-link>shared <runtime-link>static ] ;
  510. }
  511. rule generate ( property-set )
  512. {
  513. local x = [ modules.peek : top-level-targets ] ;
  514. x += $(self.name) ;
  515. modules.poke : top-level-targets : $(x) ;
  516. if $(self.build-type) = minimal
  517. {
  518. local expanded ;
  519. local os = [ $(property-set).get <target-os> ] ;
  520. # Because we completely override parent's 'generate'
  521. # we need to check for default value of feature ourself.
  522. if ! $(os)
  523. {
  524. os = [ feature.defaults <target-os> ] ;
  525. os = $(os:G=) ;
  526. }
  527. if $(os) = windows
  528. {
  529. expanded = [ targets.apply-default-build $(property-set)
  530. : $(self.minimal-properties-win) ] ;
  531. }
  532. else
  533. {
  534. expanded = [ targets.apply-default-build $(property-set)
  535. : $(self.minimal-properties) ] ;
  536. }
  537. return [ build-multiple $(expanded) ] ;
  538. }
  539. else if $(self.build-type) = complete
  540. {
  541. local expanded = [ targets.apply-default-build $(property-set)
  542. : $(self.complete-properties) ] ;
  543. # Filter inappopriate combinations
  544. local filtered ;
  545. for local p in $(expanded)
  546. {
  547. # See comment in handle-static-runtime regarding this logic.
  548. if [ $(p).get <link> ] = shared && [ $(p).get <runtime-link> ] = static
  549. && [ $(p).get <toolset> ] != cw
  550. {
  551. # Skip this
  552. }
  553. else
  554. {
  555. filtered += $(p) ;
  556. }
  557. }
  558. return [ build-multiple $(filtered) ] ;
  559. }
  560. else
  561. {
  562. errors.error "Unknown build type" ;
  563. }
  564. }
  565. rule build-multiple ( property-sets * )
  566. {
  567. local usage-requirements = [ property-set.empty ] ;
  568. local result ;
  569. for local p in $(property-sets)
  570. {
  571. local r = [ alias-target-class.generate $(p) ] ;
  572. if $(r)
  573. {
  574. usage-requirements = [ $(usage-requirements).add $(r[1]) ] ;
  575. result += $(r[2-]) ;
  576. }
  577. }
  578. return $(usage-requirements) [ sequence.unique $(result) ] ;
  579. }
  580. }
  581. targets.create-metatarget top-level-target : [ project.current ]
  582. : install
  583. : install-proper install-unversioned
  584. ;
  585. targets.create-metatarget top-level-target : [ project.current ]
  586. : stage
  587. : stage-proper stage-unversioned
  588. ;
  589. explicit install ;
  590. explicit stage ;
  591. stage-abs = [ path.native [ path.root $(stage-locate)/lib [ path.pwd ] ] ] ;
  592. # This target is built by default, and will forward to 'stage'
  593. # after producing some explanations.
  594. targets.create-metatarget top-level-target : [ project.current ]
  595. : forward
  596. : explain stage
  597. ;
  598. message explain :
  599. "\nBuilding the Boost C++ Libraries.\n\n" ;
  600. explicit explain ;
  601. rule pre-build ( )
  602. {
  603. local tl = [ modules.peek : top-level-targets ] ;
  604. if stage in $(tl) || install in $(tl)
  605. {
  606. # FIXME: remove if when Boost regression tests use trunk
  607. # bjam.
  608. if PAD in [ RULENAMES ]
  609. {
  610. configure.print-component-configuration ;
  611. }
  612. }
  613. }
  614. IMPORT $(__name__) : pre-build : : $(__name__).pre-build ;
  615. build-system.set-pre-build-hook $(__name__).pre-build ;
  616. rule post-build ( ok ? )
  617. {
  618. if forward in [ modules.peek : top-level-targets ]
  619. {
  620. if $(ok)
  621. {
  622. ECHO
  623. "\n\nThe Boost C++ Libraries were successfully built!
  624. The following directory should be added to compiler include paths:
  625. $(BOOST_ROOT)
  626. The following directory should be added to linker library paths:
  627. $(stage-abs)
  628. " ;
  629. }
  630. }
  631. }
  632. IMPORT $(__name__) : post-build : : $(__name__).post-build ;
  633. build-system.set-post-build-hook $(__name__).post-build ;
  634. # This rule should be called from libraries' Jamfiles and will create two
  635. # targets, "install" and "stage", that will install or stage that library. The
  636. # --prefix option is respected, but --with and --without options, naturally, are
  637. # ignored.
  638. #
  639. # - libraries -- list of library targets to install.
  640. #
  641. rule boost-install ( libraries * )
  642. {
  643. package.install install
  644. : <dependency>/boost//install-proper-headers $(install-requirements)
  645. : # No binaries
  646. : $(libraries)
  647. : # No headers, it is handled by the dependency.
  648. ;
  649. install stage : $(libraries) : <location>$(BOOST_STAGE_LOCATE) ;
  650. local c = [ project.current ] ;
  651. local project-module = [ $(c).project-module ] ;
  652. module $(project-module)
  653. {
  654. explicit stage ;
  655. explicit install ;
  656. }
  657. }
  658. # Make project ids of all libraries known.
  659. for local l in $(all-libraries)
  660. {
  661. use-project /boost/$(l) : libs/$(l)/build ;
  662. }
粤ICP备19079148号