AC_INIT(dbus/dbus.h)
-AM_INIT_AUTOMAKE(dbus, 0.4)
+AM_INIT_AUTOMAKE(dbus, 0.5)
AM_CONFIG_HEADER(config.h)
## byte order
AC_C_BIGENDIAN
-AC_CHECK_FUNCS(vsnprintf vasprintf getpwnam_r nanosleep usleep poll)
+AC_CHECK_LIB(socket,socket)
+AC_CHECK_LIB(nsl,gethostbyname)
+
+AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv socketpair)
+
+AC_CACHE_CHECK([for posix getpwnam_r],
+ ac_cv_func_posix_getpwnam_r,
+ [AC_TRY_RUN([
+#include <errno.h>
+#include <pwd.h>
+int main () {
+ char buffer[10000];
+ struct passwd pwd, *pwptr = &pwd;
+ int error;
+ errno = 0;
+ error = getpwnam_r ("", &pwd, buffer,
+ sizeof (buffer), &pwptr);
+ return (error < 0 && errno == ENOSYS)
+ || error == ENOSYS;
+} ],
+ [ac_cv_func_posix_getpwnam_r=yes],
+ [ac_cv_func_posix_getpwnam_r=no])])
+if test "$ac_cv_func_posix_getpwnam_r" = yes; then
+ AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
+ [Have POSIX function getpwnam_r])
+else
+ AC_CACHE_CHECK([for nonposix getpwnam_r],
+ ac_cv_func_nonposix_getpwnam_r,
+ [AC_TRY_LINK([#include <pwd.h>],
+ [char buffer[10000];
+ struct passwd pwd;
+ getpwnam_r ("", &pwd, buffer,
+ sizeof (buffer));],
+ [ac_cv_func_nonposix_getpwnam_r=yes],
+ [ac_cv_func_nonposix_getpwnam_r=no])])
+ if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
+ AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
+ [Have non-POSIX function getpwnam_r])
+ fi
+fi
dnl check for writev header and writev function so we're
dnl good to go if HAVE_WRITEV gets defined.
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=
# 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, have_glib_threads=yes, have_glib_threads=no)
if test x$have_glib = xno ; then
AC_MSG_WARN([GLib development libraries not found])
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)
AC_SUBST(DBUS_GLIB_LIBS)
+AC_SUBST(DBUS_GLIB_THREADS_LIBS)
# Qt detection
have_qt=no
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
"
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."