summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo.moya@collabora.co.uk>2012-05-01 15:08:52 +0200
committerRodrigo Moya <rodrigo@gnome-db.org>2012-05-01 15:08:52 +0200
commit6742aef533b0024e4c59380dd5bdac25492ce7ad (patch)
treececc602fdf3487fdc465e8dc066bb0ddabe0e399
parente48de6be84f89636f11159b9e7ea56b6dc49d577 (diff)
downloaddbus-6742aef533b0024e4c59380dd5bdac25492ce7ad.tar.gz
Check for AF_BUS socket family and use that by default if found
-rw-r--r--configure.ac27
1 files changed, 25 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 59b23d27..73d8a79c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1491,6 +1491,19 @@ if test "x$with_systemdsystemunitdir" != xno; then
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+## Check for AF_DBUS
+AC_MSG_CHECKING([for AF_BUS socket family])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/socket.h>],]]
+ [[return socket (PF_BUS, SOCK_STREAM, 0);]])],
+ [have_afbus=yes],
+ [have_afbus=no])
+AC_MSG_RESULT([$have_afbus])
+if test "x$have_afbus" = "xyes"; then
+ AC_DEFINE(HAVE_AFBUS, 1, [Define if AF_BUS is available])
+fi
+
##### Set up location for system bus socket
if ! test -z "$with_system_socket"; then
DBUS_SYSTEM_SOCKET=$with_system_socket
@@ -1503,7 +1516,11 @@ AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the soc
## system bus only listens on local domain sockets, and never
## on an abstract socket (so only root can create the socket)
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
+if test x$have_afdbus = xyes; then
+ DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="afbus:path=$DBUS_SYSTEM_SOCKET"
+else
+ DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
+fi
AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
@@ -1630,7 +1647,11 @@ AC_SUBST(TEST_SOCKET_DIR)
AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
if test "x$dbus_unix" = xyes; then
- TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
+ if test "x$have_afdbus" = "xyes"; then
+ TEST_LISTEN="dbus:tmpdir=$TEST_SOCKET_DIR"
+ else
+ TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
+ fi
else
TEST_LISTEN="tcp:host=localhost"
fi
@@ -1650,6 +1671,8 @@ if test x$dbus_win = xyes; then
DBUS_SESSION_BUS_DEFAULT_ADDRESS="$with_dbus_session_bus_default_address"
elif test x$have_launchd = xyes; then
DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
+elif test x$have_afdbus = xyes; then
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="dbus:tmpdir=$DBUS_SESSION_SOCKET_DIR"
else
DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
fi