diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-06-21 17:52:25 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-06-21 17:52:25 +0400 |
commit | 272aeaa67e1110bd2c913c9c35d04eb4b31e696c (patch) | |
tree | 71d8c99c9abbf04bdaefcf1a23ad02c663b0bd37 /jam-files/sanity.jam | |
parent | 2d3b4d9b7c6f08d014bb430450fa5ea0cecf4b3b (diff) |
Merge some build system changes that were made for cdec
Diffstat (limited to 'jam-files/sanity.jam')
-rw-r--r-- | jam-files/sanity.jam | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 35caf4602..8c9715ac0 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -13,8 +13,13 @@ rule _shell ( cmd : extras * ) { return [ trim-nl [ SHELL $(cmd) : $(extras) ] ] ; } +cxxflags = [ os.environ "CXXFLAGS" ] ; +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 * ) { + flags = $(cxxflags) $(ldflags) $(flags) ; local cmd = "bash -c \"g++ "$(flags:J=" ")" -x c++ - <<<'int main() {}' -o /dev/null >/dev/null 2>/dev/null\"" ; local ret = [ SHELL $(cmd) : exit-status ] ; if --debug-configuration in [ modules.peek : ARGV ] { @@ -28,6 +33,14 @@ rule test_flags ( flags * ) { } } +rule test_header ( name ) { + return [ test_flags "-include $(name)" ] ; +} + +rule test_library ( name ) { + return [ test_flags "-l$(name)" ] ; +} + { local cleaning = [ option.get "clean" : : yes ] ; cleaning ?= [ option.get "clean-all" : no : yes ] ; @@ -60,6 +73,7 @@ if $(with-macports) { } else { with-boost = [ option.get "with-boost" ] ; + with-boost ?= [ os.environ "BOOST_ROOT" ] ; if $(with-boost) { L-boost-search = -L$(with-boost)/lib" "-L$(with-boost)/lib64 ; boost-search = <search>$(with-boost)/lib <search>$(with-boost)/lib64 ; @@ -134,10 +148,6 @@ rule external-lib ( name : search-path * ) { requirements = ; { - local cxxflags = [ os.environ "CXXFLAGS" ] ; - local cflags = [ os.environ "CFLAGS" ] ; - local ldflags = [ os.environ "LDFLAGS" ] ; - #Boost jam's static clang for Linux is buggy. requirements += <cxxflags>$(cxxflags) <cflags>$(cflags) <linkflags>$(ldflags) <os>LINUX,<toolset>clang:<link>shared ; @@ -163,9 +173,9 @@ if $(prefix) { prefix = $(TOP)$(GITTAG) ; } +bindir = [ option.get "bindir" : $(prefix)/bin ] ; +libdir = [ option.get "libdir" : $(prefix)/lib ] ; rule install-bin-libs ( deps * ) { - local bindir = [ option.get "bindir" : $(prefix)/bin ] ; - local libdir = [ option.get "libdir" : $(prefix)/lib ] ; install prefix-bin : $(deps) : <location>$(bindir) <install-dependencies>on <install-type>EXE <link>shared:<dll-path>$(libdir) ; install prefix-lib : $(deps) : <location>$(libdir) <install-dependencies>on <install-type>LIB <link>shared:<dll-path>$(libdir) ; } @@ -174,3 +184,9 @@ rule install-headers ( name : list * : source-root ? ) { source-root ?= "." ; install $(name) : $(list) : <location>$(includedir) <install-source-root>$(source-root) ; } + +rule build-projects ( projects * ) { + for p in $(projects) { + build-project $(p) ; + } +} |