diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-08-27 02:36:53 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-08-27 02:36:53 +0400 |
commit | c60e953e1e2e0c038c4aaa467390e8fdab3c9623 (patch) | |
tree | 9c5962d4b1fba0622466fac124145c3ea4121e52 /jam-files/sanity.jam | |
parent | 02c9d448ea416d897f632009e362be8954907459 (diff) |
Kludgy fix to force boost libraries to be static by default
Diffstat (limited to 'jam-files/sanity.jam')
-rw-r--r-- | jam-files/sanity.jam | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 04542409a..a9abac9d4 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -73,17 +73,30 @@ rule test_library ( name ) { constant CLEANING : $(cleaning) ; } +shared-command-line = ; +local argv = [ modules.peek : ARGV ] ; +while $(argv) { + if $(argv[1]) = "link=shared" { + shared-command-line = <link>shared ; + } + argv = $(argv[2-]) ; +} + #Determine if a library can be compiled statically. rule auto-shared ( name : additional * ) { additional ?= "" ; - if [ test_flags $(additional)" -static -l"$(name) ] { - return ; + if $(shared-command-line) = "<link>shared" { + return "<link>shared" ; } else { - if $(FORCE-STATIC) { - echo "Could not statically link against lib $(name). Your build will probably fail." ; + if [ test_flags $(additional)" -static -l"$(name) ] { return ; } else { - return "<link>shared" ; + if $(FORCE-STATIC) { + echo "Could not statically link against lib $(name). Your build will probably fail." ; + return ; + } else { + return "<link>shared" ; + } } } } @@ -133,8 +146,8 @@ rule boost-lib ( name macro : deps * ) { flags += " -static" ; } if [ test_flags $(flags) : $(main) ] { - lib inner_boost_$(name) : : <threading>single $(boost-search) <name>boost_$(name)$(boost-lib-version) : : <library>$(deps) ; - lib inner_boost_$(name) : : <threading>multi $(boost-search) <name>boost_$(name)-mt$(boost-lib-version) : : <library>$(deps) ; + 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)-mt$(boost-lib-version) : <link>static : <library>$(deps) ; } else { lib inner_boost_$(name) : : $(boost-search) <name>boost_$(name)$(boost-lib-version) : : <library>$(deps) ; } @@ -143,7 +156,7 @@ rule boost-lib ( name macro : deps * ) { alias boost_$(name) : inner_boost_$(name) : <link>shared ; requirements += <define>BOOST_$(macro) ; } else { - alias boost_$(name) : inner_boost_$(name) : : : <link>shared:<define>BOOST_$(macro) ; + alias boost_$(name) : inner_boost_$(name) : <link>static ; } } |