4 dnl If not 1, append datestamp to the version number
5 m4_define(dbus_python_released, 0)
6 dnl The dbus-python version number (must actually be numeric at the moment)
7 m4_define(dbus_python_major_version, 0)
8 m4_define(dbus_python_minor_version, 82)
9 m4_define(dbus_python_micro_version, 3)
11 m4_define(dbus_python_maybe_datestamp,
12 m4_esyscmd([if test x]dbus_python_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
14 m4_define(dbus_python_version, dbus_python_major_version.dbus_python_minor_version.dbus_python_micro_version[]dbus_python_maybe_datestamp)
16 dnl versions of packages we require ...
17 dnl m4_define(glib_required_version, 2.8.0)
19 AC_INIT(dbus-python, dbus_python_version,
20 [http://bugs.freedesktop.org/enter_bug.cgi?product=dbus&component=python])
21 AC_CONFIG_MACRO_DIR([m4])
23 AC_DEFINE(DBUS_PYTHON_MAJOR_VERSION, dbus_python_major_version, [dbus-python major version])
24 AC_SUBST(DBUS_PYTHON_MAJOR_VERSION, dbus_python_major_version)
25 AC_DEFINE(DBUS_PYTHON_MINOR_VERSION, dbus_python_minor_version, [dbus-python minor version])
26 AC_SUBST(DBUS_PYTHON_MINOR_VERSION, dbus_python_minor_version)
27 AC_DEFINE(DBUS_PYTHON_MICRO_VERSION, dbus_python_micro_version, [dbus-python micro version])
28 AC_SUBST(DBUS_PYTHON_MICRO_VERSION, dbus_python_micro_version)
30 AC_CONFIG_SRCDIR([_dbus_bindings/module.c])
31 AM_CONFIG_HEADER(config.h)
40 dnl XXXX hack to kill off all the libtool tags ...
41 dnl it isn't like we are using C++ or Fortran.
42 dnl (copied from libglade/configure.in)
43 m4_define([_LT_AC_TAGCONFIG],[])
49 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
51 PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"`
54 dnl Building documentation
56 AC_MSG_CHECKING([whether you want to build HTML docs])
57 AC_ARG_ENABLE(html-docs,
58 AC_HELP_STRING([--enable-html-docs], [Enable HTML documentation building (requires docutils, default: auto-detect)]), enable_html_docs=$enableval, enable_html_docs="if possible")
59 AC_MSG_RESULT([$enable_html_docs])
61 AC_MSG_CHECKING([whether you want to build API docs])
62 AC_ARG_ENABLE(api-docs,
63 AC_HELP_STRING([--enable-api-docs], [Enable API documentation building (requires epydoc 3 and docutils)]), enable_api_docs=$enableval, enable_api_docs="if possible")
64 AC_MSG_RESULT([$enable_api_docs])
67 if test "$enable_api_docs" != no || test "$enable_html_docs" != no; then
68 AM_CHECK_PYMOD([docutils], [__version__], [have_docutils=yes], [have_docutils=no])
69 if test "$have_docutils" = no; then
70 if test "$enable_api_docs" = "if possible"; then
73 if test "$enable_html_docs" = "if possible"; then
76 if test "$enable_api_docs" != no || test "$enable_html_docs" != no; then
77 AC_MSG_ERROR([cannot compile HTML documentation or API documentation without python-docutils installed])
82 if test "${enable_api_docs}" != no; then
83 AC_PATH_PROG([EPYDOC], [epydoc])
84 AC_MSG_CHECKING([epydoc 3])
85 if test -n "$EPYDOC"; then
86 EPYDOC_VERSION=`$EPYDOC --version`
87 case "$EPYDOC_VERSION" in
89 AC_MSG_RESULT([yes, $EPYDOC_VERSION])
92 AC_MSG_RESULT([no, $EPYDOC_VERSION])
97 if test -z "$EPYDOC"; then
98 case "$enable_api_docs" in
103 AC_MSG_ERROR([cannot compile API documentation without epydoc 3.0beta1 or newer installed])
110 if test "${enable_html_docs}" != no; then
111 AC_CHECK_PROGS([RST2HTML], [rst2html rst2html.py], [])
112 if test -z "$RST2HTML"; then
113 case "$enable_html_docs" in
118 AC_MSG_ERROR([cannot compile HTML documentation without rst2html installed])
122 DBUS_PY_ADD_RST2HTMLFLAG([--generator])
123 DBUS_PY_ADD_RST2HTMLFLAG([--date])
124 DBUS_PY_ADD_RST2HTMLFLAG([--time])
125 DBUS_PY_ADD_RST2HTMLFLAG([--exit-status=2])
126 DBUS_PY_ADD_RST2HTMLFLAG([--no-raw])
127 DBUS_PY_ADD_RST2HTMLFLAG([--no-file-insertion])
128 DBUS_PY_ADD_RST2HTMLFLAG([--cloak-email-addresses])
132 AC_SUBST([RST2HTMLFLAGS])
134 AM_CONDITIONAL([ENABLE_API_DOCS], [test "$enable_api_docs" != no])
135 AM_CONDITIONAL([ENABLE_DOCS], [test "$enable_html_docs" != no])
137 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.93])
138 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.70])
140 dnl avoid deprecated stuff if possible
141 AC_CHECK_LIB([dbus-1], [dbus_watch_get_unix_fd],
142 [AC_DEFINE([HAVE_DBUS_WATCH_GET_UNIX_FD], [],
143 [Define if libdbus-1 has dbus_watch_get_unix_fd])],
146 dnl add required cflags ...
147 JH_ADD_CFLAG([-Wall])
148 JH_ADD_CFLAG([-Wextra])
149 JH_ADD_CFLAG([-Wno-missing-field-initializers])
150 JH_ADD_CFLAG([-Wdeclaration-after-statement])
151 JH_ADD_CFLAG([-std=c9x])
152 JH_ADD_CFLAG([-fno-strict-aliasing])
154 AC_ARG_ENABLE(Werror,
155 AC_HELP_STRING([--enable-Werror],
156 [Treat warnings as errors, if the compiler supports it]),
157 enable_Werror=$enableval, enable_Werror=no)
158 if test "x$enable_Werror" = xyes; then
159 JH_ADD_CFLAG([-Werror])
162 ifelse(dbus_python_released, 1,
163 [ # version x.y.z - disable coding style checks by default
164 AC_ARG_ENABLE(coding-style-checks,
165 AC_HELP_STRING([--enable-coding-style-checks],
166 [check coding style using grep]),
167 [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=no] )
169 [ # version x.y.z.200xyyzz - enable coding style checks by default
170 AC_ARG_ENABLE(coding-style-checks,
171 AC_HELP_STRING([--disable-coding-style-checks],
172 [don't check coding style using grep]),
173 [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
178 _dbus_bindings/Makefile
179 _dbus_glib_bindings/Makefile
186 test/tmp-session-bus.conf
187 test/TestSuitePythonService.service