Jamroot 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. # --python-buildid=ID Adds the specified ID to the name of built
  93. # libraries that depend on Python. The default
  94. # is to not add anything. This ID is added in
  95. # addition to --buildid.
  96. #
  97. #
  98. # --help This message.
  99. #
  100. # --with-<library> Build and install the specified <library>
  101. # If this option is used, only libraries
  102. # specified using this option will be built.
  103. #
  104. # --without-<library> Do not build, stage, or install the specified
  105. # <library>. By default, all libraries are built.
  106. #
  107. # Properties:
  108. #
  109. # toolset=toolset Indicates the toolset to build with.
  110. #
  111. # variant=debug|release Select the build variant
  112. #
  113. # link=static|shared Whether to build static or shared libraries
  114. #
  115. # threading=single|multi Whether to build single or multithreaded binaries
  116. #
  117. # runtime-link=static|shared
  118. # Whether to link to static or shared C and C++ runtime.
  119. #
  120. # TODO:
  121. # - handle boost version
  122. # - handle python options such as pydebug
  123. import boostcpp ;
  124. import package ;
  125. import sequence ;
  126. import xsltproc ;
  127. import set ;
  128. import path ;
  129. path-constant BOOST_ROOT : . ;
  130. constant BOOST_VERSION : 1.49.0 ;
  131. constant BOOST_JAMROOT_MODULE : $(__name__) ;
  132. boostcpp.set-version $(BOOST_VERSION) ;
  133. project boost
  134. : requirements <include>.
  135. # Disable auto-linking for all targets here, primarily because it caused
  136. # troubles with V2.
  137. <define>BOOST_ALL_NO_LIB=1
  138. # Used to encode variant in target name. See the 'tag' rule below.
  139. <tag>@$(__name__).tag
  140. <conditional>@handle-static-runtime
  141. # The standard library Sun compilers use by default has no chance
  142. # of working with Boost. Override it.
  143. <toolset>sun:<stdlib>sun-stlport
  144. # Comeau does not support shared lib
  145. <toolset>como:<link>static
  146. <toolset>como-linux:<define>_GNU_SOURCE=1
  147. # When building docs within Boost, we want the standard Boost style
  148. <xsl:param>boost.defaults=Boost
  149. : usage-requirements <include>.
  150. : build-dir bin.v2
  151. ;
  152. # This rule is called by Boost.Build to determine the name of target. We use it
  153. # to encode the build variant, compiler name and boost version in the target
  154. # name.
  155. #
  156. rule tag ( name : type ? : property-set )
  157. {
  158. return [ boostcpp.tag $(name) : $(type) : $(property-set) ] ;
  159. }
  160. rule handle-static-runtime ( properties * )
  161. {
  162. # Using static runtime with shared libraries is impossible on Linux,
  163. # and dangerous on Windows. Therefore, we disallow it. This might
  164. # be drastic, but it was disabled for a while with nobody complaining.
  165. # For CW, static runtime is needed so that std::locale works.
  166. if <link>shared in $(properties) && <runtime-link>static in $(properties) &&
  167. ! ( <toolset>cw in $(properties) )
  168. {
  169. ECHO "error: link=shared together with runtime-link=static is not allowed" ;
  170. ECHO "error: such property combination is either impossible " ;
  171. ECHO "error: or too dangerious to be of any use" ;
  172. EXIT ;
  173. }
  174. }
  175. all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
  176. [ glob libs/*/build/Jamfile ] ]
  177. ;
  178. all-libraries = [ sequence.unique $(all-libraries) ] ;
  179. # The function_types library has a Jamfile, but it's used for maintenance
  180. # purposes, there's no library to build and install.
  181. all-libraries = [ set.difference $(all-libraries) : function_types ] ;
  182. # Setup convenient aliases for all libraries.
  183. local rule explicit-alias ( id : targets + )
  184. {
  185. alias $(id) : $(targets) ;
  186. explicit $(id) ;
  187. }
  188. # First, the complicated libraries: where the target name in Jamfile is
  189. # different from its directory name.
  190. explicit-alias prg_exec_monitor : libs/test/build//boost_prg_exec_monitor ;
  191. explicit-alias test_exec_monitor : libs/test/build//boost_test_exec_monitor ;
  192. explicit-alias unit_test_framework : libs/test/build//boost_unit_test_framework ;
  193. explicit-alias bgl-vis : libs/graps/build//bgl-vis ;
  194. explicit-alias serialization : libs/serialization/build//boost_serialization ;
  195. explicit-alias wserialization : libs/serialization/build//boost_wserialization ;
  196. for local l in $(all-libraries)
  197. {
  198. if ! $(l) in test graph serialization
  199. {
  200. explicit-alias $(l) : libs/$(l)/build//boost_$(l) ;
  201. }
  202. }
  203. alias headers : : : : <include>. ;
  204. explicit headers ;
  205. # Make project ids of all libraries known.
  206. for local l in $(all-libraries)
  207. {
  208. use-project /boost/$(l) : libs/$(l)/build ;
  209. }
  210. # This rule should be called from libraries' Jamfiles and will create two
  211. # targets, "install" and "stage", that will install or stage that library. The
  212. # --prefix option is respected, but --with and --without options, naturally, are
  213. # ignored.
  214. #
  215. # - libraries -- list of library targets to install.
  216. #
  217. rule boost-install ( libraries * )
  218. {
  219. package.install install
  220. : <dependency>/boost//install-proper-headers $(install-requirements)
  221. : # No binaries
  222. : $(libraries)
  223. : # No headers, it is handled by the dependency.
  224. ;
  225. install stage : $(libraries) : <location>$(BOOST_STAGE_LOCATE) ;
  226. module [ CALLER_MODULE ]
  227. {
  228. explicit stage ;
  229. explicit install ;
  230. }
  231. }
  232. headers =
  233. # The .SUNWCCh files are present in tr1 include directory and have to be installed,
  234. # see http://lists.boost.org/Archives/boost/2007/05/121430.php
  235. [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ]
  236. [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* : CVS .svn ]
  237. [ path.glob boost/tr1/tr1 : * : bcc32 sun CVS .svn ]
  238. ;
  239. # Declare special top-level targets that build and install the desired variants
  240. # of the libraries.
  241. boostcpp.declare-targets $(all-libraries) : $(headers) ;
粤ICP备19079148号