mosesdecoder/bjam

24 lines
719 B
Plaintext
Raw Normal View History

2011-11-20 22:15:54 +04:00
#!/bin/bash
2011-11-18 22:14:09 +04:00
set -e
2011-12-13 18:36:23 +04:00
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}" --sanity-test 2>/dev/null |grep Sane >/dev/null && #The test in jam-files/sanity.jam passes
(cd jam-files/fail && ! "${bjam}") >/dev/null #Returns non-zero on failure
2011-11-21 23:41:10 +04:00
then
#Delegate to system bjam
2011-12-13 18:36:23 +04:00
exec "${bjam}" "$@"
fi
2011-11-18 22:14:09 +04:00
top="$(dirname "$0")"
if [ ! -x "$top"/jam-files/bjam ]; then
pushd "$top/jam-files/engine"
./build.sh
cp -f bin.*/bjam ../bjam
popd
fi
2011-11-20 22:15:54 +04:00
export BOOST_BUILD_PATH="$top"/jam-files/boost-build
exec "$top"/jam-files/bjam "$@"