AC_INIT(dbus/dbus.h)
-AM_INIT_AUTOMAKE(dbus, 0.35)
+AM_INIT_AUTOMAKE(dbus, 0.51)
AM_CONFIG_HEADER(config.h)
AC_HEADER_STDC
AC_ARG_ENABLE(qt, [ --enable-qt enable Qt-friendly client library],enable_qt=$enableval,enable_qt=auto)
+AC_ARG_ENABLE(qt3, [ --enable-qt3 enable Qt3-friendly client library],enable_qt3=$enableval,enable_qt3=auto)
AC_ARG_ENABLE(glib, [ --enable-glib enable GLib-friendly client library],enable_glib=$enableval,enable_glib=auto)
AC_ARG_ENABLE(gtk, [ --enable-gtk enable GTK-requiring executables],enable_gtk=$enableval,enable_gtk=auto)
AC_ARG_ENABLE(tests, [ --enable-tests enable unit test code],enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
AC_ARG_WITH(system-pid-file, [ --with-system-pid-file=[pidfile] PID file for systemwide daemon])
AC_ARG_WITH(system-socket, [ --with-system-socket=[filename] UNIX domain socket for systemwide daemon])
AC_ARG_WITH(console-auth-dir, [ --with-console-auth-dir=[dirname] directory to check for console ownerhip])
+AC_ARG_WITH(dbus_user, [ --with-dbus-user=<user> User for running the DBUS daemon (messagebus)])
dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
dnl and also some stuff in the test/ subdir
AC_SUBST(DBUS_TEST_LIBS)
# Glib detection
-PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
-PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
+PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0 >= 2.4, have_glib=yes, have_glib=no)
+PKG_CHECK_MODULES(DBUS_GLIB_THREADS, gthread-2.0 >= 2.4, have_glib_threads=yes, have_glib_threads=no)
if test x$have_glib = xno ; then
AC_MSG_WARN([GLib development libraries not found])
AC_SUBST(DBUS_GTK_THREADS_CFLAGS)
AC_SUBST(DBUS_GTK_THREADS_LIBS)
-# Qt detection
-AC_PATH_PROG(QT_MOC, moc, no)
+
+dnl Qt3 detection
+AC_PATH_PROG(QT3_MOC, moc, no)
have_qt=no
AC_MSG_CHECKING([for qglobal.h])
if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
have_qt=yes
- DBUS_QT_CXXFLAGS="-I$QTDIR/include"
+ DBUS_QT3_CXXFLAGS="-I$QTDIR/include"
else
for dir in "${prefix}/include/qt" "/usr/include/qt-3.1" "/usr/include/qt3" "/usr/include/qt" "/usr/lib/qt/include" "/usr/lib/qt-3.1/include"; do
if test -f "$dir/qglobal.h"; then
- have_qt=yes
- DBUS_QT_CXXFLAGS="-I$dir"
+ have_qt3=yes
+ DBUS_QT3_CXXFLAGS="-I$dir"
+ DBUS_QT3_LIBS="-L$QTDIR/lib -lqt-mt"
fi
done
fi
-if test x"$have_qt" = x"yes"; then
+if test x"$have_qt3" = x"yes"; then
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([not found])
fi
-dnl linking to kdecore will give us a bit of help from libtool
-if (! kde-config >& /dev/null); then
- have_qt=no
-else
- kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
- if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
- have_qt=no
- else
- DBUS_QT_LIBS="$kdelibs/libkdecore.la"
+if test x$have_qt3 = xno ; then
+ AC_MSG_WARN([Qt3 development libraries not found])
+fi
+
+if test x$enable_qt3 = xyes; then
+ if test x$have_qt3 = xno; then
+ AC_MSG_ERROR([Qt3 integration explicitly required, and Qt3 libraries not found])
fi
fi
+if test x$enable_qt3 = xno; then
+ have_qt3=no;
+fi
+
+AM_CONDITIONAL(HAVE_QT3, test x$have_qt3 = xyes)
+
+dnl Qt flags
+AC_SUBST(DBUS_QT3_CXXFLAGS)
+AC_SUBST(DBUS_QT3_LIBS)
+
+
+dnl Qt detection
+PKG_CHECK_MODULES(DBUS_QT, QtCore >= 4.0, have_qt=yes, have_qt=no)
+
if test x$have_qt = xno ; then
AC_MSG_WARN([Qt development libraries not found])
fi
have_qt=no;
fi
+QT_MOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
+QT_MOC=${QT_MOC}/bin/moc
+
AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
dnl Qt flags
-AC_SUBST(DBUS_QT_CXXFLAGS)
+AC_SUBST(DBUS_QT_CFLAGS)
AC_SUBST(DBUS_QT_LIBS)
+AC_SUBST(QT_MOC)
+
+dnl QTestLib detection
+PKG_CHECK_MODULES(DBUS_QTESTLIB, QtTest, have_qtest=yes, have_qtest=no)
+
+if test x$have_qtest = xno ; then
+ AC_MSG_WARN([Qt Unit Test library not found])
+fi
+
+if test x$have_qt = xno; then
+ have_qtest=no
+fi
+
+AM_CONDITIONAL(HAVE_QTESTLIB, test x$have_qtest = xyes)
+
+AC_SUBST(DBUS_QTESTLIB_CFLAGS)
+AC_SUBST(DBUS_QTESTLIB_LIBS)
### X11 detection
AC_PATH_XTRA
AC_SUBST(DBUS_CONSOLE_AUTH_DIR)
AC_DEFINE_UNQUOTED(DBUS_CONSOLE_AUTH_DIR, "$DBUS_CONSOLE_AUTH_DIR", [Directory to check for console ownerhip])
+#### User to start the system bus as
+if test -z "$with_dbus_user" ; then
+ DBUS_USER=messagebus
+else
+ DBUS_USER=$with_dbus_user
+fi
+AC_SUBST(DBUS_USER)
+AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
+
#### Tell tests where to find certain stuff in builddir
ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
TEST_PATH(SERVICE_BINARY, test-service)
TEST_PATH(SHELL_SERVICE_BINARY, test-shell-service)
TEST_PATH(GLIB_SERVICE_BINARY, glib/test-service-glib)
+TEST_PATH(PYTHON_SERVICE_BINARY, python/test-service.py)
TEST_PATH(EXIT_BINARY, test-exit)
TEST_PATH(SEGFAULT_BINARY, test-segfault)
TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
if test x$enable_python = xno; then
have_python=no
else
+ have_python_version=2.4
AC_MSG_NOTICE([Checking to see if we can build Python bindings])
have_python=no
- AM_PATH_PYTHON(2.4)
+ AM_PATH_PYTHON()
if test -z "$PYTHON" ; then
AC_MSG_WARN([Python not found])
else
+ AC_MSG_CHECKING([whether $PYTHON version >= $have_python_version])
+ AM_PYTHON_CHECK_VERSION([$PYTHON], [$have_python_version],
+ [have_python_version="yes"],
+ [have_python_version="too old"])
+
+ AC_MSG_RESULT($have_python_version)
+
AC_CHECK_PROGS(PYREX, pyrexc)
if test -z "$PYREX" ; then
AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
- if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
+ if test x$have_pyrex = xyes -a x$have_python_headers = xyes -a "x$have_python_version" = xyes ; then
have_python=yes
fi
fi
if test x$have_python = xno ; then
if test x$enable_python = xyes ; then
- AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
+ AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings because either Pyrex, Python headers or a suitable Python version was not found])
else
- AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
+ AC_MSG_WARN([Couldn't find either Pyrex, the Python headers or a suitable version of Python, not building Python bindings])
fi
fi
fi
python/Makefile
python/examples/Makefile
qt/Makefile
+qt3/Makefile
gcj/Makefile
gcj/org/Makefile
gcj/org/freedesktop/Makefile
tools/Makefile
test/Makefile
test/glib/Makefile
+test/python/Makefile
+test/qt/Makefile
doc/Makefile
dbus-1.pc
dbus-glib-1.pc
test/data/valid-service-files/debug-glib.service
test/data/valid-service-files/debug-shell-echo-success.service
test/data/valid-service-files/debug-shell-echo-fail.service
+test/data/valid-service-files/debug-python.service
])
### FIXME it's bizarre that have_qt and have_glib are used
Building assertions: ${enable_asserts}
Building checks: ${enable_checks}
Building Qt bindings: ${have_qt}
+ Building Qt3 bindings: ${have_qt3}
Building GLib bindings: ${have_glib}
Building Python bindings: ${have_python}
Building SELinux support: ${have_selinux}
System bus PID file: ${DBUS_SYSTEM_PID_FILE}
Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
+ System bus user: ${DBUS_USER}
'make check' socket dir: ${TEST_SOCKET_DIR}
"