diff --git a/tools/configure b/tools/configure index 1baacea9ac..f2c66dfce9 100755 --- a/tools/configure +++ b/tools/configure @@ -6925,16 +6925,17 @@ then as_fn_error $? "Unable to find bash, please install bash" "$LINENO" 5 fi;; esac +if test -z "$PYTHON"; then : + PYTHON="python" +fi if echo "$PYTHON" | grep -q "^/"; then : - PYTHONPATH=$PYTHON - PYTHON=`basename $PYTHONPATH` - -elif test -z "$PYTHON"; then : - PYTHON="python" else - as_fn_error $? "PYTHON specified, but is not an absolute path" "$LINENO" 5 + PYTHON=`type -p "$PYTHON"` fi +PYTHONPATH=$PYTHON +PYTHON=`basename $PYTHONPATH` + # Extract the first word of "$PYTHON", so it can be a program name with args. set dummy $PYTHON; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/tools/configure.ac b/tools/configure.ac index 3fe04907a2..674bd5809d 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -337,11 +337,11 @@ case "$host_os" in freebsd*) ;; *) AX_PATH_PROG_OR_FAIL([BASH], [bash]);; esac -AS_IF([echo "$PYTHON" | grep -q "^/"], [ - PYTHONPATH=$PYTHON - PYTHON=`basename $PYTHONPATH` -],[test -z "$PYTHON"], [PYTHON="python"], -[AC_MSG_ERROR([PYTHON specified, but is not an absolute path])]) +AS_IF([test -z "$PYTHON"], [PYTHON="python"]) +AS_IF([echo "$PYTHON" | grep -q "^/"], [], [PYTHON=`type -p "$PYTHON"`]) +PYTHONPATH=$PYTHON +PYTHON=`basename $PYTHONPATH` + AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON]) AX_CHECK_PYTHON_VERSION([2], [6])