]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson.build: conditional branching on run_dir
authorOto Šťáva <oto.stava@nic.cz>
Fri, 5 Jan 2024 16:54:41 +0000 (17:54 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 15 Jan 2024 13:39:49 +0000 (14:39 +0100)
This should, to the best of our knowledge, give us the correct run_dir
on Linux, macOS and BSDs.

meson.build

index 5b7b6eddd4a618fa27f9242bafa49b839d4e1ec2..e6066e7a049cca63f96647c44c4ff4208fa7eb60 100644 (file)
@@ -53,7 +53,13 @@ lib_dir = prefix / get_option('libdir') / 'knot-resolver'
 modules_dir = lib_dir / 'kres_modules'
 sbin_dir = prefix / get_option('sbindir')
 bin_dir = prefix / get_option('bindir')
-run_dir = prefix / get_option('localstatedir') / 'run' / 'knot-resolver'
+if host_machine.system() == 'linux'
+  run_dir = '/run' / 'knot-resolver'
+elif host_machine.system() == 'darwin'
+  run_dir = prefix / get_option('localstatedir') / 'run' / 'knot-resolver'
+else
+  run_dir = get_option('localstatedir') / 'run' / 'knot-resolver'
+endif
 systemd_work_dir = prefix / get_option('localstatedir') / 'lib' / 'knot-resolver'
 systemd_cache_dir = prefix / get_option('localstatedir') / 'cache' / 'knot-resolver'
 systemd_unit_dir = prefix / 'lib' / 'systemd' / 'system'