summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-10-17 16:14:35 +0200
committerLibravatar GitHub <noreply@github.com>2018-10-17 16:14:35 +0200
commit46dafbf74a164fadf6de41c556d5cfc8a2fcee14 (patch)
tree70bcbb30dd628e463a462ab0adc8a9bbd3732fd0
parentMerge pull request #2861 from RyanDwyer/fix-empty-workspace-crashes (diff)
parentSet sysconfdir to /etc only if prefix is /usr (diff)
downloadsway-46dafbf74a164fadf6de41c556d5cfc8a2fcee14.tar.gz
sway-46dafbf74a164fadf6de41c556d5cfc8a2fcee14.tar.zst
sway-46dafbf74a164fadf6de41c556d5cfc8a2fcee14.zip
Merge pull request #2864 from sghctoma/freebsd-fixes
FreeBSD fixes
-rw-r--r--common/loop.c2
-rw-r--r--meson.build17
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 @@
1#define _POSIX_C_SOURCE 199309L 1#define _POSIX_C_SOURCE 200112L
2#include <limits.h> 2#include <limits.h>
3#include <string.h> 3#include <string.h>
4#include <stdbool.h> 4#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()
114 endforeach 114 endforeach
115endif 115endif
116 116
117add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c') 117# If prefix is '/usr', sysconfdir will be explicitly set to '/etc' by Meson to
118# enforce FHS compliance, so we should look for configs there as well.
119if prefix == '/usr'
120 add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c')
121else
122 add_project_arguments('-DSYSCONFDIR="/@0@/@1@"'.format(prefix, sysconfdir), language : 'c')
123endif
118 124
119version = get_option('sway-version') 125version = get_option('sway-version')
120if version != '' 126if version != ''
@@ -157,10 +163,17 @@ subdir('swaynag')
157subdir('swaylock') 163subdir('swaylock')
158 164
159config = configuration_data() 165config = configuration_data()
160config.set('sysconfdir', sysconfdir)
161config.set('datadir', join_paths(prefix, datadir)) 166config.set('datadir', join_paths(prefix, datadir))
162config.set('prefix', prefix) 167config.set('prefix', prefix)
163 168
169# If prefix is '/usr', sysconfdir will be explicitly set to '/etc' by Meson to
170# enforce FHS compliance, so we should look for configs there as well.
171if prefix == '/usr'
172 config.set('sysconfdir', sysconfdir)
173else
174 config.set('sysconfdir', join_paths(prefix, sysconfdir))
175endif
176
164configure_file( 177configure_file(
165 configuration: config, 178 configuration: config,
166 input: 'config.in', 179 input: 'config.in',