bring Qt3 library back. Some apps that are not in the KDE trunk are using it.
[platform/upstream/dbus.git] / configure.in
index ae9359a..aede581 100644 (file)
@@ -3,7 +3,7 @@ AC_PREREQ(2.52)
 
 AC_INIT(dbus/dbus.h)
 
-AM_INIT_AUTOMAKE(dbus, 0.34)
+AM_INIT_AUTOMAKE(dbus, 0.51)
 
 AM_CONFIG_HEADER(config.h)
 
@@ -47,6 +47,7 @@ AC_ISC_POSIX
 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)
@@ -70,6 +71,8 @@ AC_ARG_WITH(session-socket-dir, [  --with-session-socket-dir=[dirname] Where to
 AC_ARG_WITH(test-socket-dir,    [  --with-test-socket-dir=[dirname]    Where to put sockets for make check])
 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
@@ -857,8 +860,8 @@ AC_SUBST(DBUS_TEST_CFLAGS)
 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])
@@ -925,40 +928,54 @@ AC_SUBST(DBUS_GTK_LIBS)
 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
@@ -973,11 +990,31 @@ if test x$enable_qt = xno; then
    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
@@ -1167,6 +1204,25 @@ fi
 
 AC_SUBST(DBUS_SYSTEM_PID_FILE)
 
+#### Directory to check for console ownership
+if ! test -z "$with_console_auth_dir"; then
+   DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
+else
+   DBUS_CONSOLE_AUTH_DIR=/var/run/console/
+fi
+
+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`
 
@@ -1179,7 +1235,9 @@ AC_SUBST(TEST_$1)
 
 TEST_PATH(SERVICE_DIR, data/valid-service-files)
 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)
@@ -1216,13 +1274,21 @@ AC_SUBST(DBUS_SESSION_SOCKET_DIR)
 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.2)
+    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
@@ -1233,16 +1299,16 @@ else
 
         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
@@ -1260,9 +1326,12 @@ bus/dbus-daemon.1
 Makefile
 dbus/Makefile
 glib/Makefile
+glib/examples/Makefile
+glib/examples/statemachine/Makefile
 python/Makefile
 python/examples/Makefile
 qt/Makefile
+qt3/Makefile
 gcj/Makefile
 gcj/org/Makefile
 gcj/org/freedesktop/Makefile
@@ -1276,6 +1345,8 @@ bus/Makefile
 tools/Makefile
 test/Makefile
 test/glib/Makefile
+test/python/Makefile
+test/qt/Makefile
 doc/Makefile
 dbus-1.pc
 dbus-glib-1.pc
@@ -1285,6 +1356,9 @@ test/data/valid-config-files/debug-allow-all-sha1.conf
 test/data/valid-service-files/debug-echo.service
 test/data/valid-service-files/debug-segfault.service
 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
@@ -1342,6 +1416,7 @@ echo "
         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}
@@ -1359,6 +1434,8 @@ echo "
         System bus address:       ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
         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}
 "