From f4cffc0e49d48a8dbf158230d7e816d8713566da Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Mon, 22 Sep 2003 05:45:59 +0000 Subject: 2003-09-21 Seth Nickell 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. --- configure.in | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index e81a8d6a..6cf4accb 100644 --- a/configure.in +++ b/configure.in @@ -35,6 +35,8 @@ AC_ARG_ENABLE(gcov, [ --enable-gcov compile with coverage p AC_ARG_ENABLE(abstract-sockets, [ --enable-abstract-sockets use abstract socket namespace (linux only)],enable_abstract_sockets=$enableval,enable_abstract_sockets=auto) AC_ARG_ENABLE(gcj, [ --enable-gcj build gcj bindings],enable_gcj=$enableval,enable_gcj=no) AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings],enable_mono=$enableval,enable_mono=no) +AC_ARG_ENABLE(python, [ --enable-python build python bindings],enable_python=$enableval,enable_python=auto) + AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use]) AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install]) @@ -834,6 +836,42 @@ fi AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets]) AC_SUBST(DBUS_SESSION_SOCKET_DIR) +# Detect if we can build Python bindings (need python, python headers, and pyrex) +if test x$enable_python = xno; then + have_python=no +else + AC_MSG_NOTICE([Checking to see if we can build Python bindings]) + have_python=no + AM_PATH_PYTHON(2.2) + + if test -z "$PYTHON" ; then + AC_MSG_WARN([Python not found]) + else + AC_CHECK_PROGS(PYREX, pyrexc) + + if test -z "$PYREX" ; then + have_pyrex=no + else + have_pyrex=yes + fi + + AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no) + + if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then + have_python=yes + fi + fi + + if test x$have_python = xno ; then + if test x$enable_python = xyes ; then + AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings]) + else + AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings]) + fi + fi +fi + +AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes) AC_OUTPUT([ @@ -846,6 +884,7 @@ bus/dbus-daemon-1.1 Makefile dbus/Makefile glib/Makefile +python/Makefile qt/Makefile gcj/Makefile gcj/org/Makefile @@ -914,6 +953,7 @@ echo " Building checks: ${enable_checks} Building Qt bindings: ${have_qt} Building GLib bindings: ${have_glib} + Building Python bindings: ${have_python} Building GTK+ tools: ${have_gtk} Building X11 code: ${enable_x11} Building documentation: ${enable_docs} -- cgit