Loosen requirements for system bjam versions / Tom Hoar

This commit is contained in:
Kenneth Heafield 2012-07-30 16:47:30 -04:00
parent 1d6fa9178a
commit edf34e9d35
2 changed files with 11 additions and 2 deletions

3
bjam
View File

@ -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 >/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}" "$@"

View File

@ -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 ;
}
}