diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-05-10 19:44:58 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-05-10 19:44:58 +0400 |
commit | 80e3198dd2d41245e88b5d26dc453bcde498d16e (patch) | |
tree | 717bad24fe4365e4b13ddbdc4b414971e8ba4776 /jam-files | |
parent | b9b1517e4f050eae4a9de8a9625de7ea343d6202 (diff) |
Fix autodetection for non-bash users
Diffstat (limited to 'jam-files')
-rw-r--r-- | jam-files/sanity.jam | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam index 47724461a..441a50430 100644 --- a/jam-files/sanity.jam +++ b/jam-files/sanity.jam @@ -20,7 +20,12 @@ rule _shell ( cmd : extras * ) { #Run g++ with empty main and these arguments to see if it passes. rule test_flags ( flags * ) { - local ret = [ SHELL "g++ "$(flags:J=" ")" -x c++ - <<<'int main() {}' -o /dev/null >/dev/null 2>/dev/null" : exit-status ] ; + 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 ] { + echo $(cmd) ; + echo $(ret) ; + } if $(ret[2]) = 0 { return true ; } else { @@ -92,8 +97,10 @@ rule boost-lib ( name macro ) { #Argument is e.g. 103600 rule boost ( min-version ) { - local boost-shell = [ SHELL "g++ "$(I-boost-include)" -dM -x c++ -E /dev/null -include boost/version.hpp 2>/dev/null |grep '#define BOOST_VERSION '" : exit-status ] ; + 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 boost-shell = [ SHELL "$(cmd)" : exit-status ] ; if $(boost-shell[2]) != 0 && $(CLEANING) = no { + echo Failed to run "$(cmd)" ; exit Boost does not seem to be installed or g++ is confused. : 1 ; } boost-version = [ MATCH "#define BOOST_VERSION ([0-9]*)" : $(boost-shell[1]) ] ; @@ -138,7 +145,7 @@ requirements = ; requirements += <cxxflags>$(cxxflags) <cflags>$(cflags) <linkflags>$(ldflags) <os>LINUX,<link>static,<toolset>clang:<linkflags>-static ; #libSegFault prints a stack trace on segfault. Link against it if available. - if [ test_flags "-lSegfault" ] { + if [ test_flags "-lSegFault" ] { external-lib SegFault ; requirements += <library>SegFault ; } |