Commit 05b0b9e6 authored by Simon McVittie's avatar Simon McVittie

cmake: use the same default system bus address as for autotools

The system bus is unsupported (and rather meaningless) on Windows anyway,
so we can use anything. Also, make it clear that it has to be a
"specific" address that can be listened on *and* connected to,
like unix:path=/xxx - a listen-only address like unix:tmpdir=/xxx or
nonce-tcp: would not be suitable.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38201Reviewed-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 94368161
...@@ -80,7 +80,7 @@ Configuration flags ...@@ -80,7 +80,7 @@ Configuration flags
When using the cmake build system the dbus-specific configuration flags that can be given When using the cmake build system the dbus-specific configuration flags that can be given
to the cmake program are these (use -D<key>=<value> on command line). The listed values to the cmake program are these (use -D<key>=<value> on command line). The listed values
are the defaults. are the defaults (in a typical build - some are platform-specific).
// Choose the type of build, options are: None(CMAKE_CXX_FLAGS or // Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. // CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
...@@ -132,8 +132,8 @@ DBUS_INSTALL_SYSTEM_LIBS:BOOL=OFF ...@@ -132,8 +132,8 @@ DBUS_INSTALL_SYSTEM_LIBS:BOOL=OFF
// session bus default address // session bus default address
DBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=nonce-tcp: DBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=nonce-tcp:
// system bus default address // system bus default address (only useful on Unix)
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS:STRING=nonce-tcp: DBUS_SYSTEM_BUS_DEFAULT_ADDRESS:STRING=unix:path=/var/run/dbus/system_bus_socket
// Use atomic integer implementation for 486 // Use atomic integer implementation for 486
DBUS_USE_ATOMIC_INT_486:BOOL=OFF DBUS_USE_ATOMIC_INT_486:BOOL=OFF
......
...@@ -431,9 +431,17 @@ endif (WIN32) ...@@ -431,9 +431,17 @@ endif (WIN32)
set (DBUS_USER ) set (DBUS_USER )
# This won't work on Windows. It's not meant to - the system bus is
# meaningless on Windows anyway.
#
# This has to be suitable for hard-coding in client libraries as well as
# in the dbus-daemon's configuration, so it has to be valid to listen on
# and also to connect to. If this ever changes, it'll need to be split into
# two variables, one for the listening address and one for the connecting
# address.
set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:path=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket" CACHE STRING "system bus default address")
if (WIN32) if (WIN32)
set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "nonce-tcp:" CACHE STRING "system bus default address")
set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "nonce-tcp:" CACHE STRING "session bus default address") set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "nonce-tcp:" CACHE STRING "session bus default address")
set (DBUS_SYSTEM_CONFIG_FILE "etc/dbus-1/system.conf") set (DBUS_SYSTEM_CONFIG_FILE "etc/dbus-1/system.conf")
...@@ -441,7 +449,6 @@ if (WIN32) ...@@ -441,7 +449,6 @@ if (WIN32)
# bus-test expects a non empty string # bus-test expects a non empty string
set (DBUS_USER "Administrator") set (DBUS_USER "Administrator")
else (WIN32) else (WIN32)
set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:tmpdir=" CACHE STRING "system bus default address")
set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "unix:path=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default address") set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "unix:path=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default address")
set (sysconfdir "") set (sysconfdir "")
set (configdir ${sysconfdir}/dbus-1 ) set (configdir ${sysconfdir}/dbus-1 )
......
...@@ -1521,8 +1521,17 @@ fi ...@@ -1521,8 +1521,17 @@ fi
AC_SUBST(DBUS_SYSTEM_SOCKET) AC_SUBST(DBUS_SYSTEM_SOCKET)
AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default]) AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
## system bus only listens on local domain sockets, and never ## System bus only listens on local domain sockets, and never
## on an abstract socket (so only root can create the socket) ## on an abstract socket (so only root can create the socket).
##
## This won't work on Windows. It's not meant to - the system bus is
## meaningless on Windows anyway.
##
## This has to be suitable for hard-coding in client libraries as well as
## in the dbus-daemon's configuration, so it has to be valid to listen on
## and also to connect to. If this ever changes, it'll need to be split into
## two variables, one for the listening address and one for the connecting
## address.
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET" DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS) 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]) AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment