aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meson.build17
1 files 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()
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',