Jamfile.v2 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #
  2. # This is Boost Jamfile for Boost.Build V2.
  3. # Currently, known to work on Linux with gcc
  4. #
  5. # To build Boost with it, run
  6. #
  7. # bjam --v2 link=static
  8. #
  9. # from the top-level directory
  10. import modules ;
  11. import set ;
  12. project boost
  13. : requirements <include>$(BOOST_ROOT)
  14. # disable auto-linking for all targets here,
  15. # primarily because it caused troubles with V2
  16. <define>BOOST_ALL_NO_LIB=1
  17. : usage-requirements <include>$(BOOST_ROOT)
  18. : build-dir bin.v2
  19. ;
  20. # The code hereselects the libraries that must be built and builds
  21. # and creates two targets:
  22. # 'stage', which builds only libraries and placed them in one location
  23. # 'install', which places both libraries and headers in system location
  24. rule libraries-to-install ( existing-libraries * )
  25. {
  26. local argv = [ modules.peek : ARGV ] ;
  27. local with-parameter = [ MATCH --with-(.*) : $(argv) ] ;
  28. local without-parameter = [ MATCH --without-(.*) : $(argv) ] ;
  29. # Do some checks
  30. if $(with-parameter) && $(without-parameter)
  31. {
  32. ECHO "error: both --with-<library> and --without-<library> specified" ;
  33. EXIT ;
  34. }
  35. local wrong = [ set.difference $(with-parameter) : $(existing-libraries) ] ;
  36. if $(wrong)
  37. {
  38. ECHO "error: wrong library name '$(wrong[1])' in the --with-<library> option." ;
  39. EXIT ;
  40. }
  41. local wrong = [ set.difference $(without-parameter) : $(existing-libraries) ] ;
  42. if $(wrong)
  43. {
  44. ECHO "error: wrong library name '$(wrong[1])' in the --without-<library> option." ;
  45. EXIT ;
  46. }
  47. if $(with-parameter)
  48. {
  49. return [ set.intersection $(existing-libraries) : $(with-parameter) ] ;
  50. }
  51. else
  52. {
  53. return [ set.difference $(existing-libraries) : $(without-parameter) ] ;
  54. }
  55. }
  56. # The following is a copy of V1 logic. We don't yet support
  57. # selecting versioned/unversioned install and changing the build
  58. # directory.
  59. ARGV = [ modules.peek : ARGV ] ;
  60. # what kind of layout are we doing?
  61. local layout = [ MATCH "^--layout=(.*)" : $(ARGV) ] ;
  62. layout ?= versioned ;
  63. layout-$(layout) = true ;
  64. # possible stage only location
  65. local stage-locate = [ MATCH "^--stagedir=(.*)" : $(ARGV) ] ;
  66. stage-locate ?= stage ;
  67. # architecture independent files
  68. local boost-locate ;
  69. if ! $(with-stage)
  70. {
  71. boost-locate = [ MATCH "^--prefix=(.*)" : $(ARGV) ] ;
  72. }
  73. else
  74. {
  75. boost-locate = $(stage-locate) ;
  76. }
  77. if [ modules.peek : NT ] { boost-locate ?= C:\\Boost ; }
  78. else if [ modules.peek : UNIX ] { boost-locate ?= /usr/local ; }
  79. # architecture dependent files
  80. local exec-locate = [ MATCH "^--exec-prefix=(.*)" : $(ARGV) ] ;
  81. exec-locate ?= $(boost-locate) ;
  82. # object code libraries
  83. local lib-locate = [ MATCH "^--libdir=(.*)" : $(ARGV) ] ;
  84. lib-locate ?= $(exec-locate)/lib ;
  85. # where to build
  86. local all-locate = [ MATCH "^--builddir=(.*)" : $(ARGV) ] ;
  87. ALL_LOCATE_TARGET ?= $(all-locate) ;
  88. # source header files
  89. local include-locate = [ MATCH "^--includedir=(.*)" : $(ARGV) ] ;
  90. include-locate ?= $(boost-locate)/include ;
  91. # location of python
  92. local python-root = [ MATCH "^--with-python-root=(.*)" : $(ARGV) ] ;
  93. PYTHON_ROOT ?= $(python-root) ;
  94. # Select the libraries to install.
  95. libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ] ] ;
  96. libraries = [ libraries-to-install $(libraries) ] ;
  97. local rename-rule ;
  98. if $(layout) = versioned
  99. {
  100. rename-rule = stage.add-variant-and-compiler ;
  101. }
  102. else
  103. {
  104. rename-rule = stage.add-variant ;
  105. }
  106. stage install : libs/$(libraries)/build
  107. : <so-version>1.32.0
  108. <location>$(lib-locate) <tag>@$(rename-rule)
  109. ;
  110. #build-project libs/test/build ;
  111. #build-project libs/date_time/build ;
  112. #build-project libs/regex/build ;
  113. #build-project libs/signals/build ;
  114. #build-project libs/graph/build ;
  115. # Comment this out if you don't have Python2.2 installed
  116. #build-project libs/python/build ;
  117. #build-project libs/thread/build ;
  118. #build-project libs/filesystem/build ;
  119. #build-project libs/program_options/build ;
粤ICP备19079148号