summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorSimon van der Linden <svdlinden@gnome.org>2011-01-17 14:35:14 +0100
committerSimon van der Linden <svdlinden@gnome.org>2011-01-18 11:15:18 +0100
commitfc7d7f7f153d57ff3866b7bfd5e6479d702cc4d9 (patch)
treeef9afbf7bd6b4375cfd56683c5054c40cae2db6c /m4
parentbceec758b27e6c396d17a79424633b5dc9116f54 (diff)
downloadpygobject-fc7d7f7f153d57ff3866b7bfd5e6479d702cc4d9.tar.gz
Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES
https://bugzilla.gnome.org/show_bug.cgi?id=620215
Diffstat (limited to 'm4')
-rw-r--r--m4/python.m47
1 files changed, 5 insertions, 2 deletions
diff --git a/m4/python.m4 b/m4/python.m4
index afbc2a20..edc30941 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -38,22 +38,25 @@ fi
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_INCLUDES
+dnl function also defines PYTHON_INCLUDES and PYTHON_LIBS
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
-dnl deduce PYTHON_INCLUDES
+dnl deduce PYTHON_INCLUDES and PYTHON_LIBS
py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
if test -x "$PYTHON-config"; then
PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+PYTHON_LIBS=`$PYTHON-config --libs 2>/dev/null`
else
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+PYTHON_LIBS=`-lpython${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)
+AC_SUBST(PYTHON_LIBS)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"