]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Auth remote backend (with and without ZeroMQ)
authorFred Morcos <fred.morcos@open-xchange.com>
Thu, 27 Jul 2023 09:39:40 +0000 (11:39 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:30 +0000 (13:28 +0100)
meson.build
meson/zeromq/meson.build [new file with mode: 0644]
meson_options.txt

index b279dd61ca560dfc1a815219943792cc16fef66d..d7142a6d1e46d2686b591a0324115f261a4eb384 100644 (file)
@@ -117,7 +117,7 @@ all_modules = [
   ['gpgsql',   ['pgsql']],
   ['gsqlite3', ['sqlite3']],
   ['ldap',     ['ldap']],
-  ['remote',   ['curl']],
+  ['remote',   ['prog-curl', 'zeromq']],
   ['tinydns',  ['cdb']],
   ['geoip',    ['geoip']],
   ['lmdb',     ['lmdb', 'boost-serialization']],
@@ -130,23 +130,43 @@ foreach module: all_modules
   opt = get_option('module-' + name)
   opt_dyn = get_option('module-' + name + '-dyn')
 
-  if opt or opt_dyn
-    if opt
+  if name == 'remote' and (opt != 'disabled' or opt_dyn != 'disabled')
+    if opt != 'disabled'
       selected_modules += name
     endif
 
-    if opt_dyn
+    if opt_dyn != 'disabled'
       selected_dyn_modules += name
     endif
 
     foreach dep: module_deps
-      if name == 'remote' and dep == 'curl' and not opt_unittests
-        continue                  # We only need cURL for unit tests.
+      if dep == 'prog-curl'
+        if not opt_unittests
+          continue                # We only need cURL for unit tests.
+        endif
+      elif dep == 'zeromq'
+        if opt != 'with-zeromq' and opt_dyn != 'with-zeromq'
+          continue
+        endif
       endif
 
       subdir('meson' / dep)
     endforeach
 
+    # TODO Also build the actual backend.
+  elif opt or opt_dyn
+    if opt
+      selected_modules += name
+    endif
+
+    if opt_dyn
+      selected_dyn_modules += name
+    endif
+
+    foreach dep: module_deps
+      subdir('meson' / dep)
+    endforeach
+
     # TODO Also build the actual backend.
   endif
 endforeach
diff --git a/meson/zeromq/meson.build b/meson/zeromq/meson.build
new file mode 100644 (file)
index 0000000..aac411f
--- /dev/null
@@ -0,0 +1,8 @@
+# Remote ZeroMQ Backend
+# Inputs: conf
+# Outputs: dep_zeromq
+
+dep_zeromq = dependency('libzmq', required: true)
+conf.set10('HAVE_LIBZMQ', dep_zeromq.found(), description: 'Whether we have libzmq')
+conf.set10('REMOTEBACKEND_ZEROMQ', dep_zeromq.found(), description: 'Whether we have ZeroMQ connector')
+summary('ZeroMQ', dep_zeromq.found(), bool_yn: true, section: 'Configuration')
index 030b7c21e4ce8be0bb76003b4fdd2167df2bf164..f5dd1b5b3412cdf56eadabd0928b291ed756b4f1 100644 (file)
@@ -27,8 +27,8 @@ option('module-gsqlite3', type: 'boolean', value: false, description: 'Build the
 option('module-gsqlite3-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable gsqlite3 backend')
 option('module-ldap', type: 'boolean', value: false, description: 'Build the LDAP backend')
 option('module-ldap-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable LDAP backend')
-option('module-remote', type: 'boolean', value: false, description: 'Build the remote backend')
-option('module-remote-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable remote backend')
+option('module-remote', type: 'combo', choices: ['disabled', 'with-zeromq', 'without-zeromq'], value: 'with-zeromq', description: 'Build the remote backend')
+option('module-remote-dyn', type: 'combo', choices: ['disabled', 'with-zeromq', 'without-zeromq'], value: 'disabled', description: 'Build the dynamically loadable remote backend')
 option('module-tinydns', type: 'boolean', value: false, description: 'Build the tinyDNS backend')
 option('module-tinydns-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable tinyDNS backend')
 option('module-geoip', type: 'boolean', value: false, description: 'Build the GeoIP backend')