]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3732] Prepend prefix only if the prefix is explicitly provided
authorAndrei Pavel <andrei@isc.org>
Tue, 1 Apr 2025 09:37:58 +0000 (12:37 +0300)
committerAndrei Pavel <andrei@isc.org>
Fri, 4 Apr 2025 09:37:22 +0000 (12:37 +0300)
meson.build
src/hooks/dhcp/radius/meson.build
src/hooks/dhcp/radius/tests/meson.build

index 766b99cbee085165a97cb3ceac1214aa9f043556..a74c712130be4575901bae769a3b9ed61be890a2 100644 (file)
@@ -65,6 +65,15 @@ RUNSTATEDIR = LOCALSTATEDIR / 'run/kea'
 RUNSTATEDIR_INSTALLED = PREFIX / RUNSTATEDIR
 TEST_CA_DIR = TOP_SOURCE_DIR / 'src/lib/asiolink/testutils/ca'
 
+# Meson is annoying with its opinionated alteration of certain paths based on whether prefix is default or not.
+# So we revert what it does.
+# Prepend prefix only if the prefix was explicitly provided.
+if PREFIX == '/usr'
+    SYSCONFDIR_INSTALLED = SYSCONFDIR
+else
+    SYSCONFDIR_INSTALLED = PREFIX / SYSCONFDIR
+endif
+
 #### Build Options
 
 crypto_opt = get_option('crypto')
index f2f2ba372252ee16802ac9f2c37c91713c56ef8e..4440f6394e9c25d9b334b124cbde415a938ade7c 100644 (file)
@@ -25,7 +25,7 @@ dhcp_radius_lib = shared_library(
     'radius_service.cc',
     'radius_utils.cc',
     'version.cc',
-    cpp_args: [f'-DDICTIONARY="@PREFIX@/@SYSCONFDIR@/kea/radius/dictionary"'],
+    cpp_args: [f'-DDICTIONARY="@SYSCONFDIR_INSTALLED@/kea/radius/dictionary"'],
     dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
index 3a20e763ae8a94b1e926eeb0b0164454b6acd43c..e121c854206f8c16135421642b36910b4dbf2cb5 100644 (file)
@@ -27,7 +27,7 @@ dhcp_radius_tests = executable(
     'utils_unittests.cc',
     cpp_args: [
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
-        f'-DDICTIONARY="@PREFIX@/@SYSCONFDIR@/kea/radius/dictionary"',
+        f'-DDICTIONARY="@SYSCONFDIR_INSTALLED@/kea/radius/dictionary"',
         f'-DTEST_DICTIONARY="@TOP_SOURCE_DIR@/src/hooks/dhcp/radius/data/dictionary"',
     ],
     dependencies: [GTEST_DEP, CRYPTO_DEP],