From a7686cbe3a587081f14b3c8c228f260fbcdffba5 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Fri, 17 Aug 2012 09:08:07 -0400 Subject: Fall back on unversioned Boost if necessary --- jam-files/sanity.jam | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 809a186b..8ccfc65d 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -101,18 +101,16 @@ else { } } -#Are we linking static binaries against shared boost? -boost-auto-shared = [ auto-shared "boost_program_options" : $(L-boost-search) ] ; #Convenience rule for boost libraries. Defines library boost_$(name). rule boost-lib ( name macro : deps * ) { #Link multi-threaded programs against the -mt version if available. Old #versions of boost do not have -mt tagged versions of all libraries. Sadly, #boost.jam does not handle this correctly. - if [ test_flags $(L-boost-search)" -lboost_"$(name)"-mt-$(boost-lib-version)" ] { - lib inner_boost_$(name) : : single $(boost-search) boost_$(name)-$(boost-lib-version) : : $(deps) ; - lib inner_boost_$(name) : : multi $(boost-search) boost_$(name)-mt-$(boost-lib-version) : : $(deps) ; + if [ test_flags $(L-boost-search)" -lboost_"$(name)"-mt$(boost-lib-version)" ] { + lib inner_boost_$(name) : : single $(boost-search) boost_$(name)$(boost-lib-version) : : $(deps) ; + lib inner_boost_$(name) : : multi $(boost-search) boost_$(name)-mt$(boost-lib-version) : : $(deps) ; } else { - lib inner_boost_$(name) : : $(boost-search) boost_$(name)-$(boost-lib-version) : : $(deps) ; + lib inner_boost_$(name) : : $(boost-search) boost_$(name)$(boost-lib-version) : : $(deps) ; } alias boost_$(name) : inner_boost_$(name) : $(boost-auto-shared) : : shared:BOOST_$(macro) $(boost-include) ; @@ -130,7 +128,17 @@ rule boost ( min-version ) { if $(boost-version) < $(min-version) && $(CLEANING) = no { exit You have Boost $(boost-version). This package requires Boost at least $(min-version) (and preferably newer). : 1 ; } + # If matching version tags exist, use them. boost-lib-version = [ MATCH "#define BOOST_LIB_VERSION \"([^\"]*)\"" : $(boost-shell[1]) ] ; + if [ test_flags $(L-boost-search)" -lboost_program_options-"$(boost-lib-version) ] { + boost-lib-version = "-"$(boost-lib-version) ; + } else { + boost-lib-version = "" ; + } + + #Are we linking static binaries against shared boost? + boost-auto-shared = [ auto-shared "boost_program_options"$(boost-lib-version) : $(L-boost-search) ] ; + #See tools/build/v2/contrib/boost.jam in a boost distribution for a table of macros to define. boost-lib system SYSTEM_DYN_LINK ; boost-lib thread THREAD_DYN_DLL : boost_system ; -- cgit v1.2.3