summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.decina@collabora.co.uk>2010-08-26 12:13:34 +0200
committerAlessandro Decina <alessandro.decina@collabora.co.uk>2010-08-26 12:15:19 +0200
commit9ee33ad3014b751ead5a1b0aa44b9c74458dac6d (patch)
treec03af57e9159042f6e5bfd57e26b326cf928b0b1
parentc5b2a96bc9bf8332dc9026de7713e448df75e987 (diff)
acinclude.m4: use a better way to find the correct PYTHON_LIB_LOC.
-rw-r--r--acinclude.m411
1 files changed, 9 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 4b9972c..25f27e6 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -73,8 +73,15 @@ AC_DEFUN([AM_CHECK_PYTHON_LIBS],
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 --ldflags 2>/dev/null`
+ PYTHON_LIB=`$PYTHON -c "import distutils.sysconfig as s; print s.get_python_lib(standard_lib=1)"`
+ PYTHON_LIB_LOC=$PYTHON_LIB/config
+else
+ asd
+ PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}"
+ PYTHON_LIB_LOC="${py_prefix}/lib"
+fi
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_LIB_LOC)
dnl check if the headers exist: