diff options
author | Kenneth Heafield <github@kheafield.com> | 2015-02-16 21:27:26 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2015-02-16 21:49:01 +0300 |
commit | 93ab057eda69a7915efbc9fa92d4ce6341e6ca02 (patch) | |
tree | 45c2b9dc46aac9f0ee29a58075aac1d51c74f56d /jam-files/sanity.jam | |
parent | 87a4f1954619a4a7eec531349e0865b245df7a0b (diff) |
Try to fix Boost static/dynamic linkage
Diffstat (limited to 'jam-files/sanity.jam')
-rw-r--r-- | jam-files/sanity.jam | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 23ed94e40..5bc790462 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -137,24 +137,15 @@ rule boost-lib ( name macro : deps * ) { main = "BOOST_AUTO_TEST_CASE(foo) {}" ; flags += " -DBOOST_TEST_MODULE=CompileTest $(I-boost-include) -include boost/test/unit_test.hpp" ; } - if $(boost-auto-shared) = "<link>shared" { - flags += " -DBOOST_$(macro)" ; + local default-linkage ; + if [ test_flags " -Wl,-Bstatic $(flags) -Wl,-Bdynamic " : $(main) ] { + default-linkage = "<link>static" ; } else { - flags = " -Wl,-Bstatic $(flags) -Wl,-Bdynamic " ; - } - if [ test_flags $(flags) : $(main) ] { - lib inner_boost_$(name) : : <threading>single $(boost-search) <name>boost_$(name)$(boost-lib-version) : <link>static : <library>$(deps) ; - lib inner_boost_$(name) : : <threading>multi $(boost-search) <name>boost_$(name)$(boost-lib-version) : <link>static : <library>$(deps) ; - } else { - lib inner_boost_$(name) : : $(boost-search) <name>boost_$(name)$(boost-lib-version) : : <library>$(deps) ; - } - - if $(boost-auto-shared) = "<link>shared" { - alias boost_$(name) : inner_boost_$(name) : <link>shared ; + default-linkage = "<link>shared" ; requirements += <define>BOOST_$(macro) ; - } else { - alias boost_$(name) : inner_boost_$(name) : <link>static ; } + lib boost_$(name) : $(deps) : <link>static $(boost-search) <name>boost_$(name)$(boost-lib-version) : $(default-linkage) ; + lib boost_$(name) : $(deps) : <link>shared $(boost-search) <name>boost_$(name)$(boost-lib-version) <define>BOOST_$(macro) : $(default-linkage) : <define>BOOST_$(macro) ; } #Argument is e.g. 103600 @@ -177,14 +168,11 @@ rule boost ( min-version ) { 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 ; boost-lib program_options PROGRAM_OPTIONS_DYN_LINK ; - boost-lib unit_test_framework DELETE_ME_TEST_DYN_LINK ; + boost-lib unit_test_framework TEST_DYN_LINK ; boost-lib iostreams IOSTREAMS_DYN_LINK ; boost-lib filesystem FILE_SYSTEM_DYN_LINK ; # if $(BOOST-VERSION) >= 104800 { |