From d2f8d7d3e54b8a22f3c4e19c322c7c7ead0e8583 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Sun, 17 Jun 2007 09:16:58 +0000 Subject: use python-config to get python includes (Closes #448173) 2007-06-17 Sebastien Bacher * m4/python.m4: use python-config to get python includes (Closes #448173) svn path=/trunk/; revision=676 --- ChangeLog | 5 +++++ m4/python.m4 | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 002337b..6676c8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-17 Sebastien Bacher + + * m4/python.m4: use python-config to get python includes + (Closes #448173) + 2007-06-16 Gustavo J. A. M. Carneiro * gobject/propertyhelper.py, diff --git a/m4/python.m4 b/m4/python.m4 index e1c5266..fe90156 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -45,10 +45,14 @@ 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"` +if test -x "$PYTHON-config"; 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: save_CPPFLAGS="$CPPFLAGS" -- cgit