changes the way the python binary is found, should also fix bug #308004

* configure.in: changes the way the python binary is found, should
  also fix bug #308004
Daniel
diff --git a/configure.in b/configure.in
index 6485e60..915f0ef 100644
--- a/configure.in
+++ b/configure.in
@@ -613,7 +613,6 @@
 dnl check for python
 dnl
 
-PYTHON=
 PYTHON_VERSION=
 PYTHON_INCLUDES=
 PYTHON_SITE_PACKAGES=
@@ -630,7 +629,12 @@
 	    echo Found python in $with_python
 	    PYTHON="$with_python"
 	else
-	    AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
+	    if test -x "$PYTHON"
+	    then
+	        echo Found python in environment PYTHON=$PYTHON
+	    else
+		AM_PATH_PYTHON()
+	    fi
 	fi
     fi
     if test "$PYTHON" != ""
@@ -671,6 +675,8 @@
     else
         pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
     fi
+else
+    PYTHON=
 fi
 AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
 if test "$PYTHON_INCLUDES" != ""