Merge pull request #2864 from sghctoma/freebsd-fixes

FreeBSD fixes
This commit is contained in:
Drew DeVault 2018-10-17 16:14:35 +02:00 committed by GitHub
commit 46dafbf74a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View file

@ -1,4 +1,4 @@
#define _POSIX_C_SOURCE 199309L
#define _POSIX_C_SOURCE 200112L
#include <limits.h>
#include <string.h>
#include <stdbool.h>

View file

@ -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',