From 465c5cbf97c63585daef93c29fb90f14a763cbfd Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 31 May 2012 12:55:05 +0100 Subject: move all executables into bin --- jam-files/sanity.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 7b93cf36f..76763f98d 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -159,7 +159,7 @@ prefix = [ option.get "prefix" ] ; if $(prefix) { prefix = [ path.root $(prefix) [ path.pwd ] ] ; } else { - prefix = $(TOP)/dist$(GITTAG) ; + prefix = $(TOP)$(GITTAG) ; } rule install-bin-libs ( deps * ) { local bindir = [ option.get "bindir" : $(prefix)/bin ] ; -- cgit v1.2.3 From f716673f6765b2ce5c04b716e21cf233b4e17c8f Mon Sep 17 00:00:00 2001 From: Barry Haddow Date: Thu, 31 May 2012 22:58:39 +0100 Subject: Allow combination of --prefix and --git --- jam-files/sanity.jam | 2 ++ 1 file changed, 2 insertions(+) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 76763f98d..35caf4602 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -158,9 +158,11 @@ if [ option.get "git" : : "yes" ] { prefix = [ option.get "prefix" ] ; if $(prefix) { prefix = [ path.root $(prefix) [ path.pwd ] ] ; + prefix = $(prefix)$(GITTAG) ; } else { prefix = $(TOP)$(GITTAG) ; } + rule install-bin-libs ( deps * ) { local bindir = [ option.get "bindir" : $(prefix)/bin ] ; local libdir = [ option.get "libdir" : $(prefix)/lib ] ; -- cgit v1.2.3 From 272aeaa67e1110bd2c913c9c35d04eb4b31e696c Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Thu, 21 Jun 2012 09:52:25 -0400 Subject: Merge some build system changes that were made for cdec --- jam-files/sanity.jam | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'jam-files') 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 = $(with-boost)/lib $(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) $(cflags) $(ldflags) LINUX,clang: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) : $(bindir) on EXE shared:$(libdir) ; install prefix-lib : $(deps) : $(libdir) on LIB shared:$(libdir) ; } @@ -174,3 +184,9 @@ rule install-headers ( name : list * : source-root ? ) { source-root ?= "." ; install $(name) : $(list) : $(includedir) $(source-root) ; } + +rule build-projects ( projects * ) { + for p in $(projects) { + build-project $(p) ; + } +} -- cgit v1.2.3 From be2b2224fb3828e000b0bb04f90c6cc505e4d7d4 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 2 Jul 2012 12:56:14 -0400 Subject: Extract hack to force recompilation if arguments change --- jam-files/sanity.jam | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 8c9715ac0..1080f9f3d 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -3,6 +3,7 @@ import option ; import os ; import path ; import project ; +import build-system ; #Shell with trailing line removed http://lists.boost.org/boost-build/2007/08/17051.php rule trim-nl ( str extras * ) { @@ -186,7 +187,59 @@ rule install-headers ( name : list * : source-root ? ) { } rule build-projects ( projects * ) { - for p in $(projects) { + for local p in $(projects) { build-project $(p) ; } } + +#Only one post build hook is allowed. Allow multiple. +post-hooks = ; +rule post-build ( ok ? ) { + for local r in $(post-hooks) { + $(r) $(ok) ; + } +} +IMPORT $(__name__) : post-build : : $(__name__).post-build ; +build-system.set-post-build-hook $(__name__).post-build ; +rule add-post-hook ( names * ) { + post-hooks += $(names) ; +} + + +#Backend for writing content to files after build completes. +post-files = ; +post-contents = ; +rule save-post-build ( ok ? ) { + if $(ok) { + while $(post-files) { + local ignored = @($(post-files[1]):E=$(post-contents[1])) ; + post-files = $(post-files[2-]) ; + post-contents = $(post-contents[2-]) ; + } + } +} +add-post-hook save-post-build ; + +#Queue content to be written to file when build completes successfully. +rule add-post-write ( name content ) { + post-files += $(name) ; + post-contents += $(content) ; +} + +#Compare contents of file with current. If they're different, force the targets to rebuild then overwrite the file. +rule always-if-changed ( file current : targets * ) { + local previous = inconsistent ; + if [ path.exists $(file) ] { + previous = [ _shell "cat $(file)" ] ; + } + if $(current) != $(previous) { + #Write inconsistent while the build is running + if [ path.exists $(file) ] { + local ignored = @($(file):E=inconsistent) ; + } + add-post-write $(file) $(current) ; + for local i in $(targets) { + always $(i) ; + } + } +} -- cgit v1.2.3 From b9d4cc9af37ef9c3b72a28d74022d5e4556439bf Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Tue, 3 Jul 2012 12:14:41 -0400 Subject: Alexander Fraser: Boost thread depends on Boost system. --- jam-files/sanity.jam | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 1080f9f3d..1bdee3dca 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -91,15 +91,15 @@ 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 ) { +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" ] { - lib inner_boost_$(name) : : single $(boost-search) boost_$(name) ; - lib inner_boost_$(name) : : multi $(boost-search) boost_$(name)-mt ; + lib inner_boost_$(name) : $(deps) : single $(boost-search) boost_$(name) ; + lib inner_boost_$(name) : $(deps) : multi $(boost-search) boost_$(name)-mt ; } else { - lib inner_boost_$(name) : : $(boost-search) boost_$(name) ; + lib inner_boost_$(name) : $(deps) : $(boost-search) boost_$(name) ; } alias boost_$(name) : inner_boost_$(name) : $(boost-auto-shared) : : shared:BOOST_$(macro) $(boost-include) ; @@ -118,7 +118,8 @@ rule boost ( min-version ) { exit You have Boost $(boost-version). This package requires Boost at least $(min-version) (and preferably newer). : 1 ; } #See tools/build/v2/contrib/boost.jam in a boost distribution for a table of macros to define. - boost-lib thread THREAD_DYN_DLL ; + 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 TEST_DYN_LINK ; boost-lib iostreams IOSTREAMS_DYN_LINK ; -- cgit v1.2.3 From f592c222fec19e41fcfb9c059c81de2077b971fe Mon Sep 17 00:00:00 2001 From: Eva Hasler Date: Wed, 4 Jul 2012 12:25:21 +0100 Subject: revert mode changes --- jam-files/engine/debian/rules | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 jam-files/engine/debian/rules (limited to 'jam-files') diff --git a/jam-files/engine/debian/rules b/jam-files/engine/debian/rules old mode 100644 new mode 100755 -- cgit v1.2.3 From a73dc0e5b4d7d580609fa630e89663fb3fa5b047 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Tue, 17 Jul 2012 04:40:32 -0400 Subject: Attempt to fix missing boost_system for some people with 1.50 --- jam-files/sanity.jam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 1bdee3dca..c846bec6c 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -96,10 +96,10 @@ 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. if [ test_flags $(L-boost-search)" -lboost_"$(name)"-mt" ] { - lib inner_boost_$(name) : $(deps) : single $(boost-search) boost_$(name) ; - lib inner_boost_$(name) : $(deps) : multi $(boost-search) boost_$(name)-mt ; + lib inner_boost_$(name) : : single $(boost-search) boost_$(name) : : $(deps) ; + lib inner_boost_$(name) : : multi $(boost-search) boost_$(name)-mt : : $(deps) ; } else { - lib inner_boost_$(name) : $(deps) : $(boost-search) boost_$(name) ; + lib inner_boost_$(name) : : $(boost-search) boost_$(name) : : $(deps) ; } alias boost_$(name) : inner_boost_$(name) : $(boost-auto-shared) : : shared:BOOST_$(macro) $(boost-include) ; -- cgit v1.2.3 From 97f46537b7bb7ebe33d842931257fa7fea54966a Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Mon, 30 Jul 2012 21:07:19 +0100 Subject: wrap phi's suffix array implementation and extraction method in a wrapper class. Compiles --- jam-files/sanity.jam | 1 + 1 file changed, 1 insertion(+) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index c846bec6c..9e68a6c8f 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -123,6 +123,7 @@ rule boost ( min-version ) { boost-lib program_options PROGRAM_OPTIONS_DYN_LINK ; boost-lib unit_test_framework TEST_DYN_LINK ; boost-lib iostreams IOSTREAMS_DYN_LINK ; + boost-lib filesystem FILE_SYSTEM_DYN_LINK ; } #Link normally to a library, but sometimes static isn't installed so fall back to dynamic. -- cgit v1.2.3 From edf34e9d35425ca627ed19e1415172258ca82cc5 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 30 Jul 2012 16:47:30 -0400 Subject: Loosen requirements for system bjam versions / Tom Hoar --- jam-files/sanity.jam | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index c846bec6c..817e52689 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -4,6 +4,7 @@ import os ; import path ; import project ; import build-system ; +import version ; #Shell with trailing line removed http://lists.boost.org/boost-build/2007/08/17051.php rule trim-nl ( str extras * ) { @@ -244,3 +245,12 @@ rule always-if-changed ( file current : targets * ) { } } } + +if [ option.get "sanity-test" : : "yes" ] { + local current_version = [ modules.peek : JAM_VERSION ] ; + if ( $(current_version[0]) < 2000 && [ version.check-jam-version 3 1 16 ] ) || [ version.check-jam-version 2011 0 0 ] { + EXIT "Sane" : 0 ; + } else { + EXIT "Bad" : 1 ; + } +} -- cgit v1.2.3 From 0c484ec8e71f430e2d49693144e770d5256583de Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 6 Aug 2012 08:15:04 -0400 Subject: New --nosegfault option for Tom Hoar --- jam-files/sanity.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 419a451ea..567a3b2e9 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -151,7 +151,7 @@ rule external-lib ( name : search-path * ) { } requirements = ; -{ +if [ option.get "nosegfault" : "false" : "true" ] = "false" { #Boost jam's static clang for Linux is buggy. requirements += $(cxxflags) $(cflags) $(ldflags) LINUX,clang:shared ; -- cgit v1.2.3 From b52ed110b02dff440512ee241211f7f0238e82d1 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 6 Aug 2012 10:41:49 -0400 Subject: Build changes. --static will force static linkage. --without-libsegfault will skip libSegFault. --- jam-files/sanity.jam | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 567a3b2e9..7c4cc0bec 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -54,11 +54,15 @@ rule test_library ( name ) { #Determine if a library can be compiled statically. rule auto-shared ( name : additional * ) { - additional ?= "" ; - if [ test_flags $(additional)" -static -l"$(name) ] { + if [ option.get "static" : : "yes" ] { return ; } else { - return "shared" ; + additional ?= "" ; + if [ test_flags $(additional)" -static -l"$(name) ] { + return ; + } else { + return "shared" ; + } } } @@ -151,10 +155,10 @@ rule external-lib ( name : search-path * ) { } requirements = ; -if [ option.get "nosegfault" : "false" : "true" ] = "false" { - #Boost jam's static clang for Linux is buggy. - requirements += $(cxxflags) $(cflags) $(ldflags) LINUX,clang:shared ; +#Boost jam's static clang for Linux is buggy. +requirements += $(cxxflags) $(cflags) $(ldflags) LINUX,clang:shared ; +if ! [ option.get "without-libsegfault" : : "yes" ] && ! [ option.get "static" : : "yes" ] { #libSegFault prints a stack trace on segfault. Link against it if available. if [ test_flags "-lSegFault" ] { external-lib SegFault ; -- cgit v1.2.3 From 2556c8079a3a66bfe8139019769428f38a41c130 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 6 Aug 2012 12:21:16 -0400 Subject: When used with --static, also add static. --- jam-files/sanity.jam | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 7c4cc0bec..fe7f21703 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -52,13 +52,21 @@ rule test_library ( name ) { constant CLEANING : $(cleaning) ; } +requirements = ; + +FORCE-STATIC = [ option.get "static" : : "yes" ] ; +if $(FORCE-STATIC) { + requirements += static ; +} + #Determine if a library can be compiled statically. rule auto-shared ( name : additional * ) { - if [ option.get "static" : : "yes" ] { + additional ?= "" ; + if [ test_flags $(additional)" -static -l"$(name) ] { return ; } else { - additional ?= "" ; - if [ test_flags $(additional)" -static -l"$(name) ] { + if $(FORCE-STATIC) { + echo "Could not statically link against lib $(name). Your build will probably fail." ; return ; } else { return "shared" ; @@ -154,11 +162,10 @@ rule external-lib ( name : search-path * ) { local ignored = @($(build-log):E=$(script)) ; } -requirements = ; #Boost jam's static clang for Linux is buggy. requirements += $(cxxflags) $(cflags) $(ldflags) LINUX,clang:shared ; -if ! [ option.get "without-libsegfault" : : "yes" ] && ! [ option.get "static" : : "yes" ] { +if ! [ option.get "without-libsegfault" : : "yes" ] && ! $(FORCE-STATIC) { #libSegFault prints a stack trace on segfault. Link against it if available. if [ test_flags "-lSegFault" ] { external-lib SegFault ; -- cgit v1.2.3 From 4637c4f64262a1640fb47d4af44ee29962025b90 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Thu, 16 Aug 2012 17:22:44 -0400 Subject: Get the Boost version tag from version.hpp and include it in the name of the Boost libraries. This will force people to use consistent headers and libraries and might fix some cases where a user has installed libraries locally on top of a system-level install. --- jam-files/sanity.jam | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index fe7f21703..809a186b6 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -108,11 +108,11 @@ 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" ] { - lib inner_boost_$(name) : : single $(boost-search) boost_$(name) : : $(deps) ; - lib inner_boost_$(name) : : multi $(boost-search) boost_$(name)-mt : : $(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) : : $(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) ; @@ -120,7 +120,7 @@ rule boost-lib ( name macro : deps * ) { #Argument is e.g. 103600 rule boost ( min-version ) { - local cmd = "bash -c \"g++ "$(I-boost-include)" -dM -x c++ -E /dev/null -include boost/version.hpp 2>/dev/null |grep '#define BOOST_VERSION '\"" ; + local cmd = "bash -c \"g++ "$(I-boost-include)" -dM -x c++ -E /dev/null -include boost/version.hpp 2>/dev/null |grep '#define BOOST_'\"" ; local boost-shell = [ SHELL "$(cmd)" : exit-status ] ; if $(boost-shell[2]) != 0 && $(CLEANING) = no { echo Failed to run "$(cmd)" ; @@ -130,6 +130,7 @@ 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 ; } + boost-lib-version = [ MATCH "#define BOOST_LIB_VERSION \"([^\"]*)\"" : $(boost-shell[1]) ] ; #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 From 1a57ceeb1e7f9913a4ea0f0de37a322645c9d2eb Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Fri, 17 Aug 2012 08:48:01 -0400 Subject: Fall back on unversioned Boost --- jam-files/sanity.jam | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 809a186b6..8ccfc65d3 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 From be76c67f96aa123ab7dda613f4a3b9f9d1beb329 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Sun, 9 Sep 2012 12:00:13 +0100 Subject: Old buggy bjam always returns 0. Detect+reject. http://boost.2283326.n4.nabble.com/bjam-exit-code-always-zero-td2696668.html --- jam-files/fail/Jamroot | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 jam-files/fail/Jamroot (limited to 'jam-files') diff --git a/jam-files/fail/Jamroot b/jam-files/fail/Jamroot new file mode 100644 index 000000000..c3584d896 --- /dev/null +++ b/jam-files/fail/Jamroot @@ -0,0 +1,4 @@ +actions fail { + false +} +make fail : : fail ; -- cgit v1.2.3 From 968ab98f0cfc5890ec8c2d4cfff364263e0ac326 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Tue, 11 Sep 2012 10:43:28 +0100 Subject: Make --with-regtest work without an argument, fix path handling --- jam-files/sanity.jam | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 8ccfc65d3..7d62bfd40 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -15,6 +15,13 @@ rule _shell ( cmd : extras * ) { return [ trim-nl [ SHELL $(cmd) : $(extras) ] ] ; } +rule shell_or_fail ( cmd ) { + local ret = [ SHELL $(cmd) : exit-status ] ; + if $(ret[2]) != 0 { + exit $(cmd) failed : 1 ; + } +} + cxxflags = [ os.environ "CXXFLAGS" ] ; cflags = [ os.environ "CFLAGS" ] ; ldflags = [ os.environ "LDFLAGS" ] ; -- cgit v1.2.3 From 15b0ae1aef6173e9e78301ea5a689cd6f3878c3c Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Fri, 21 Sep 2012 18:34:48 -0400 Subject: Single-threaded compilation fixes --- jam-files/sanity.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 7d62bfd40..a2616f6bf 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -152,7 +152,7 @@ rule boost ( min-version ) { boost-lib program_options PROGRAM_OPTIONS_DYN_LINK ; boost-lib unit_test_framework TEST_DYN_LINK ; boost-lib iostreams IOSTREAMS_DYN_LINK ; - boost-lib filesystem FILE_SYSTEM_DYN_LINK ; + boost-lib filesystem FILE_SYSTEM_DYN_LINK : boost_system ; } #Link normally to a library, but sometimes static isn't installed so fall back to dynamic. -- cgit v1.2.3 From bc866f37ff13251e9c8cf8548669f788449d9238 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Wed, 26 Sep 2012 19:14:26 +0100 Subject: New approach to forcing recompiles Fixes annoying problem that unsuccessful build iterations would keep rebuilding Factory.o and CompactPT --- jam-files/sanity.jam | 47 +++++++++++++---------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) (limited to 'jam-files') diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index a2616f6bf..6beec3f94 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -235,42 +235,21 @@ rule add-post-hook ( names * ) { post-hooks += $(names) ; } - -#Backend for writing content to files after build completes. -post-files = ; -post-contents = ; -rule save-post-build ( ok ? ) { - if $(ok) { - while $(post-files) { - local ignored = @($(post-files[1]):E=$(post-contents[1])) ; - post-files = $(post-files[2-]) ; - post-contents = $(post-contents[2-]) ; - } - } -} -add-post-hook save-post-build ; - -#Queue content to be written to file when build completes successfully. -rule add-post-write ( name content ) { - post-files += $(name) ; - post-contents += $(content) ; +import feature : feature ; +feature options-to-write : : free ; +import toolset : flags ; +flags write-options OPTIONS-TO-WRITE ; +actions write-options { + echo "$(OPTIONS-TO-WRITE)" > $(<) ; } -#Compare contents of file with current. If they're different, force the targets to rebuild then overwrite the file. -rule always-if-changed ( file current : targets * ) { - local previous = inconsistent ; - if [ path.exists $(file) ] { - previous = [ _shell "cat $(file)" ] ; - } - if $(current) != $(previous) { - #Write inconsistent while the build is running - if [ path.exists $(file) ] { - local ignored = @($(file):E=inconsistent) ; - } - add-post-write $(file) $(current) ; - for local i in $(targets) { - always $(i) ; - } +#Compare contents of file with current. If they're different, write to the +#file. This file can then be used with $(file) to force +#recompilation. +rule update-if-changed ( file current ) { + if ( ! [ path.exists $(file) ] ) || ( [ _shell "cat $(file)" ] != $(current) ) { + make $(file) : : $(__name__).write-options : $(current) ; + always $(file) ; } } -- cgit v1.2.3