]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Export plugin extension in config.h
authorColin Vidal <colin@isc.org>
Mon, 21 Jul 2025 12:38:30 +0000 (14:38 +0200)
committerColin Vidal <colin@isc.org>
Mon, 28 Jul 2025 21:08:04 +0000 (23:08 +0200)
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)

meson.build

index 7697be86d43fe7d6bf943e5e81418b166f3f32e2..c4316aa05dd799b40bd3a78af31a01e85e3c04f2 100644 (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')