aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-09-22 01:12:33 +0200
committerKenny Levinsen <kl@kl.wtf>2020-09-22 01:14:20 +0200
commit884c1416b302e9d855453d8e83cc09e54796a434 (patch)
treeaeee0f56dff75586588ecb67d2ce34305714e244 /meson.build
parenta763e16f26529323cd23a84a53f8d03431133d91 (diff)
meson: Make default seatd socket path configurable
FreeBSD and Linux have different preferred socket locations. Expose an option to set the location, and implement simple auto-logic for linux/freebsd.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build11
1 files changed, 11 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index fa000c1..1ab3d87 100644
--- a/meson.build
+++ b/meson.build
@@ -14,6 +14,16 @@ project(
# Bump whenever ABI-breaking changes occur.
libseat_soversion = 1
+defaultpath = get_option('defaultpath')
+if defaultpath == ''
+ system = target_machine.system()
+ if system == 'linux'
+ defaultpath = '/run/seatd.sock'
+ else
+ defaultpath = '/var/run/seatd.sock'
+ endif
+endif
+
add_project_arguments(
[
'-Wundef',
@@ -32,6 +42,7 @@ add_project_arguments(
'-D_XOPEN_SOURCE=700',
'-D__BSD_VISIBLE',
'-DSEATD_VERSION="@0@"'.format(meson.project_version()),
+ '-DSEATD_DEFAULTPATH="@0@"'.format(defaultpath)
],
language: 'c',
)