Skip to content

Commit

Permalink
fix installation of vendored zlib and bzip2
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Nov 6, 2024
1 parent c7dd648 commit 8437b19
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
30 changes: 29 additions & 1 deletion build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

require-b2 5.2 ;

import os ;

constant boost_dependencies :
/boost/assert//boost_assert
/boost/config//boost_config
Expand All @@ -30,12 +32,38 @@ project /boost/iostreams
<include>include
;

local compression-libs-to-install ;
for local v in NO_COMPRESSION NO_ZLIB NO_BZIP2
{
$(v) = [ modules.peek : $(v) ] ;
}
if $(NO_COMPRESSION) != 1 && $(NO_ZLIB) != 1
{
constant has_zlib : true ;
if [ os.environ ZLIB_SOURCE ]
{
constant install_zlib : true ;
explicit [ alias boost_zlib : build//boost_zlib ] ;
compression-libs-to-install += boost_zlib ;
}
}
if $(NO_COMPRESSION) != 1 && $(NO_BZIP2) != 1
{
constant has_bzip2 : true ;
if [ os.environ BZIP2_SOURCE ]
{
constant install_bzip2 : true ;
explicit [ alias boost_bzip2 : build//boost_bzip2 ] ;
compression-libs-to-install += boost_bzip2 ;
}
}

explicit
[ alias boost_iostreams : build//boost_iostreams ]
[ alias all : boost_iostreams example test ]
;

call-if : boost-library iostreams
: install boost_iostreams
: install boost_iostreams $(compression-libs-to-install)
;

18 changes: 10 additions & 8 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,23 @@ import ac ;
local debug = [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] ;

for local v in NO_COMPRESSION
NO_ZLIB
NO_BZIP2
NO_LZMA
NO_ZSTD
{
$(v) = [ modules.peek : $(v) ] ;
}

if $(NO_COMPRESSION) != 1 && $(NO_ZLIB) != 1
if $(has_zlib)
{
using zlib : : <build-name>boost_zlib <tag>@tag ;
zlib-requirements =
[ ac.check-library /zlib//zlib : <library>/zlib//zlib
<source>zlib.cpp <source>gzip.cpp ] ;

if [ os.environ ZLIB_SOURCE ]
if $(install_zlib)
{
alias boost_zlib : /zlib//zlib ;
libraries-to-install += boost_zlib ;
install-zlib = true ;
}
}
else
Expand All @@ -54,17 +52,17 @@ else
}
}

if $(NO_COMPRESSION) != 1 && $(NO_BZIP2) != 1
if $(has_bzip2)
{
using bzip2 : : <build-name>boost_bzip2 <tag>@tag ;
bzip2-requirements =
[ ac.check-library /bzip2//bzip2 : <library>/bzip2//bzip2
<source>bzip2.cpp ] ;

if [ os.environ BZIP2_SOURCE ]
if $(install_bzip2)
{
alias boost_bzip2 : /bzip2//bzip2 ;
libraries-to-install += boost_bzip2 ;
install-bzip2 = true ;
}
}
else
Expand All @@ -74,6 +72,10 @@ else
ECHO "notice: iostreams: not using bzip compression " ;
}
}
if ! $(install-bzip2)
{
alias boost_bzip2 ;
}

if $(NO_COMPRESSION) != 1 && $(NO_LZMA) != 1
{
Expand Down

0 comments on commit 8437b19

Please sign in to comment.