diff --git a/ChangeLog b/ChangeLog index ee81613d09..a74ce0c114 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-11-29 Sebastian Dröge + + * acinclude.m4: + Use pythonX.Y-config to detect the include path for the python + version and use the old values as fallback if pythonX.Y-config + doesn't exist. + 2007-11-28 Edward Hervey * configure.ac: diff --git a/acinclude.m4 b/acinclude.m4 index e1c5266de0..04a283be5d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -45,9 +45,13 @@ AC_MSG_CHECKING(for headers required to compile python extensions) dnl deduce PYTHON_INCLUDES py_prefix=`$PYTHON -c "import sys; print sys.prefix"` py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" +if $PYTHON-config --help 2>/dev/null; then + PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` +else + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi fi AC_SUBST(PYTHON_INCLUDES) dnl check if the headers exist: