From fd2e62404cc7b8efbe71153a4361ab59f374f303 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Tue, 19 Nov 2013 13:57:30 +0100 Subject: 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 Reviewed-on: http://review.gluster.org/6281 Reviewed-by: Niels de Vos Tested-by: Gluster Build System --- autogen.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'autogen.sh') diff --git a/autogen.sh b/autogen.sh index f937e6be0d0..cd8603b66d3 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 -- cgit