2003-03-14 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / configure.in
index 281da37..2d44247 100644 (file)
@@ -3,7 +3,7 @@ AC_PREREQ(2.52)
 
 AC_INIT(dbus/dbus.h)
 
-AM_INIT_AUTOMAKE(dbus, 0.4)
+AM_INIT_AUTOMAKE(dbus, 0.5)
 
 AM_CONFIG_HEADER(config.h)
 
@@ -132,8 +132,9 @@ AC_CHECK_SIZEOF(__int64)
 AC_C_BIGENDIAN
 
 AC_CHECK_LIB(socket,socket)
+AC_CHECK_LIB(nsl,gethostbyname)
 
-AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv)
+AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv socketpair)
 
 AC_CACHE_CHECK([for posix getpwnam_r],
                ac_cv_func_posix_getpwnam_r,
@@ -200,6 +201,21 @@ if test x$dbus_have_gnuc_varargs = xyes; then
     AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
 fi
 
+dnl Check for various credentials.
+AC_MSG_CHECKING(for struct cmsgcred)
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+struct cmsgcred cred;
+
+cred.cmcred_pid = 0;
+],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
+AC_MSG_RESULT($dbus_have_struct_cmsgcred)
+
+if test x$dbus_have_struct_cmsgcred = xyes; then
+    AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
+fi
 
 DBUS_CLIENT_CFLAGS=
 DBUS_CLIENT_LIBS=
@@ -218,7 +234,7 @@ AC_SUBST(DBUS_TEST_LIBS)
 
 # Glib detection
 PKG_CHECK_MODULES(DBUS_GLIB, glib-2.0, have_glib=yes, have_glib=no)
-PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0)
+PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
 
 if test x$have_glib = xno ; then
     AC_MSG_WARN([GLib development libraries not found])
@@ -235,6 +251,7 @@ if test x$enable_glib = xno; then
 fi
 
 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
+AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
 
 dnl GLib flags
 AC_SUBST(DBUS_GLIB_CFLAGS)
@@ -249,11 +266,15 @@ if test -n "$QTDIR" -a -f $QTDIR/include/qglobal.h; then
 fi
 
 dnl linking to kdecore will give us a bit of help from libtool
-kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
-if test -z $kdelibs -a -f $kdelibs/libkdecore.la; then
+if (! kde-config >& /dev/null); then
     have_qt=no
 else
-    DBUS_QT_LIBS=$kdelibs/libkdecore.la
+    kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
+    if test -z $kdelibs -a -f $kdelibs/libkdecore.la; then
+        have_qt=no
+    else
+        DBUS_QT_LIBS=$kdelibs/libkdecore.la
+    fi
 fi
 
 if test x$have_qt = xno ; then
@@ -309,13 +330,13 @@ echo "
 "
 
 if test x$enable_tests = xyes; then
-        echo "NOTE: building with unit tests increases the size of the installed library"
+        echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure"
 fi
 if test x$enable_gcov = xyes; then
         echo "NOTE: building with coverage profiling is definitely for developers only"
 fi
 if test x$enable_verbose_mode = xyes; then
-        echo "NOTE: building with verbose mode increases library size, but is probably a good idea anyway."
+        echo "NOTE: building with verbose mode increases library size and may slightly increase security risk, but aids debugging."
 fi
 if test x$enable_asserts = xyes; then
         echo "NOTE: building with assertions increases library size, but is probably a good idea anyway."