Bug 449809 – use python-config to get python includes Patch by Sebastien
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 25 Jun 2007 08:23:39 +0000 (08:23 +0000)
committerChris Wilson <cpwilson@src.gnome.org>
Mon, 25 Jun 2007 08:23:39 +0000 (08:23 +0000)
2007-06-25  Chris Wilson  <chris@chris-wilson.co.uk>

    Bug 449809 – use python-config to get python includes
    Patch by Sebastien Bacher.

    * acinclude.m4: prefer python-config where available.

svn path=/trunk/; revision=1917

ChangeLog
acinclude.m4

index 9c021b1..3c45070 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-25  Chris Wilson  <chris@chris-wilson.co.uk>
+
+       Bug 449809 – use python-config to get python includes
+       Patch by Sebastien Bacher.
+
+       * acinclude.m4: prefer python-config where available.
+
 2007-06-25  Chris Wilson  <chris@chris-wilson.co.uk>
 
        Bug 450745 – VTE's response to CSI 2 1 t incorrectly formatted
index 71b3ad7..909c5a2 100644 (file)
@@ -9,9 +9,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 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
 PYTHON_LIBS="-L${py_prefix}/libs -lpython${PYTHON_VERSION}"
 AC_SUBST(PYTHON_INCLUDES)