pyldb: avoid segfault when adding an element with no name
[sfrench/samba-autobuild/.git] / lib / replace / configure
index 2d4aec724ef3f6f47c036f2f4689cbf676b72f58..d8a8d2ac2f393aa0a00f847f62ecc323c38bd07e 100755 (executable)
@@ -2,7 +2,14 @@
 
 PREVPATH=`dirname $0`
 
-WAF=../../buildtools/bin/waf
+if [ -f $PREVPATH/../../buildtools/bin/waf ]; then
+       WAF=../../buildtools/bin/waf
+elif [ -f $PREVPATH/buildtools/bin/waf ]; then
+       WAF=./buildtools/bin/waf
+else
+       echo "replace: Unable to find waf"
+       exit 1
+fi
 
 # using JOBS=1 gives maximum compatibility with
 # systems like AIX which have broken threading in python
@@ -10,5 +17,5 @@ JOBS=1
 export JOBS
 
 cd . || exit 1
-$WAF configure "$@" || exit 1
+$PYTHON $WAF configure "$@" || exit 1
 cd $PREVPATH