summaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorSeth Nickell <seth@gnome.org>2003-09-22 05:45:59 +0000
committerSeth Nickell <seth@gnome.org>2003-09-22 05:45:59 +0000
commitf4cffc0e49d48a8dbf158230d7e816d8713566da (patch)
treed22625c371ad3fa2eae127c0a825bd5b26652c61 /acinclude.m4
parentc9332907b035b52103c5569119d0a7c9fbcb76ac (diff)
2003-09-21 Seth Nickell <seth@gnome.org>
First checkin of the Python bindings. * python/.cvsignore: * python/Makefile.am: * python/dbus_bindings.pyx.in: * python/dbus_h_wrapper.h: Pieces for Pyrex to operate on, building a dbus_bindings.so python module for low-level access to the DBus APIs. * python/dbus.py: High-level Python module for accessing DBus objects. * configure.in: * Makefile.am: Build stuff for the python bindings. * acinclude.m4: Extra macro needed for finding the Python C header files.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m426
1 files changed, 26 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index c80e0acf..27da0a4c 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -55,3 +55,29 @@ AC_DEFUN(PKG_CHECK_MODULES, [
])
+
+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
+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
+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}"
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+