6 AM_INIT_AUTOMAKE(dbus, 0.2)
8 AM_CONFIG_HEADER(config.h)
11 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
13 GETTEXT_PACKAGE=dbus-1
14 AC_SUBST(GETTEXT_PACKAGE)
15 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
17 ## must come before we use the $USE_MAINTAINER_MODE variable later
26 AC_ARG_ENABLE(qt, [ --enable-qt enable Qt-friendly client library],enable_qt=$enableval,enable_qt=auto)
27 AC_ARG_ENABLE(glib, [ --enable-glib enable GLib-friendly client library],enable_glib=$enableval,enable_glib=auto)
28 AC_ARG_ENABLE(tests, [ --enable-tests enable unit test code],enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
29 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
31 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
32 dnl and also some stuff in the test/ subdir
33 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
34 if test x$enable_tests = xyes; then
35 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
39 if test "x$GCC" = "xyes"; then
41 *[\ \ ]-Wall[\ \ ]*) ;;
42 *) CFLAGS="$CFLAGS -Wall" ;;
46 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
47 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
51 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
52 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
56 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
57 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
61 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
62 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
66 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
67 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
71 *[\ \ ]-Wcast-align[\ \ ]*) ;;
72 *) CFLAGS="$CFLAGS -Wcast-align" ;;
76 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
77 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
80 if test "x$enable_ansi" = "xyes"; then
82 *[\ \ ]-ansi[\ \ ]*) ;;
83 *) CFLAGS="$CFLAGS -ansi" ;;
87 *[\ \ ]-pedantic[\ \ ]*) ;;
88 *) CFLAGS="$CFLAGS -pedantic" ;;
95 AC_CHECK_SIZEOF(short)
98 AC_CHECK_SIZEOF(void *)
99 AC_CHECK_SIZEOF(long long)
100 AC_CHECK_SIZEOF(__int64)
105 AC_CHECK_FUNCS(vsnprintf vasprintf getpwnam_r nanosleep usleep poll)
107 dnl check for writev header and writev function so we're
108 dnl good to go if HAVE_WRITEV gets defined.
109 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
113 AC_SUBST(DBUS_CLIENT_CFLAGS)
114 AC_SUBST(DBUS_CLIENT_LIBS)
118 AC_SUBST(DBUS_BUS_CFLAGS)
119 AC_SUBST(DBUS_BUS_LIBS)
123 AC_SUBST(DBUS_TEST_CFLAGS)
124 AC_SUBST(DBUS_TEST_LIBS)
127 PKG_CHECK_MODULES(DBUS_GLIB, glib-2.0, have_glib=yes, have_glib=no)
129 if test x$have_glib = xno ; then
130 AC_MSG_WARN([GLib development libraries not found])
133 if test x$enable_glib = xyes; then
134 if test x$have_glib = xno; then
135 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
139 if test x$enable_glib = xno; then
143 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
146 AC_SUBST(DBUS_GLIB_CFLAGS)
147 AC_SUBST(DBUS_GLIB_LIBS)
151 if test -n "$QTDIR" -a -f $QTDIR/include/qglobal.h; then
153 DBUS_QT_CXXFLAGS=-I$QTDIR/include
156 dnl linking to kdecore will give us a bit of help from libtool
157 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
158 if test -z $kdelibs -a -f $kdelibs/libkdecore.la; then
161 DBUS_QT_LIBS=$kdelibs/libkdecore.la
164 if test x$have_qt = xno ; then
165 AC_MSG_WARN([Qt development libraries not found])
168 if test x$enable_qt = xyes; then
169 if test x$have_qt = xno; then
170 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
174 if test x$enable_qt = xno; then
178 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
181 AC_SUBST(DBUS_QT_CXXFLAGS)
182 AC_SUBST(DBUS_QT_LIBS)
197 dnl ==========================================================================
203 source code location: ${srcdir}
206 Maintainer mode: ${USE_MAINTAINER_MODE}
207 Building unit tests: ${enable_tests}
208 Building Qt bindings: ${have_qt}
209 Building GLib bindings: ${have_glib}
212 if test x$enable_tests = xyes; then
213 echo "NOTE: building with unit tests increases the size of the installed library"