diff --git a/bjam b/bjam index 1cea4fb15..eda8970dc 100755 --- a/bjam +++ b/bjam @@ -4,8 +4,7 @@ if bjam="$(which bjam 2>/dev/null)" && #exists [ ${#bjam} != 0 ] && #paranoia about which printing nothing then returning true ! grep UFIHGUFIHBDJKNCFZXAEVA "${bjam}" /dev/null && #bjam in path isn't this script - "${bjam}" --version |grep "Boost.Build 201" >/dev/null 2>/dev/null && #It's recent enough. - "${bjam}" --help >/dev/null 2>/dev/null #bjam in path isn't broken (i.e. has boost-build) + "${bjam}" --sanity-test 2>/dev/null |grep Sane >/dev/null #The test in jam-files/sanity.jam passes then #Delegate to system bjam exec "${bjam}" "$@" 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 ; + } +}