From e6eb7b5307da2a446e1c8c6b0cb6b11fc6705b00 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 18 Dec 2006 20:33:56 +0000 Subject: Switch to autotools and test with Python 2.5 as well as 2.4. In the process: HACKING.txt: update include/dbus-python.h: add some typedefs to make it saner bus.c, conn.c, conn-methods.c: further alter docstrings to keep epydoc happy exceptions.c: create exceptions in a more longwinded way for Python 2.5 compatibility message-get-args.c, bus/__init__.py: tweak docstrings dbus/introspect_parser.py: make docstring valid reStructuredText run-test.sh: simplify, since configure now does some of the work test/*.py: use paths from run-test.sh, cope with out-of-tree builds test-standalone.py: carry out additional sanity checks --- configure.ac | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 configure.ac (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c3a7eb0 --- /dev/null +++ b/configure.ac @@ -0,0 +1,83 @@ +-*- mode: m4 -*- +AC_PREREQ(2.52) + +dnl The dbus-python version number (must actually be numeric at the moment) +m4_define(dbus_python_major_version, 0) +m4_define(dbus_python_minor_version, 79) +m4_define(dbus_python_micro_version, 93) +m4_define(dbus_python_version, dbus_python_major_version.dbus_python_minor_version.dbus_python_micro_version) + +dnl versions of packages we require ... +dnl m4_define(glib_required_version, 2.8.0) + +AC_INIT(dbus-python, dbus_python_version, + [http://bugzilla.gnome.org/enter_bug.cgi?product=dbus&component=python]) +AC_SUBST(ACLOCAL_AMFLAGS, "-I autotools -I .") +AC_CONFIG_AUX_DIR(autotools) +AC_CONFIG_MACRO_DIR(autotools) + +AC_DEFINE(DBUS_PYTHON_MAJOR_VERSION, dbus_python_major_version, [dbus-python major version]) +AC_SUBST(DBUS_PYTHON_MAJOR_VERSION, dbus_python_major_version) +AC_DEFINE(DBUS_PYTHON_MINOR_VERSION, dbus_python_minor_version, [dbus-python minor version]) +AC_SUBST(DBUS_PYTHON_MINOR_VERSION, dbus_python_minor_version) +AC_DEFINE(DBUS_PYTHON_MICRO_VERSION, dbus_python_micro_version, [dbus-python micro version]) +AC_SUBST(DBUS_PYTHON_MICRO_VERSION, dbus_python_micro_version) + +AC_CONFIG_SRCDIR([_dbus_bindings/module.c]) +AM_CONFIG_HEADER(config.h) + +AM_INIT_AUTOMAKE + +dnl put the ACLOCAL flags in the makefile +ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +AC_DISABLE_STATIC + +dnl XXXX hack to kill off all the libtool tags ... +dnl it isn't like we are using C++ or Fortran. +dnl (copied from libglade/configure.in) +m4_define([_LT_AC_TAGCONFIG],[]) + +AC_PROG_LIBTOOL + +AM_PATH_PYTHON(2.4.0) + +AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) + +PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"` +AC_SUBST(PLATFORM) + +dnl Building documentation +AC_ARG_ENABLE(api-docs, +AC_HELP_STRING([--enable-api-docs], [Enable documentation building (requires epydoc 3 and docutils)]),, enable_api_docs=no) +AM_CHECK_PYMOD([docutils], [__version__], [:], [enable_api_docs=no]) +if test "${enable_api_docs}" != no; then + AC_PATH_PROG([EPYDOC], [epydoc]) + if test -z "$EPYDOC"; then + enable_api_docs=no + fi +fi + +AM_CONDITIONAL(ENABLE_API_DOCS, test x$enable_api_docs != xno) + +PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0 dbus-glib-1 >= 0.70]) +PKG_CHECK_MODULES(DBUS_GLIB, [dbus-1 >= 1.0 dbus-glib-1 >= 0.70]) + +dnl add required cflags ... +JH_ADD_CFLAG([-Wall]) +JH_ADD_CFLAG([-Wextra]) +JH_ADD_CFLAG([-Wno-missing-field-initializers]) +JH_ADD_CFLAG([-Wdeclaration-after-statement]) +JH_ADD_CFLAG([-std=c9x]) +JH_ADD_CFLAG([-fno-strict-aliasing]) + +AC_CONFIG_FILES( + Makefile + dbus-python.pc + dbus/_version.py + test/tmp-session-bus.conf + test/TestSuitePythonService.service) +AC_OUTPUT -- cgit v1.2.3