From 096ad2169b8de5884657181e6b5bea13c369cb00 Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipov Date: Wed, 6 Nov 2024 17:39:20 +0300 Subject: [PATCH] fix installation of vendored zlib and bzip2 --- build.jam | 30 +++++++++++++++++++++++++++++- build/Jamfile.v2 | 12 ++++-------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/build.jam b/build.jam index b07ec9b1f..475e02179 100644 --- a/build.jam +++ b/build.jam @@ -5,6 +5,8 @@ require-b2 5.2 ; +import os ; + constant boost_dependencies : /boost/assert//boost_assert /boost/config//boost_config @@ -30,12 +32,38 @@ project /boost/iostreams 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) ; diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 15f6631c5..fc591b2a2 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -25,25 +25,22 @@ 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 : : boost_zlib @tag ; zlib-requirements = [ ac.check-library /zlib//zlib : /zlib//zlib zlib.cpp gzip.cpp ] ; - if [ os.environ ZLIB_SOURCE ] + if $(install_zlib) { alias boost_zlib : /zlib//zlib ; - libraries-to-install += boost_zlib ; } } else @@ -54,17 +51,16 @@ else } } -if $(NO_COMPRESSION) != 1 && $(NO_BZIP2) != 1 +if $(has_bzip2) { using bzip2 : : boost_bzip2 @tag ; bzip2-requirements = [ ac.check-library /bzip2//bzip2 : /bzip2//bzip2 bzip2.cpp ] ; - if [ os.environ BZIP2_SOURCE ] + if $(install_bzip2) { alias boost_bzip2 : /bzip2//bzip2 ; - libraries-to-install += boost_bzip2 ; } } else