diff options
author | Emmanuel Dreyfus <manu@netbsd.org> | 2013-11-19 13:57:30 +0100 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-11-19 10:49:06 -0800 |
commit | fd2e62404cc7b8efbe71153a4361ab59f374f303 (patch) | |
tree | 89ebe64d1a087e52fe70823bb6a696fbe35a98ba /autogen.sh | |
parent | 56b82b5294ae0ea0e73ae3d6bb58504442773e0f (diff) |
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>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 13 |
1 files changed, 11 insertions, 2 deletions
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 |