Commit c4338767 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix autoconf detection of python

This also fully honors the PYTHON_VERSION environment variable.
parent 19984ec5
......@@ -145,8 +145,10 @@ AC_CHECK_LIB(expat,main)
dnl python
[TEMP_CPPFLAGS="${CPPFLAGS}"]
AM_PATH_PYTHON([2.5])
AC_PYTHON_DEVEL([2.5])
[PYTHON="python${PYTHON_VERSION}"]
AX_PYTHON
AM_PATH_PYTHON([2.5])
[CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS}"]
[LDFLAGS="${LDFLAGS} ${PYTHON_LDFLAGS}"]
......
......@@ -25,9 +25,11 @@
# and this notice are preserved.
AC_DEFUN([AC_PYTHON_MODULE],[
if test -z $PYTHON;
if test -z $PYTHON_BIN;
then
PYTHON="python"
else
PYTHON=$PYTHON_BIN
fi
PYTHON_NAME=`basename $PYTHON`
AC_MSG_CHECKING($PYTHON_NAME module: $1)
......
......@@ -58,7 +58,13 @@
AC_DEFUN([AX_PYTHON],
[AC_MSG_CHECKING(for python build information)
AC_MSG_RESULT([])
for python in python2.8 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
if test -z $PYTHON_VERSION
then
python_list="python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python"
else
python_list="python$PYTHON_VERSION"
fi
for python in $python_list; do
AC_CHECK_PROGS(PYTHON_BIN, [$python])
ax_python_bin=$PYTHON_BIN
if test x$ax_python_bin != x; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment