From 2694fd72b6c98da6e8ee11cc14bfe9c02dff16f6 Mon Sep 17 00:00:00 2001 From: sghctoma Date: Wed, 17 Oct 2018 11:09:58 +0200 Subject: [PATCH 1/2] Increase _POSIX_C_SOURCE to 200112L CLOCK_MONOTONIC appeared in IEEE Std. 1003.1-200x, it was not part of POSIX.1b (the 1993 version), and FreeBSD treats it accordingly. --- common/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/loop.c b/common/loop.c index 750bee75..82b80017 100644 --- a/common/loop.c +++ b/common/loop.c @@ -1,4 +1,4 @@ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200112L #include #include #include From af2cfa52211d59ecfb6e3ccd9be4c7ccbd920268 Mon Sep 17 00:00:00 2001 From: sghctoma Date: Wed, 17 Oct 2018 15:06:55 +0200 Subject: [PATCH 2/2] Set sysconfdir to /etc only if prefix is /usr PR #2855 basically hardcodes the config file path to /etc, which is a problem on e.g. FreeBSD, where the expected path for config files of non-base software is '/usr/local/etc'. Meson sets sysconfdir to '/etc' explicitly only when prefix is '/usr', so it is still possible to use '/usr/local' as prefix, and install the config files under '/usr/local/etc'. This commit allows to do that by setting sysconfdir based on the value of prefix. --- meson.build | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 3fb1e81e..1e2b53fa 100644 --- a/meson.build +++ b/meson.build @@ -114,7 +114,13 @@ if scdoc.found() endforeach endif -add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c') +# If prefix is '/usr', sysconfdir will be explicitly set to '/etc' by Meson to +# enforce FHS compliance, so we should look for configs there as well. +if prefix == '/usr' + add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c') +else + add_project_arguments('-DSYSCONFDIR="/@0@/@1@"'.format(prefix, sysconfdir), language : 'c') +endif version = get_option('sway-version') if version != '' @@ -157,10 +163,17 @@ subdir('swaynag') subdir('swaylock') config = configuration_data() -config.set('sysconfdir', sysconfdir) config.set('datadir', join_paths(prefix, datadir)) config.set('prefix', prefix) +# If prefix is '/usr', sysconfdir will be explicitly set to '/etc' by Meson to +# enforce FHS compliance, so we should look for configs there as well. +if prefix == '/usr' + config.set('sysconfdir', sysconfdir) +else + config.set('sysconfdir', join_paths(prefix, sysconfdir)) +endif + configure_file( configuration: config, input: 'config.in',