]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Auth LMDB backend
authorFred Morcos <fred.morcos@open-xchange.com>
Wed, 26 Jul 2023 12:57:16 +0000 (14:57 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:30 +0000 (13:28 +0100)
meson.build
meson/lmdb/meson.build [new file with mode: 0644]
meson_options.txt

index 21a9ce444d820140fb9118f3e2833f1baffa9c5e..b279dd61ca560dfc1a815219943792cc16fef66d 100644 (file)
@@ -112,19 +112,21 @@ opt_socket_dir = get_option('socket-dir')
 
 # Modules
 all_modules = [
-  ['gmysql', 'mysql'],
-  ['godbc', 'odbc'],
-  ['gpgsql', 'pgsql'],
-  ['gsqlite3', 'sqlite3'],
-  ['ldap', 'ldap'],
-  ['remote', 'curl'],
-  ['tinydns', 'cdb'],
-  ['geoip', 'geoip'],
+  ['gmysql',   ['mysql']],
+  ['godbc',    ['odbc']],
+  ['gpgsql',   ['pgsql']],
+  ['gsqlite3', ['sqlite3']],
+  ['ldap',     ['ldap']],
+  ['remote',   ['curl']],
+  ['tinydns',  ['cdb']],
+  ['geoip',    ['geoip']],
+  ['lmdb',     ['lmdb', 'boost-serialization']],
 ]
 selected_modules = []
+selected_dyn_modules = []
 foreach module: all_modules
   name = module[0]
-  dep = module[1]
+  module_deps = module[1]
   opt = get_option('module-' + name)
   opt_dyn = get_option('module-' + name + '-dyn')
 
@@ -133,11 +135,18 @@ foreach module: all_modules
       selected_modules += name
     endif
 
-    if name == 'remote' and not opt_unittests
-      continue                  # We only need cURL for unit tests.
+    if opt_dyn
+      selected_dyn_modules += name
     endif
 
-    subdir('meson' / dep)
+    foreach dep: module_deps
+      if name == 'remote' and dep == 'curl' and not opt_unittests
+        continue                  # We only need cURL for unit tests.
+      endif
+
+      subdir('meson' / dep)
+    endforeach
+
     # TODO Also build the actual backend.
   endif
 endforeach
diff --git a/meson/lmdb/meson.build b/meson/lmdb/meson.build
new file mode 100644 (file)
index 0000000..32b3f38
--- /dev/null
@@ -0,0 +1,8 @@
+# LMDB
+# Inputs: conf
+# Outputs: deps_lmdb
+
+deps_lmdb = dependency('lmdb', required: true)
+conf.set10('HAVE_LMDB', deps_lmdb.found(), description: 'Whether we have LMDB')
+conf.set10('LMDB', deps_lmdb.found(), description: 'Whether we have LMDB')
+summary('LMDB', deps_lmdb.found(), bool_yn: true, section: 'Configuration')
index 74c4d9bffb16a3d567a581f0e0d5d2e41ca9eeae..030b7c21e4ce8be0bb76003b4fdd2167df2bf164 100644 (file)
@@ -33,3 +33,5 @@ option('module-tinydns', type: 'boolean', value: false, description: 'Build the
 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')
 option('module-geoip-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable GeoIP backend')
+option('module-lmdb', type: 'boolean', value: false, description: 'Build the LMDB backend')
+option('module-lmdb-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable LMDB backend')