6 AM_INIT_AUTOMAKE(dbus, 0.1)
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])
25 AC_ARG_ENABLE(qt, [ --enable-qt enable Qt-friendly client library],enable_qt=$enableval,enable_qt=auto)
26 AC_ARG_ENABLE(glib, [ --enable-glib enable GLib-friendly client library],enable_glib=$enableval,enable_glib=auto)
27 AC_ARG_ENABLE(tests, [ --enable-tests enable unit test code],enable_tests=$enableval,enable_tests=no)
28 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
30 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
31 dnl and also some stuff in the test/ subdir
32 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
33 if test x$enable_tests = xyes; then
34 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
38 if test "x$GCC" = "xyes"; then
40 *[\ \ ]-Wall[\ \ ]*) ;;
41 *) CFLAGS="$CFLAGS -Wall" ;;
45 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
46 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
50 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
51 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
55 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
56 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
60 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
61 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
65 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
66 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
70 *[\ \ ]-Wcast-align[\ \ ]*) ;;
71 *) CFLAGS="$CFLAGS -Wcast-align" ;;
75 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
76 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
79 if test "x$enable_ansi" = "xyes"; then
81 *[\ \ ]-ansi[\ \ ]*) ;;
82 *) CFLAGS="$CFLAGS -ansi" ;;
86 *[\ \ ]-pedantic[\ \ ]*) ;;
87 *) CFLAGS="$CFLAGS -pedantic" ;;
94 AC_CHECK_SIZEOF(short)
97 AC_CHECK_SIZEOF(void *)
98 AC_CHECK_SIZEOF(long long)
99 AC_CHECK_SIZEOF(__int64)
104 AC_CHECK_FUNCS(vsnprintf vasprintf getpwnam_r nanosleep usleep poll)
106 dnl check for writev header and writev function so we're
107 dnl good to go if HAVE_WRITEV gets defined.
108 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
112 AC_SUBST(DBUS_CLIENT_CFLAGS)
113 AC_SUBST(DBUS_CLIENT_LIBS)
117 AC_SUBST(DBUS_BUS_CFLAGS)
118 AC_SUBST(DBUS_BUS_LIBS)
122 AC_SUBST(DBUS_TEST_CFLAGS)
123 AC_SUBST(DBUS_TEST_LIBS)
126 PKG_CHECK_MODULES(DBUS_GLIB, glib-2.0, have_glib=yes, have_glib=no)
128 if test x$have_glib = xno ; then
129 AC_MSG_WARN([GLib development libraries not found])
132 if test x$enable_glib = xyes; then
133 if test x$have_glib = xno; then
134 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
138 if test x$enable_glib = xno; then
142 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
145 AC_SUBST(DBUS_GLIB_CFLAGS)
146 AC_SUBST(DBUS_GLIB_LIBS)
150 if test -n "$QTDIR" -a -f $QTDIR/include/qglobal.h; then
152 DBUS_QT_CXXFLAGS=-I$QTDIR/include
155 dnl linking to kdecore will give us a bit of help from libtool
156 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
157 if test -z $kdelibs -a -f $kdelibs/libkdecore.la; then
160 DBUS_QT_LIBS=$kdelibs/libkdecore.la
163 if test x$have_qt = xno ; then
164 AC_MSG_WARN([Qt development libraries not found])
167 if test x$enable_qt = xyes; then
168 if test x$have_qt = xno; then
169 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
173 if test x$enable_qt = xno; then
177 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
180 AC_SUBST(DBUS_QT_CXXFLAGS)
181 AC_SUBST(DBUS_QT_LIBS)
196 dnl ==========================================================================
202 source code location: ${srcdir}
205 Building unit tests: ${enable_tests}
206 Building Qt bindings: ${have_qt}
207 Building GLib bindings: ${have_glib}
210 if test x$enable_tests = xyes; then
211 echo "NOTE: building with unit tests increases the size of the installed library"