mosesdecoder/bjam

24 lines
780 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
top="$(dirname "$0")"
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 "${top}/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
2012-10-22 13:27:20 +04:00
if [ ! -x "$top"/jam-files/bjam ] || "$top"/jam-files/bjam -v |grep 2011.4 >/dev/null; then
2011-11-18 22:14:09 +04:00
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 "$@"