Jamfile.v2 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # Boost.Iostreams Library Build Jamfile
  2. # (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
  3. # (C) Copyright 2004-2007 Jonathan Turkanis
  4. # Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
  6. # See http://www.boost.org/libs/iostreams for documentation.
  7. project /boost/iostreams : source-location ../src ;
  8. # The biggest trick in this Jamfile is to link to zlib and bzip2 when
  9. # needed. To configure that, a number of variables are used, which must
  10. # be set by user with 'path-constant' either in Boost's root Jamfile, or
  11. # in user-config.jam.
  12. # For each library with either link to existing binary, or build
  13. # a library from the sources.
  14. import modules ;
  15. import os ;
  16. import path ;
  17. import ac ;
  18. local debug = [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] ;
  19. local libraries-to-install = boost_iostreams ;
  20. for local v in NO_COMPRESSION
  21. NO_ZLIB
  22. NO_BZIP2
  23. NO_LZMA
  24. NO_ZSTD
  25. {
  26. $(v) = [ modules.peek : $(v) ] ;
  27. }
  28. if $(NO_COMPRESSION) != 1 && $(NO_ZLIB) != 1
  29. {
  30. using zlib : : <build-name>boost_zlib <tag>@tag ;
  31. zlib-requirements =
  32. [ ac.check-library /zlib//zlib : <library>/zlib//zlib
  33. <source>zlib.cpp <source>gzip.cpp ] ;
  34. if [ os.environ ZLIB_SOURCE ]
  35. {
  36. alias boost_zlib : /zlib//zlib ;
  37. libraries-to-install += boost_zlib ;
  38. }
  39. }
  40. else
  41. {
  42. if $(debug)
  43. {
  44. ECHO "notice: iostreams: not using zlib compression " ;
  45. }
  46. }
  47. if $(NO_COMPRESSION) != 1 && $(NO_BZIP2) != 1
  48. {
  49. using bzip2 : : <build-name>boost_bzip2 <tag>@tag ;
  50. bzip2-requirements =
  51. [ ac.check-library /bzip2//bzip2 : <library>/bzip2//bzip2
  52. <source>bzip2.cpp ] ;
  53. if [ os.environ BZIP2_SOURCE ]
  54. {
  55. alias boost_bzip2 : /bzip2//bzip2 ;
  56. libraries-to-install += boost_bzip2 ;
  57. }
  58. }
  59. else
  60. {
  61. if $(debug)
  62. {
  63. ECHO "notice: iostreams: not using bzip compression " ;
  64. }
  65. }
  66. if $(NO_COMPRESSION) != 1 && $(NO_LZMA) != 1
  67. {
  68. using lzma ;
  69. exe has_lzma_cputhreads : ../build/has_lzma_cputhreads.cpp /lzma//lzma ;
  70. explicit has_lzma_cputhreads ;
  71. lzma-requirements =
  72. [ ac.check-library /lzma//lzma : <library>/lzma//lzma
  73. <source>lzma.cpp ]
  74. [ check-target-builds has_lzma_cputhreads
  75. : : <define>BOOST_IOSTREAMS_LZMA_NO_MULTITHREADED=1 ] ;
  76. }
  77. else
  78. {
  79. if $(debug)
  80. {
  81. ECHO "notice: iostreams: not using lzma compression " ;
  82. }
  83. }
  84. if $(NO_COMPRESSION) != 1 && $(NO_ZSTD) != 1
  85. {
  86. using zstd ;
  87. zstd-requirements =
  88. [ ac.check-library /zstd//zstd : <library>/zstd//zstd
  89. <source>zstd.cpp ] ;
  90. }
  91. else
  92. {
  93. if $(debug)
  94. {
  95. ECHO "notice: iostreams: not using zstd compression " ;
  96. }
  97. }
  98. local sources = file_descriptor.cpp mapped_file.cpp ;
  99. lib boost_iostreams
  100. : $(sources)
  101. : <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
  102. <define>BOOST_IOSTREAMS_USE_DEPRECATED
  103. $(zlib-requirements)
  104. $(bzip2-requirements)
  105. $(lzma-requirements)
  106. $(zstd-requirements)
  107. :
  108. : <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
  109. ;
  110. boost-install $(libraries-to-install) ;