Jamfile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #~ Copyright 2003, Rene Rivera.
  2. #~ Use, modification and distribution are subject to the
  3. #~ Boost Software License, Version 1.0. (See accompanying file
  4. #~ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. if --help in $(ARGV)
  6. {
  7. ECHO "
  8. Usage:
  9. bjam [options] [install|stage]
  10. * install Installs to the configured location(s).
  11. * stage Stages the build products only to common stage location.
  12. Options:
  13. --help This message.
  14. -sTOOLS=<toolsets> Indicates the tools to build with.
  15. Locations:
  16. --prefix=PREFIX Install architecture independent files here.
  17. Default; C:\\Boost on Win32
  18. Default; /usr/local on Unix. Linux, etc.
  19. --exec-prefix=EPREFIX Install architecture dependent files here.
  20. Default; PREFIX
  21. --libdir=DIR Install libraries here.
  22. Default; EPREFIX/lib
  23. --includedir=DIR Install source headers here.
  24. Default; PREFIX/include
  25. --builddir=DIR Build in this location instead of building
  26. within the distribution tree. Recomended!
  27. --stagedir=DIR When staging only, stage to the location.
  28. Default; ./stage
  29. Features:
  30. --without-<library> Do not build, stage, or install the specified
  31. <library>. By default all libraries attempt to build.
  32. --with-python-root[=PYTHON_ROOT]
  33. Build Boost.Python libraries with the Python
  34. devel packages located at PYTHON_ROOT.
  35. Default PYTHON_ROOT; C:\\tools\\python on Win32.
  36. Default PYTHON_ROOT; /usr/local on Unix, Linux, etc.
  37. Default PYTHON_ROOT; /usr on Cygwin.
  38. --with-pydebug Build Boost.Python libraries using the
  39. Python debug runtime.
  40. " ;
  41. EXIT "" ;
  42. }
  43. local with-install = ;
  44. local with-stage = ;
  45. # build only, or build+install
  46. if install in $(ARGV)
  47. {
  48. with-install = install ;
  49. with-stage = ;
  50. }
  51. # stage only? (no install, only build and stage to a common dir)
  52. if stage in $(ARGV)
  53. {
  54. with-stage = stage ;
  55. with-install = ;
  56. }
  57. # possible stage only location
  58. local stage-locate = [ MATCH "^--stagedir=(.*)" : $(ARGV) ] ;
  59. stage-locate ?= stage ;
  60. # architecture independent files
  61. local boost-locate = [ unless $(with-stage) : [ MATCH "^--prefix=(.*)" : $(ARGV) ] : $(stage-locate) ] ;
  62. if $(NT) { boost-locate ?= C:\\Boost ; }
  63. else if $(UNIX) { boost-locate ?= /usr/local ; }
  64. # architecture dependent files
  65. local exec-locate = [ MATCH "^--exec-prefix=(.*)" : $(ARGV) ] ;
  66. exec-locate ?= $(boost-locate) ;
  67. # object code libraries
  68. local lib-locate = [ MATCH "^--libdir=(.*)" : $(ARGV) ] ;
  69. lib-locate ?= $(exec-locate)/lib ;
  70. # where to build
  71. local all-locate = [ MATCH "^--builddir=(.*)" : $(ARGV) ] ;
  72. ALL_LOCATE_TARGET ?= $(all-locate) ;
  73. # source header files
  74. local include-locate = [ MATCH "^--includedir=(.*)" : $(ARGV) ] ;
  75. include-locate ?= $(boost-locate)/include ;
  76. # location of python
  77. local python-root = [ MATCH "^--with-python-root=(.*)" : $(ARGV) ] ;
  78. PYTHON_ROOT ?= $(python-root) ;
  79. # variant for pydebug build
  80. local with-debug-python ;
  81. if --with-pydebug in $(ARGV)
  82. {
  83. with-debug-python = debug-python ;
  84. }
  85. # libraries to disable building, etc.
  86. local without-libraries = [ MATCH "^--without-(.*)" : $(ARGV) ] ;
  87. #
  88. project-root ;
  89. # bring in the rules for python
  90. import python ;
  91. #
  92. local version-tag = [ MATCH "^([^.]+).([^.]+)" : $(BOOST_VERSION) ] ;
  93. version-tag = $(version-tag:J="_") ;
  94. #
  95. install-subinclude
  96. [ MATCH ^(.*build[/\\:]$(JAMFILE))$ : [ glob-tree $(BOOST_ROOT)/libs : $(JAMFILE) ] ]
  97. : <exclude>$(without-libraries) ;
  98. if [ install-sources lib ]
  99. {
  100. local lib-build =
  101. debug release
  102. [ cond $(with-debug-python) : debug-python ]
  103. [ cond $(NT) : <runtime-link>static/dynamic ]
  104. <threading>single/multi
  105. ;
  106. stage $(lib-locate:D=)
  107. :
  108. [ install-sources lib ]
  109. :
  110. <locate>$(lib-locate:D)
  111. common-variant-tag
  112. [ cond $(with-install) : <target>install : <target>all ]
  113. [ cond $(with-stage) : <target>stage : <target>all ]
  114. :
  115. $(lib-build)
  116. [ unless $(with-install) $(with-stage) : <suppress>true ]
  117. ;
  118. }
  119. stage $(include-locate:D=)/boost-$(version-tag)
  120. :
  121. [ glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* ]
  122. [ glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp ]
  123. :
  124. <locate>$(include-locate:D)
  125. <tree-subdirs>$(BOOST_ROOT)
  126. [ cond $(with-install) : <target>install : <target>all ]
  127. :
  128. [ unless $(with-install) : <suppress>true ]
  129. ;
粤ICP备19079148号