diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-01-24 16:07:46 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-01-24 16:07:46 +0400 |
commit | 03b077364a39b367a125092418278e9f4240c35f (patch) | |
tree | 4b410417dfec95f5bb1bf3f8ad1c3aad870bb979 /jam-files/sanity.jam | |
parent | 22bf1c77e9866f5010708b288a33957a24627481 (diff) |
KenLM 31a6644 resizable probing hash table, build fixes
Diffstat (limited to 'jam-files/sanity.jam')
-rw-r--r-- | jam-files/sanity.jam | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index d3ebe4ecb..7f9c45d83 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -27,9 +27,12 @@ cflags = [ os.environ "CFLAGS" ] ; ldflags = [ os.environ "LDFLAGS" ] ; #Run g++ with empty main and these arguments to see if it passes. -rule test_flags ( flags * ) { +rule test_flags ( flags * : main ? ) { flags = $(cxxflags) $(ldflags) $(flags) ; - local cmd = "bash -c \"g++ "$(flags:J=" ")" -x c++ - <<<'int main() {}' -o $(TOP)/dummy >/dev/null 2>/dev/null && rm $(TOP)/dummy 2>/dev/null\"" ; + if ! $(main) { + main = "int main() {}" ; + } + local cmd = "bash -c \"g++ "$(flags:J=" ")" -x c++ - <<<'$(main)' -o $(TOP)/dummy >/dev/null 2>/dev/null && rm $(TOP)/dummy 2>/dev/null\"" ; local ret = [ SHELL $(cmd) : exit-status ] ; if --debug-configuration in [ modules.peek : ARGV ] { echo $(cmd) ; @@ -119,18 +122,29 @@ rule boost-lib ( name macro : deps * ) { #versions of boost do not have -mt tagged versions of all libraries. Sadly, #boost.jam does not handle this correctly. flags = $(L-boost-search)" -lboost_"$(name)"-mt$(boost-lib-version)" ; - if $(boost-auto-shared) != "<link>shared" { + local main ; + if $(name) = "unit_test_framework" { + 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)" ; + } else { flags += " -static" ; } - if [ test_flags $(flags) ] { + 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) ; } else { lib inner_boost_$(name) : : $(boost-search) <name>boost_$(name)$(boost-lib-version) : : <library>$(deps) ; } - alias boost_$(name) : inner_boost_$(name) : $(boost-auto-shared) : : <link>shared:<define>BOOST_$(macro) ; - requirements += <link>shared:<define>BOOST_$(macro) ; + if $(boost-auto-shared) = "<link>shared" { + alias boost_$(name) : inner_boost_$(name) : <link>shared ; + requirements += <define>BOOST_$(macro) ; + } else { + alias boost_$(name) : inner_boost_$(name) : <link>static ; + } } #Argument is e.g. 103600 |