autogen.sh portability fixes

- Do not assume tar has --version, as BSD tar does not
- Allow specifying python binary through PYTHONBIN in case it is e.g. python2.7

BUG: 764655
Change-Id: I71f0f4830e10915782775de811c92db8e6ab4c55
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/6281
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
This commit is contained in:
Emmanuel Dreyfus 2013-11-19 13:57:30 +01:00 committed by Anand Avati
parent 56b82b5294
commit fd2e62404c

View File

@ -55,11 +55,20 @@ else
fi
# Check for tar
env tar --version > /dev/null 2>&1
env tar -cf /dev/null /dev/null > /dev/null 2>&1
if [ $? -ne 0 ]; then
MISSING="$MISSING tar"
fi
# Check for python
if [ "x${PYTHONBIN}" = "x" ]; then
PYTHONBIN=python
fi
env ${PYTHONBIN} -V > /dev/null 2>&1
if [ $? -ne 0 ]; then
MISSING="$MISSING python"
fi
## If dependencies are missing, warn the user and abort
if [ "x$MISSING" != "x" ]; then
echo "Aborting."
@ -77,7 +86,7 @@ fi
## generate gf-error-codes.h from error-codes.json
echo "Generate gf-error-codes.h ..."
if ./gen-headers.py; then
if ${PYTHONBIN} ./gen-headers.py; then
if ! mv -fv gf-error-codes.h libglusterfs/src/gf-error-codes.h; then
exit 1
fi