Index: configure.in =================================================================== --- configure.in (revision 15884) +++ configure.in (working copy) @@ -537,28 +537,17 @@ # Python: Used for testsuite, and bindings -# For compatibility with Subversion 1.1.3 and earlier, -# which recommended setting PYTHON2, not PYTHON. -if test "${PYTHON2+set}" = set -a "${PYTHON+set}" != set; then - PYTHON="$PYTHON2" -fi -AC_PATH_PROGS(PYTHON, python2 python, none) -if test "$PYTHON" != "none"; then - AC_MSG_CHECKING([that the Python found is at least version 2.0]) - if "$PYTHON" -c 'import sys;sys.exit((sys.hexversion < 0x2000000) and 1 or 0)'; then - AC_MSG_RESULT([yes]) - else - PYTHON="none" - AC_MSG_RESULT([no]) - AC_MSG_WARN([The detected Python is too old for Subversion to use]) - AC_MSG_WARN([At least Python 2.0 is required to run the testsuite]) - AC_MSG_WARN([or to use the Subversion Python bindings]) - AC_MSG_WARN([]) - AC_MSG_WARN([If you have a suitable Python installed, but not on the]) - AC_MSG_WARN([PATH, set the environment variable PYTHON to the full path]) - AC_MSG_WARN([to the Python executable, and re-run configure]) - fi +PYTHON=`$abs_srcdir/build/find_python.sh` +if test -z "$PYTHON"; then + AC_MSG_WARN([Python 2.0 or later is required to run the testsuite]) + AC_MSG_WARN([or to use the Subversion Python bindings]) + AC_MSG_WARN([]) + AC_MSG_WARN([If you have a suitable Python installed, but not on the]) + AC_MSG_WARN([PATH, set the environment variable PYTHON to the full path]) + AC_MSG_WARN([to the Python executable, and re-run configure]) +else + AC_PATH_PROGS(PYTHON, "$PYTHON", none) fi # SVN_CHECK_JDK sets $JAVA_CLASSPATH Index: build/find_python.sh =================================================================== --- build/find_python.sh (revision 0) +++ build/find_python.sh (revision 0) @@ -0,0 +1,15 @@ +#!/bin/sh + +# Required version of Python +# Python 2.0 = 0x2000000 +# Python 2.2 = 0x2020000 +VERSION=${1:-0x2000000} + +for x in "$PYTHON2" "$PYTHON" python python2; do + DETECT_PYTHON2="import sys;sys.exit((sys.hexversion < $VERSION) and 1 or 0)" + if "$x" -c "$DETECT_PYTHON2" >/dev/null 2>/dev/null; then + echo $x + exit 0 + fi +done +exit 1 Property changes on: build/find_python.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Index: autogen.sh =================================================================== --- autogen.sh (revision 15884) +++ autogen.sh (working copy) @@ -65,33 +65,33 @@ # # Note: this dependency on Python is fine: only SVN developers use autogen.sh # and we can state that dev people need Python on their machine. Note -# that running gen-make.py requires Python 1.X or newer. +# that running gen-make.py requires Python 2.X or newer. -OK=`python -c 'print "OK"'` -if test "${OK}" != "OK" ; then - echo "Python check failed, make sure python is installed and on the PATH" +PYTHON=`./build/find_python.sh` +if test -z "$PYTHON"; then + echo "Python check failed, make sure python 2.x is installed and on the PATH" exit 1 fi if test -n "$SKIP_DEPS"; then echo "Creating build-outputs.mk (no dependencies)..." - python ./gen-make.py -s build.conf || gen_failed=1 + "$PYTHON" ./gen-make.py -s build.conf || gen_failed=1 ### if apr and apr-util are not subdirs, then this fails. only do it ### for the release (from dist.sh; for now) if test -n "$RELEASE_MODE"; then echo "Creating MSVC files (no dependencies)..." - python ./gen-make.py -t dsp -s build.conf || gen_failed=1 + "$PYTHON" ./gen-make.py -t dsp -s build.conf || gen_failed=1 fi else echo "Creating build-outputs.mk..." - python ./gen-make.py build.conf || gen_failed=1 + "$PYTHON" ./gen-make.py build.conf || gen_failed=1 ### if apr and apr-util are not subdirs, then this fails. only do it ### for the release (from dist.sh; for now) if test -n "$RELEASE_MODE"; then echo "Creating MSVC files..." - python ./gen-make.py -t dsp -s build.conf || gen_failed=1 + "$PYTHON" ./gen-make.py -t dsp -s build.conf || gen_failed=1 fi fi