aboutsummaryrefslogtreecommitdiff
blob: 51f816175d4ac2e17c190e75b4cf746a8af4b1e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- acinclude.m4	2009-04-15 22:16:30.000000000 +0200
+++ acinclude.m4.new	2010-02-22 20:51:58.000000000 +0100
@@ -43,11 +43,13 @@
 [AC_REQUIRE([AM_PATH_PYTHON])
 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 $PYTHON-config --help 2>/dev/null; then
+  py_prefix=`$PYTHON-config --prefix 2>/dev/null`
+  py_exec_prefix=`$PYTHON-config --exec-prefix 2>/dev/null`
   PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
 else
+  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}"
@@ -73,8 +75,12 @@
 AC_MSG_CHECKING(for libraries required to embed python)
 dnl deduce PYTHON_LIBS
 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
-PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}"
-PYTHON_LIB_LOC="${py_prefix}/lib" 
+if $PYTHON-config --help 2>/dev/null; then
+  PYTHON_LIBS=`$PYTHON-config --libs 2>/dev/null`
+else
+  PYTHON_LIBS="-L${py_exec_prefix}/lib -lpython${PYTHON_VERSION}"
+fi
+PYTHON_LIB_LOC="${py_exec_prefix}/lib" 
 AC_SUBST(PYTHON_LIBS)
 AC_SUBST(PYTHON_LIB_LOC)
 dnl check if the headers exist: