dbus.proxies: If making a call with ignore_reply=True, don't block for introspection
[dbus-python-phuang.git] / configure.ac
blob4c34a2d8dc3afd49f59361cf5d80ba894121505a
1 -*- mode: m4 -*-
2 AC_PREREQ(2.59c)
4 dnl If not 1, append datestamp to the version number
5 m4_define(dbus_python_released, 1)
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, 0)
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)
33 AM_INIT_AUTOMAKE
35 AC_CANONICAL_BUILD
36 AC_CANONICAL_HOST
38 AC_DISABLE_STATIC
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],[])
45 AC_PROG_LIBTOOL
47 AM_PATH_PYTHON(2.4.0)
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()"`
52 AC_SUBST(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=no)
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
71        enable_api_docs=no
72     fi
73     if test "$enable_html_docs" = "if possible"; then
74        enable_html_docs=no
75     fi
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])
78     fi
79   fi
82 if test "${enable_api_docs}" != no; then
83   AC_PATH_PROG([EPYDOC], [epydoc])
84   if test -z "$EPYDOC"; then
85     case "$enable_api_docs" in
86       if*possible)
87         enable_api_docs=no
88         ;;
89       *)
90         AC_MSG_ERROR([cannot compile API documentation without epydoc installed])
91         ;;
92     esac
93   fi
96 RST2HTMLFLAGS=
97 if test "${enable_html_docs}" != no; then
98   AC_CHECK_PROGS([RST2HTML], [rst2html rst2html.py], [])
99   if test -z "$RST2HTML"; then
100     case "$enable_html_docs" in
101       if*possible)
102         enable_html_docs=no
103       ;;
104       *)
105         AC_MSG_ERROR([cannot compile HTML documentation without rst2html installed])
106       ;;
107     esac
108   else
109     DBUS_PY_ADD_RST2HTMLFLAG([--generator])
110     DBUS_PY_ADD_RST2HTMLFLAG([--date])
111     DBUS_PY_ADD_RST2HTMLFLAG([--time])
112     DBUS_PY_ADD_RST2HTMLFLAG([--exit-status=2])
113     DBUS_PY_ADD_RST2HTMLFLAG([--no-raw])
114     DBUS_PY_ADD_RST2HTMLFLAG([--no-file-insertion])
115     DBUS_PY_ADD_RST2HTMLFLAG([--cloak-email-addresses])
116   fi
118 AC_SUBST([RST2HTML])
119 AC_SUBST([RST2HTMLFLAGS])
121 AM_CONDITIONAL([ENABLE_API_DOCS], [test "$enable_api_docs" != no])
122 AM_CONDITIONAL([ENABLE_DOCS], [test "$enable_html_docs" != no])
124 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.93])
125 PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.70])
127 dnl avoid deprecated stuff if possible
128 AC_CHECK_LIB([dbus-1], [dbus_watch_get_unix_fd],
129              [AC_DEFINE([HAVE_DBUS_WATCH_GET_UNIX_FD], [],
130                         [Define if libdbus-1 has dbus_watch_get_unix_fd])],
131              [:], [$DBUS_LIBS])
133 dnl add required cflags ...
134 JH_ADD_CFLAG([-Wall])
135 JH_ADD_CFLAG([-Wextra])
136 JH_ADD_CFLAG([-Wno-missing-field-initializers])
137 JH_ADD_CFLAG([-Wdeclaration-after-statement])
138 JH_ADD_CFLAG([-std=c9x])
139 JH_ADD_CFLAG([-fno-strict-aliasing])
141 AC_ARG_ENABLE(Werror,
142 AC_HELP_STRING([--enable-Werror],
143                [Treat warnings as errors, if the compiler supports it]),
144 enable_Werror=$enableval, enable_Werror=no)
145 if test "x$enable_Werror" = xyes; then
146   JH_ADD_CFLAG([-Werror])
149 ifelse(dbus_python_released, 1,
150     [ # version x.y.z - disable coding style checks by default
151 AC_ARG_ENABLE(coding-style-checks,
152   AC_HELP_STRING([--enable-coding-style-checks],
153                  [check coding style using grep]),
154     [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=no] )
155     ],
156     [ # version x.y.z.200xyyzz - enable coding style checks by default
157 AC_ARG_ENABLE(coding-style-checks,
158   AC_HELP_STRING([--disable-coding-style-checks],
159                  [don't check coding style using grep]),
160     [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
161     ])
163 AC_CONFIG_FILES(
164   Makefile
165   _dbus_bindings/Makefile
166   _dbus_glib_bindings/Makefile
167   dbus/Makefile
168   dbus-python.pc
169   dbus/_version.py
170   examples/Makefile
171   m4/Makefile
172   test/Makefile
173   test/tmp-session-bus.conf
174   test/TestSuitePythonService.service
175   tools/Makefile)
176 AC_OUTPUT