diff options
author | Simon McVittie <smcv@collabora.com> | 2022-06-24 12:47:25 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-07-13 20:36:13 +0100 |
commit | c2b2e0e728b37667f89bb050c4733a6eaabf33ce (patch) | |
tree | 964701dc8396cc54eb9aedad9c637d8f62ed817a /meson.build | |
parent | 5e6706a530bb71153c05082ee987b7337854c4a7 (diff) | |
download | dbus-c2b2e0e728b37667f89bb050c4733a6eaabf33ce.tar.gz |
build: Resolve localstatedir, sysconfdir relative to prefix
If the prefix is something like /opt/dbus, then --localstatedir=var
should result in using /opt/dbus/var, and so on. However, if configured
with --localstatedir=/var, then the prefix is ignored.
Meson special-cases these to default to /var and /etc (respectively),
as absolute paths, if the prefix is /usr; so distribution builds will
typically still end up using /var and /etc.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 96476add..a703db3a 100644 --- a/meson.build +++ b/meson.build @@ -689,8 +689,8 @@ dbus_enable_modular_tests = ( docs_dir = get_option('datadir') / 'doc' / 'dbus' -data_config.set('EXPANDED_LOCALSTATEDIR', '/' / get_option('localstatedir')) -data_config.set('EXPANDED_SYSCONFDIR', '/' / get_option('sysconfdir')) +data_config.set('EXPANDED_LOCALSTATEDIR', get_option('prefix') / get_option('localstatedir')) +data_config.set('EXPANDED_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir')) data_config.set('EXPANDED_RUNSTATEDIR', '/' / 'run') data_config.set('EXPANDED_BINDIR', get_option('prefix') / get_option('bindir')) data_config.set('EXPANDED_DATADIR', get_option('prefix') / get_option('datadir')) @@ -720,7 +720,11 @@ if system_socket == '' # We don't use runstatedir for this (yet?), because /var/run has been the # interoperable system bus socket for 10+ years. # See https://bugs.freedesktop.org/show_bug.cgi?id=101628 - system_socket = '/' / get_option('localstatedir')/'run'/'dbus'/'system_bus_socket' + system_socket = ( + get_option('prefix') + / get_option('localstatedir') + /'run'/'dbus'/'system_bus_socket' + ) endif data_config.set('DBUS_SYSTEM_SOCKET', system_socket) @@ -958,7 +962,7 @@ pkgconfig.generate( 'bindir': '${prefix}' / get_option('bindir'), 'datadir': '${prefix}' / get_option('datadir'), 'datarootdir': '${prefix}' / get_option('datadir'), - 'sysconfdir': '/' / get_option('sysconfdir'), + 'sysconfdir': '${prefix}' / get_option('sysconfdir'), 'daemondir': '${bindir}', 'system_bus_default_address': system_bus_default_address, |