Export plugin extension in config.h

Dynamically loadable libraries all use the `.so` extension on
BIND9-supported platforms, except for macOS. Export the dynamic library
extension of the current build platform in the generated `config.h`
file, in order to let the plugin code building plugin path based on a
simple plugin name. (which then would be platform-independent)
This commit is contained in:
Colin Vidal 2025-07-21 14:38:30 +02:00
parent e6b4af9357
commit be03ed6520

View file

@ -215,7 +215,8 @@ if host_machine.cpu_family() == 'x86'
)
endif
if host_machine.system() == 'darwin'
isdarwin = host_machine.system() == 'darwin'
if isdarwin
add_project_arguments(
cc.get_supported_arguments(
'-Wno-deprecated-declarations', # For GSS.Framework
@ -279,6 +280,13 @@ config.set_quoted('RNDC_CONFFILE', sysconfdir / 'rndc.conf')
config.set_quoted('RNDC_KEYFILE', sysconfdir / 'rndc.key')
config.set_quoted('NAMED_PLUGINDIR', libdir / 'bind')
if isdarwin
# Plugin extensions - macOS is the only specific case
config.set_quoted('NAMED_PLUGINEXT', '.dylib')
else
config.set_quoted('NAMED_PLUGINEXT', '.so')
endif
config.set_quoted('NAMED_LOCALSTATEDIR', localstatedir)
config.set_quoted('NAMED_SYSCONFDIR', sysconfdir)
config.set_quoted('NAMED_CONFFILE', sysconfdir / 'named.conf')