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