diff --git a/build.jam b/build.jam new file mode 100644 index 0000000..5d158b1 --- /dev/null +++ b/build.jam @@ -0,0 +1,20 @@ +# Copyright René Ferdinand Rivera Morell 2024 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +require-b2 5.2 ; + +project /boost/headers + ; + +explicit + [ alias boost_headers : build//boost_headers ] + [ alias install : build//install ] + [ alias stage : build//stage ] + [ alias all : boost_headers stage ] + ; + +call-if : boost-library headers + ; + diff --git a/build/Jamfile b/build/Jamfile index c116a69..77cefc1 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -2,12 +2,20 @@ # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) +require-b2 5.2 ; + import package ; import path ; import sequence ; import set ; -import ../../../tools/boost_install/boost-install ; -import ../../../tools/boost_install/boost-install-dirs ; +import project ; +import regex ; + +import-search /boost/boost_install ; +import boost-install ; +import boost-install-dirs ; + +path-constant LIBS_ROOT : ../.. ; # header-subdir @@ -18,13 +26,17 @@ header-subdir ?= "" ; # first, the 'modular' headers -local modular-headers = $(BOOST_MODULARLAYOUT) ; +local modular-headers + = [ SORT [ MATCH .*libs/(.*)/include/boost : [ glob + $(LIBS_ROOT)/*/include/boost + $(LIBS_ROOT)/numeric/*/include/boost + ] ] ] ; local skip-headers ; for local lib in $(modular-headers) { - local header-root = $(BOOST_ROOT)/libs/$(lib)/include ; + local header-root = $(LIBS_ROOT)/$(lib)/include ; local header-boost = $(header-root)/boost ; local headers = @@ -46,11 +58,17 @@ for local lib in $(modular-headers) # then, the non-modular headers in boost/, minus the modular ones -local header-root = [ path.make $(BOOST_ROOT) ] ; +local headers ; +local header-root ; + +if $(BOOST_ROOT) +{ + header-root = [ path.make $(BOOST_ROOT) ] ; -local headers = - [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc ] - [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* ] ; + headers = + [ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc ] + [ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* ] ; +} headers = [ set.difference $(headers) : $(header-root)/$(skip-headers) ] ; @@ -64,6 +82,26 @@ install install-boost-headers explicit install-boost-headers ; +# Boost version format: XYYYZZ + +if ! [ modules.peek boostcpp : BOOST_VERSION ] +{ + local boost-config = [ project.search /boost/config ] ; + ECHO "[INFO] boost-config:" $(boost-config) ; + if $(boost-config) + { + local boost-version-num = [ regex.grep + [ path.native [ path.join $(boost-config) include boost ] ] + : version.hpp : "BOOST_VERSION ([0-9]+)" : 1 ] ; + boost-version-num = [ MATCH "(.*)(...)(..)" : $(boost-version-num[2]) ] ; + boost-version-num = + [ CALC $(boost-version-num[1]) + 0 ] + [ CALC $(boost-version-num[2]) + 0 ] + [ CALC $(boost-version-num[3]) + 0 ] ; + modules.poke boostcpp : BOOST_VERSION : $(boost-version-num:J=.) ; + } +} + # alias install-headers : install-$(modular-headers)-headers install-boost-headers ;