summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-05-18 16:13:36 +0100
committerSimon McVittie <smcv@collabora.com>2022-10-11 17:14:11 +0100
commite5d8d0c19ad932dad44b3302c90ba692d3a9017a (patch)
tree5d0301595d4387629842f14d1d01d2831b98ca39 /meson.build
parentba6fb129bdb57320f84032e02f34a98d433caf14 (diff)
downloaddbus-e5d8d0c19ad932dad44b3302c90ba692d3a9017a.tar.gz
build: Show a warning if the system bus socket is not interoperable
We would like to start using ${runstatedir}/dbus/system_bus_socket, so that distributors who make /var/run a symbolic link to /run will usually get their dbus-daemon listening on /run/dbus/system_bus_socket, which has some advantages in corner cases, such as when /var is mediated by an automounter or is unmounted during system shutdown. Unfortunately, the interoperable path in the D-Bus Specification is /var/run/dbus/system_bus_socket for historical reasons (D-Bus is older than /run), and older versions of Slackware are known to have had /run and /var/run as distinct directories. Do a check during configuration to catch systems configured like this and show a warning. When cross-compiling, this assumes that the system where dbus is built (the build system in Autotools/Meson, or the "host" in CMake terminology) has its /var/run and /run set up in a way that is compatible with the system where dbus will run (the host system in Autotools/Meson, or the "target" in CMake terminology). This is not 100% correct, but seems good enough for a warning that will hopefully only trigger for misguided OS distributors. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build19
1 files changed, 19 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 20e9dbc6..caaaccf2 100644
--- a/meson.build
+++ b/meson.build
@@ -831,6 +831,25 @@ if system_socket == ''
/'run'/'dbus'/'system_bus_socket'
)
endif
+
+# This check assumes that the disposition of /run and /var/run on the
+# system where we're building is the same as on the system we're building
+# for, so we can't usefully do this check if we're building for Windows,
+# or if we're cross-building for Unix on a Windows machine.
+#
+# The check is shared between Autotools, CMake and Meson.
+# Because we only run it on Unix, it's fine to make it a shell script.
+if platform_unix and build_machine.system() != 'windows'
+ msg = run_command(
+ find_program('tools/check-runstatedir.sh'),
+ system_socket,
+ check: false,
+ ).stdout()
+ if msg != ''
+ warning(msg)
+ endif
+endif
+
data_config.set('DBUS_SYSTEM_SOCKET', system_socket)
## System bus only listens on local domain sockets, and never