6 AM_INIT_AUTOMAKE(dbus, 0.3)
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)
30 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=yes)
31 AC_ARG_ENABLE(asserts, [ --enable-asserts include assertion checks],enable_asserts=$enableval,enable_asserts=yes)
33 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
34 dnl and also some stuff in the test/ subdir
35 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
36 if test x$enable_tests = xyes; then
37 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
40 if test x$enable_verbose_mode = xyes; then
41 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
43 if test x$enable_asserts = xno; then
44 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
48 if test "x$GCC" = "xyes"; then
50 *[\ \ ]-Wall[\ \ ]*) ;;
51 *) CFLAGS="$CFLAGS -Wall" ;;
55 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
56 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
60 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
61 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
65 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
66 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
70 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
71 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
75 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
76 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
80 *[\ \ ]-Wcast-align[\ \ ]*) ;;
81 *) CFLAGS="$CFLAGS -Wcast-align" ;;
85 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
86 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
89 if test "x$enable_ansi" = "xyes"; then
91 *[\ \ ]-ansi[\ \ ]*) ;;
92 *) CFLAGS="$CFLAGS -ansi" ;;
96 *[\ \ ]-pedantic[\ \ ]*) ;;
97 *) CFLAGS="$CFLAGS -pedantic" ;;
103 AC_CHECK_SIZEOF(char)
104 AC_CHECK_SIZEOF(short)
105 AC_CHECK_SIZEOF(long)
107 AC_CHECK_SIZEOF(void *)
108 AC_CHECK_SIZEOF(long long)
109 AC_CHECK_SIZEOF(__int64)
114 AC_CHECK_FUNCS(vsnprintf vasprintf getpwnam_r nanosleep usleep poll)
116 dnl check for writev header and writev function so we're
117 dnl good to go if HAVE_WRITEV gets defined.
118 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
120 dnl check for flavours of varargs macros (test from GLib)
121 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
123 int a(int p1, int p2, int p3);
124 #define call_a(...) a(1,__VA_ARGS__)
126 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
127 AC_MSG_RESULT($dbus_have_iso_c_varargs)
129 AC_MSG_CHECKING(for GNUC varargs macros)
131 int a(int p1, int p2, int p3);
132 #define call_a(params...) a(1,params)
134 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
135 AC_MSG_RESULT($dbus_have_gnuc_varargs)
137 dnl Output varargs tests
138 if test x$dbus_have_iso_c_varargs = xyes; then
139 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
141 if test x$dbus_have_gnuc_varargs = xyes; then
142 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
148 AC_SUBST(DBUS_CLIENT_CFLAGS)
149 AC_SUBST(DBUS_CLIENT_LIBS)
153 AC_SUBST(DBUS_BUS_CFLAGS)
154 AC_SUBST(DBUS_BUS_LIBS)
158 AC_SUBST(DBUS_TEST_CFLAGS)
159 AC_SUBST(DBUS_TEST_LIBS)
162 PKG_CHECK_MODULES(DBUS_GLIB, glib-2.0, have_glib=yes, have_glib=no)
164 if test x$have_glib = xno ; then
165 AC_MSG_WARN([GLib development libraries not found])
168 if test x$enable_glib = xyes; then
169 if test x$have_glib = xno; then
170 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
174 if test x$enable_glib = xno; then
178 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
181 AC_SUBST(DBUS_GLIB_CFLAGS)
182 AC_SUBST(DBUS_GLIB_LIBS)
186 if test -n "$QTDIR" -a -f $QTDIR/include/qglobal.h; then
188 DBUS_QT_CXXFLAGS=-I$QTDIR/include
191 dnl linking to kdecore will give us a bit of help from libtool
192 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
193 if test -z $kdelibs -a -f $kdelibs/libkdecore.la; then
196 DBUS_QT_LIBS=$kdelibs/libkdecore.la
199 if test x$have_qt = xno ; then
200 AC_MSG_WARN([Qt development libraries not found])
203 if test x$enable_qt = xyes; then
204 if test x$have_qt = xno; then
205 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
209 if test x$enable_qt = xno; then
213 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
216 AC_SUBST(DBUS_QT_CXXFLAGS)
217 AC_SUBST(DBUS_QT_LIBS)
232 dnl ==========================================================================
238 source code location: ${srcdir}
241 Maintainer mode: ${USE_MAINTAINER_MODE}
242 Building unit tests: ${enable_tests}
243 Building verbose mode: ${enable_verbose_mode}
244 Building assertions: ${enable_asserts}
245 Building Qt bindings: ${have_qt}
246 Building GLib bindings: ${have_glib}
249 if test x$enable_tests = xyes; then
250 echo "NOTE: building with unit tests increases the size of the installed library"
252 if test x$enable_verbose_mode = xyes; then
253 echo "NOTE: building with verbose mode increases library size, but is probably a good idea anyway."
255 if test x$enable_asserts = xyes; then
256 echo "NOTE: building with assertions increases library size, but is probably a good idea anyway."