From 553c3adc095fbabb28f90c6d6cd377cfab4a699e Mon Sep 17 00:00:00 2001 From: Fred Morcos Date: Thu, 27 Jul 2023 11:39:40 +0200 Subject: [PATCH] Meson: Auth remote backend (with and without ZeroMQ) --- meson.build | 32 ++++++++++++++++++++++++++------ meson/zeromq/meson.build | 8 ++++++++ meson_options.txt | 4 ++-- 3 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 meson/zeromq/meson.build diff --git a/meson.build b/meson.build index b279dd61ca..d7142a6d1e 100644 --- a/meson.build +++ b/meson.build @@ -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 index 0000000000..aac411f0ca --- /dev/null +++ b/meson/zeromq/meson.build @@ -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') diff --git a/meson_options.txt b/meson_options.txt index 030b7c21e4..f5dd1b5b34 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') -- 2.47.2