diff --git a/meson.build b/meson.build index 766b99cbee..a74c712130 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/src/hooks/dhcp/radius/meson.build b/src/hooks/dhcp/radius/meson.build index f2f2ba3722..4440f6394e 100644 --- a/src/hooks/dhcp/radius/meson.build +++ b/src/hooks/dhcp/radius/meson.build @@ -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, diff --git a/src/hooks/dhcp/radius/tests/meson.build b/src/hooks/dhcp/radius/tests/meson.build index 3a20e763ae..e121c85420 100644 --- a/src/hooks/dhcp/radius/tests/meson.build +++ b/src/hooks/dhcp/radius/tests/meson.build @@ -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],