diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-17 16:14:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-17 16:14:35 +0200 |
commit | 46dafbf74a164fadf6de41c556d5cfc8a2fcee14 (patch) | |
tree | 70bcbb30dd628e463a462ab0adc8a9bbd3732fd0 | |
parent | e46c3ffbc9f3cf51f08b3b9a0ae1c62e7ddd0a9a (diff) | |
parent | af2cfa52211d59ecfb6e3ccd9be4c7ccbd920268 (diff) | |
download | sway-46dafbf74a164fadf6de41c556d5cfc8a2fcee14.tar.xz |
Merge pull request #2864 from sghctoma/freebsd-fixes
FreeBSD fixes
-rw-r--r-- | common/loop.c | 2 | ||||
-rw-r--r-- | meson.build | 17 |
2 files changed, 16 insertions, 3 deletions
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 <limits.h> #include <string.h> #include <stdbool.h> 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', |