From: Fred Morcos Date: Wed, 17 Jan 2024 12:11:34 +0000 (+0100) Subject: Meson: Refactor the tools and build a single libpdns_common X-Git-Tag: rec-5.1.0-alpha1~80^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca603a4d54bced9adc6d1f4ac180e4abc4bc4b36;p=thirdparty%2Fpdns.git Meson: Refactor the tools and build a single libpdns_common libpdns_common is now shared among pdns-auth server and all its related tools. This avoids some caveats we've previously had: - No need for spurious builds of static archives - No need for different libpdns_TOOLNAME libraries - No need to list sources files multiple times - Build everything in the top-level directory - Avoid the race condition between pdns/, modules/ and config.h - A much simplified pdns/meson.build which only collects source files --- diff --git a/meson.build b/meson.build index 2e0a7c72d5..5196e029ec 100644 --- a/meson.build +++ b/meson.build @@ -143,10 +143,22 @@ deps = [ dep_geoip, dep_mmdb, dep_cxx_fs, + dep_boost_test, ] subdir('pdns') +libpdns_cdb = dependency('', required: false) +if dep_cdb.found() + libpdns_cdb = declare_dependency( + link_whole: static_library( + 'libpdns-cdb', + sources: libpdns_cdb_sources, + dependencies: deps, + ) + ) +endif + # Modules all_modules = [ 'bind', @@ -187,26 +199,38 @@ conf.set_quoted('PDNS_DYN_MODULES', ' '.join(selected_dyn_modules), description: # Generate config.h config_h = configure_file(configuration: conf, output: 'config.h') +libpdns_common = static_library( + 'pdns-common', + common_sources, + config_h, + link_with: static_library( + 'pdns-bindparser', + libpdns_bindlexer_sources, + libpdns_bindparser_sources, + cpp_args: '-Wno-redundant-decls', + dependencies: deps, + ), + dependencies: deps, +) + pdns_auth = executable( 'pdns-auth', + pdns_auth_sources, config_h, export_dynamic: true, - dependencies: [ - dep_modules, - libpdns_auth, - ], + dependencies: deps + dep_modules, + link_with: libpdns_common, ) -tools = ['pdns-auth-util', 'pdns-auth-control', 'zone2sql', 'zone2json'] +tools = ['pdns-auth-util', 'pdns-auth-control', 'pdns-zone2sql', 'pdns-zone2json'] if get_option('module-ldap') != 'disabled' - tools += 'zone2ldap' + tools += 'pdns-zone2ldap' endif if get_option('tools') tools += [ 'calidns', - # 'comfun', # TODO: Broken 'dnsdemog', 'dnsgram', 'dnspcap2calidns', @@ -255,12 +279,16 @@ if get_option('fuzz-targets') endif foreach tool: tools + var_name = tool.underscorify() + sources_var = var_name + '_sources' set_variable( - tool.underscorify(), + var_name, executable( tool, - sources: [config_h], - dependencies: [get_variable('lib' + tool.underscorify())], + get_variable(sources_var), + config_h, + dependencies: deps, + link_with: libpdns_common, ) ) endforeach diff --git a/pdns/meson.build b/pdns/meson.build index 786480059b..b06080ba55 100644 --- a/pdns/meson.build +++ b/pdns/meson.build @@ -1,19 +1,11 @@ fs = import('fs') -libpdns_cdb = dependency('', required: false) -if dep_cdb.found() - libpdns_cdb = declare_dependency( - link_whole: static_library( - 'libpdns-cdb', - sources: ['cdb.cc'], - extra_files: ['cdb.hh'], - dependencies: deps, - ) - ) -endif +libpdns_cdb_sources = files('cdb.cc', 'cdb.hh') + +common_sources = [] -libpdns_bindlexer_cc = 'bindlexer.c' -if not fs.is_file(libpdns_bindlexer_cc) +libpdns_bindlexer_sources = 'bindlexer.c' +if not fs.is_file(libpdns_bindlexer_sources) flex = find_program('flex', required: true) summary('Flex', flex.found(), bool_yn: true, section: 'BIND Parser') @@ -26,12 +18,11 @@ if not fs.is_file(libpdns_bindlexer_cc) arguments: ['--case-insensitive', '--outfile=@OUTPUT@', '@INPUT@'], ) - libpdns_bindlexer_cc = flex_generator.process('bindlexer.l') + libpdns_bindlexer_sources = flex_generator.process('bindlexer.l') endif -libpdns_bindlexer_cc = declare_dependency(sources: [libpdns_bindlexer_cc]) -libpdns_bindparser_cc = 'bindparser.cc' -if not fs.is_file(libpdns_bindparser_cc) and not fs.is_file('bindparser.hh') +libpdns_bindparser_sources = 'bindparser.cc' +if not fs.is_file(libpdns_bindparser_sources) and not fs.is_file('bindparser.hh') bison = find_program('bison', required: false) if not bison.found() bison = find_program('yacc', required: true) @@ -47,24 +38,11 @@ if not fs.is_file(libpdns_bindparser_cc) and not fs.is_file('bindparser.hh') arguments: ['-d', '--verbose', '--debug', '--output=@OUTPUT0@', '@INPUT@'], ) - libpdns_bindparser_cc = bison_generator.process('bindparser.yy') + libpdns_bindparser_sources = bison_generator.process('bindparser.yy') endif -libpdns_bindparser_cc = declare_dependency(sources: [libpdns_bindparser_cc]) - -libpdns_bind_parser = declare_dependency( - link_whole: static_library( - 'pdns-bind-parser', - cpp_args: '-Wno-redundant-decls', - dependencies: [ - deps, - libpdns_bindlexer_cc, - libpdns_bindparser_cc, - ], - ) -) -libpdns_dnslabeltext_cc = 'dnslabeltext.cc' -if not fs.is_file(libpdns_dnslabeltext_cc) +libpdns_dnslabeltext_sources = 'dnslabeltext.cc' +if not fs.is_file(libpdns_dnslabeltext_sources) ragel = find_program('ragel', required: true) ragel_generator = generator( ragel, @@ -76,18 +54,12 @@ if not fs.is_file(libpdns_dnslabeltext_cc) summary('Ragel Path', ragel.full_path(), section: 'DNS Labels') summary('Ragel Version', ragel.version(), section: 'DNS Labels') - libpdns_dnslabeltext_cc = ragel_generator.process('dnslabeltext.rl') + libpdns_dnslabeltext_sources = ragel_generator.process('dnslabeltext.rl') endif -libpdns_dnslabeltext = declare_dependency( - link_whole: static_library( - 'pdns-dnslabeltext', - sources: [libpdns_dnslabeltext_cc], - dependencies: [deps], - ) -) +common_sources += libpdns_dnslabeltext_sources -libpdns_apidocfiles_h = 'apidocfiles.h' -if not fs.is_file(libpdns_apidocfiles_h) +libpdns_apidocfiles_headers = 'apidocfiles.h' +if not fs.is_file(libpdns_apidocfiles_headers) py = import('python') python = py.find_installation('python3', modules: 'yaml', required: true) @@ -95,7 +67,7 @@ if not fs.is_file(libpdns_apidocfiles_h) summary('Path', python.full_path(), section: 'Swagger API') summary('Version', python.version(), section: 'Swagger API') - libpdns_apidocfiles_h = custom_target( + libpdns_apidocfiles_headers = custom_target( 'pdns-apidocfiles-h', command: [ python, @@ -110,10 +82,10 @@ if not fs.is_file(libpdns_apidocfiles_h) capture: true, ) endif -libpdns_apidocfiles = declare_dependency(sources: libpdns_apidocfiles_h) +common_sources += libpdns_apidocfiles_headers -libpdns_bind_dnssec_schema_h = 'bind-dnssec.schema.sqlite3.sql.h' -if not fs.is_file(libpdns_bind_dnssec_schema_h) +libpdns_bind_dnssec_schema_headers = 'bind-dnssec.schema.sqlite3.sql.h' +if not fs.is_file(libpdns_bind_dnssec_schema_headers) py = import('python') python = py.find_installation('python3', required: true) @@ -121,7 +93,7 @@ if not fs.is_file(libpdns_bind_dnssec_schema_h) summary('Path', python.full_path(), section: 'BIND DNSSEC Schema') summary('Version', python.version(), section: 'BIND DNSSEC Schema') - libpdns_bind_dnssec_schema_h = custom_target( + libpdns_bind_dnssec_schema_headers = custom_target( 'pdns-bind-dnssec-schema', command: [ python, @@ -136,7 +108,7 @@ if not fs.is_file(libpdns_bind_dnssec_schema_h) capture: true, ) endif -libpdns_bind_dnssec_schema = declare_dependency(sources: libpdns_bind_dnssec_schema_h) +common_sources += libpdns_bind_dnssec_schema_headers conditional_sources = { 'mplexer-sunos-devpoll': { @@ -152,13 +124,11 @@ conditional_sources = { 'condition': have_openbsd or have_freebsd, }, 'ssqlite3': { - 'sources': ['ssqlite3.cc'], - 'headers': ['ssqlite3.hh'], + 'sources': ['ssqlite3.cc', 'ssqlite3.hh'], 'condition': dep_sqlite3.found(), }, 'minicurl': { - 'sources': ['minicurl.cc'], - 'headers': ['minicurl.hh'], + 'sources': ['minicurl.cc', 'minicurl.hh'], 'condition': dep_lua_records.found() or dep_libcurl.found(), }, 'lua-record': { @@ -174,8 +144,7 @@ conditional_sources = { 'condition': dep_libdecaf.found(), }, 'signers-pkcs11': { - 'sources': ['pkcs11signers.cc'], - 'headers': ['pkcs11signers.hh'], + 'sources': ['pkcs11signers.cc', 'pkcs11signers.hh'], 'condition': dep_pkcs11.found(), }, 'standalone-fuzz-target-runner': { @@ -185,1635 +154,341 @@ conditional_sources = { } foreach name, info: conditional_sources - var_name = 'libpdns_' + name.underscorify() - set_variable(var_name, dependency('', required: false)) if info['condition'] - set_variable( - var_name, - declare_dependency( - link_whole: static_library( - 'pdns-' + name, - sources: info['sources'], - extra_files: 'headers' in info ? info['headers'] : [], - dependencies: [deps], - ) - ) - ) + common_sources += files(info['sources']) endif endforeach -tool_libs = { - 'pdns-auth': { - 'main': 'auth-main.cc', - 'sources': [ - 'arguments.cc', - 'arguments.hh', - 'auth-caches.cc', - 'auth-caches.hh', - 'auth-carbon.cc', - 'auth-catalogzone.cc', - 'auth-catalogzone.hh', - 'auth-main.hh', - 'auth-packetcache.cc', - 'auth-packetcache.hh', - 'auth-primarycommunicator.cc', - 'auth-querycache.cc', - 'auth-querycache.hh', - 'auth-secondarycommunicator.cc', - 'auth-zonecache.cc', - 'auth-zonecache.hh', - 'axfr-retriever.cc', - 'axfr-retriever.hh', - 'backends' / 'gsql' / 'gsqlbackend.cc', # TODO Move to a separate module. - 'backends' / 'gsql' / 'gsqlbackend.hh', # TODO Move to a separate module. - 'backends' / 'gsql' / 'ssql.hh', # TODO Move to a separate module. - 'base32.cc', - 'base32.hh', - 'base64.cc', - 'base64.hh', - 'burtle.hh', - 'cachecleaner.hh', - 'circular_buffer.hh', - 'comment.hh', - 'communicator.cc', - 'communicator.hh', - 'coverage.cc', - 'coverage.hh', - 'credentials.cc', - 'credentials.hh', - 'dbdnsseckeeper.cc', - 'digests.hh', - 'distributor.hh', - 'dns.cc', - 'dns.hh', - 'dns_random.hh', - 'dnsbackend.cc', - 'dnsbackend.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnspacket.cc', - 'dnspacket.hh', - 'dnsparser.cc', - 'dnsproxy.cc', - 'dnsproxy.hh', - 'dnsrecords.cc', - 'dnsrecords.hh', - 'dnssecinfra.cc', - 'dnssecinfra.hh', - 'dnsseckeeper.hh', - 'dnssecsigner.cc', - 'dnswriter.cc', - 'dynhandler.cc', - 'dynhandler.hh', - 'dynlistener.cc', - 'dynlistener.hh', - 'dynmessenger.hh', - 'ednscookies.cc', - 'ednscookies.hh', - 'ednsoptions.cc', - 'ednsoptions.hh', - 'ednssubnet.cc', - 'ednssubnet.hh', - 'gettime.cc', - 'gettime.hh', - 'gss_context.cc', - 'gss_context.hh', - 'histogram.hh', - 'iputils.cc', - 'iputils.hh', - 'ixfr.cc', - 'ixfr.hh', - 'json.cc', - 'json.hh', - 'lock.hh', - 'logger.cc', - 'logger.hh', - 'logging.hh', - 'lua-auth4.cc', - 'lua-auth4.hh', - 'lua-base4.cc', - 'lua-base4.hh', - 'misc.cc', - 'misc.hh', - 'nameserver.cc', - 'nameserver.hh', - 'namespaces.hh', - 'noinitvector.hh', - 'nsecrecords.cc', - 'opensslsigners.cc', - 'opensslsigners.hh', - 'packetcache.hh', - 'packethandler.cc', - 'packethandler.hh', - 'pdnsexception.hh', - 'proxy-protocol.cc', - 'proxy-protocol.hh', - 'qtype.cc', - 'qtype.hh', - 'query-local-address.hh', - 'query-local-address.cc', - 'rcpgenerator.cc', - 'resolver.cc', - 'resolver.hh', - 'responsestats.cc', - 'responsestats.hh', - 'responsestats-auth.cc', - 'rfc2136handler.cc', - 'secpoll-auth.cc', - 'secpoll-auth.hh', - 'secpoll.cc', - 'secpoll.hh', - 'serialtweaker.cc', - 'sha.hh', - 'shuffle.cc', - 'shuffle.hh', - 'signingpipe.cc', - 'signingpipe.hh', - 'sillyrecords.cc', - 'stat_t.hh', - 'statbag.cc', - 'statbag.hh', - 'stubresolver.cc', - 'stubresolver.hh', - 'svc-records.cc', - 'svc-records.hh', - 'tcpreceiver.cc', - 'tcpreceiver.hh', - 'threadname.hh', - 'threadname.cc', - 'tkey.cc', - 'trusted-notification-proxy.hh', - 'trusted-notification-proxy.cc', - 'tsigutils.hh', - 'tsigutils.cc', - 'tsigverifier.cc', - 'tsigverifier.hh', - 'ueberbackend.cc', - 'ueberbackend.hh', - 'unix_semaphore.cc', - 'unix_utility.cc', - 'utility.hh', - 'uuid-utils.hh', - 'uuid-utils.cc', - 'version.cc', - 'version.hh', - 'webserver.cc', - 'webserver.hh', - 'ws-api.cc', - 'ws-api.hh', - 'ws-auth.cc', - 'ws-auth.hh', - 'zoneparser-tng.cc', - ], - 'deps': [ - deps, - libpdns_apidocfiles, - libpdns_bind_dnssec_schema, - libpdns_bind_parser, - libpdns_dnslabeltext, - libpdns_lua_record, - libpdns_minicurl, - libpdns_signers_decaf, - libpdns_signers_pkcs11, - libpdns_signers_sodium, - libpdns_ssqlite3, - ] - }, - 'pdns-auth-util': { - 'main': 'pdnsutil.cc', - 'sources': [ - 'arguments.cc', - 'auth-caches.cc', - 'auth-caches.hh', - 'auth-catalogzone.cc', - 'auth-catalogzone.hh', - 'auth-packetcache.cc', - 'auth-packetcache.hh', - 'auth-querycache.cc', - 'auth-querycache.hh', - 'auth-zonecache.cc', - 'auth-zonecache.hh', - 'backends' / 'gsql' / 'gsqlbackend.cc', # TODO Move to a separate module. - 'backends' / 'gsql' / 'gsqlbackend.hh', # TODO Move to a separate module. - 'backends' / 'gsql' / 'ssql.hh', # TODO Move to a separate module. - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'cachecleaner.hh', - 'circular_buffer.hh', - 'credentials.cc', - 'credentials.hh', - 'dbdnsseckeeper.cc', - 'dns.cc', - 'dnsbackend.cc', - 'dnsname.cc', - 'dnsname.hh', - 'dnspacket.cc', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnssecinfra.hh', - 'dnssecsigner.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'dynlistener.cc', - 'ednscookies.cc', - 'ednscookies.hh', - 'ednsoptions.cc', - 'ednsoptions.hh', - 'ednssubnet.cc', - 'gettime.cc', - 'gettime.hh', - 'gss_context.cc', - 'gss_context.hh', - 'ipcipher.cc', - 'ipcipher.hh', - 'iputils.cc', - 'iputils.hh', - 'json.cc', - 'logger.cc', - 'lua-auth4.cc', - 'lua-auth4.hh', - 'lua-base4.cc', - 'lua-base4.hh', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'opensslsigners.cc', - 'opensslsigners.hh', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'serialtweaker.cc', - 'shuffle.cc', - 'shuffle.hh', - 'signingpipe.cc', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'stubresolver.cc', - 'stubresolver.hh', - 'svc-records.cc', - 'svc-records.hh', - 'threadname.hh', - 'threadname.cc', - 'tsigutils.hh', - 'tsigutils.cc', - 'ueberbackend.cc', - 'unix_utility.cc', - 'uuid-utils.hh', - 'uuid-utils.cc', - 'validate.hh', - 'zonemd.hh', - 'zonemd.cc', - 'zoneparser-tng.cc', - ], - 'deps': [ - deps, - libpdns_bind_parser, - libpdns_dnslabeltext, - libpdns_signers_decaf, - libpdns_signers_pkcs11, - libpdns_signers_sodium, - libpdns_ssqlite3, - ], - }, - 'pdns-auth-control': { - 'main': 'dynloader.cc', - 'sources': [ - 'arguments.cc', - 'dnsname.cc', - 'dynmessenger.cc', - 'logger.cc', - 'misc.cc', - 'qtype.cc', - 'statbag.cc', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'zone2sql': { - 'main': 'zone2sql.cc', - 'sources': [ - 'arguments.cc', - 'base32.cc', - 'base64.cc', - 'bindparserclasses.hh', - 'dns.cc', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsrecords.cc', - 'dnswriter.cc', - 'json.cc', - 'json.hh', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'zoneparser-tng.cc', - ], - 'deps': [ - deps, - libpdns_bind_parser, - libpdns_bind_dnssec_schema, - libpdns_dnslabeltext, - ], - }, - 'zone2json': { - 'main': 'zone2json.cc', - 'sources': [ - 'arguments.cc', - 'base32.cc', - 'base64.cc', - 'bindparserclasses.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsrecords.cc', - 'dnswriter.cc', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'zoneparser-tng.cc', - ], - 'deps': [ - deps, - libpdns_bind_parser, - libpdns_bind_dnssec_schema, - libpdns_dnslabeltext, - ], - }, +common_sources += files( + 'arguments.cc', + 'arguments.hh', + 'auth-caches.cc', + 'auth-caches.hh', + 'auth-carbon.cc', + 'auth-catalogzone.cc', + 'auth-catalogzone.hh', + 'auth-main.hh', + 'auth-packetcache.cc', + 'auth-packetcache.hh', + 'auth-primarycommunicator.cc', + 'auth-querycache.cc', + 'auth-querycache.hh', + 'auth-secondarycommunicator.cc', + 'auth-zonecache.cc', + 'auth-zonecache.hh', + 'axfr-retriever.cc', + 'axfr-retriever.hh', + 'backends' / 'gsql' / 'gsqlbackend.cc', # TODO Move to a separate module. + 'backends' / 'gsql' / 'gsqlbackend.hh', # TODO Move to a separate module. + 'backends' / 'gsql' / 'ssql.hh', # TODO Move to a separate module. + 'base32.cc', + 'base32.hh', + 'base64.cc', + 'base64.hh', + 'bindparserclasses.hh', + 'burtle.hh', + 'cachecleaner.hh', + 'circular_buffer.hh', + 'comment.hh', + 'communicator.cc', + 'communicator.hh', + 'coverage.cc', + 'coverage.hh', + 'credentials.cc', + 'credentials.hh', + 'dbdnsseckeeper.cc', + 'digests.hh', + 'distributor.hh', + 'dns.cc', + 'dns.hh', + 'dns_random.hh', + 'dnsbackend.cc', + 'dnsbackend.hh', + 'dnsname.cc', + 'dnsname.hh', + 'dnspacket.cc', + 'dnspacket.hh', + 'dnsparser.cc', + 'dnsparser.hh', + 'dnsproxy.cc', + 'dnsproxy.hh', + 'dnsrecords.cc', + 'dnsrecords.hh', + 'dnssecinfra.cc', + 'dnssecinfra.hh', + 'dnsseckeeper.hh', + 'dnssecsigner.cc', + 'dnswriter.cc', + 'dnswriter.hh', + 'dynhandler.cc', + 'dynhandler.hh', + 'dynlistener.cc', + 'dynlistener.hh', + 'dynmessenger.cc', + 'dynmessenger.hh', + 'ednscookies.cc', + 'ednscookies.hh', + 'ednsoptions.cc', + 'ednsoptions.hh', + 'ednssubnet.cc', + 'ednssubnet.hh', + 'gettime.cc', + 'gettime.hh', + 'gss_context.cc', + 'gss_context.hh', + 'histogram.hh', + 'ipcipher.cc', + 'ipcipher.hh', + 'iputils.cc', + 'iputils.hh', + 'ixfr.cc', + 'ixfr.hh', + 'json.cc', + 'json.hh', + 'lock.hh', + 'logger.cc', + 'logger.hh', + 'logging.hh', + 'lua-auth4.cc', + 'lua-auth4.hh', + 'lua-base4.cc', + 'lua-base4.hh', + 'misc.cc', + 'misc.hh', + 'nameserver.cc', + 'nameserver.hh', + 'namespaces.hh', + 'noinitvector.hh', + 'nsecrecords.cc', + 'opensslsigners.cc', + 'opensslsigners.hh', + 'packetcache.hh', + 'packethandler.cc', + 'packethandler.hh', + 'pdnsexception.hh', + 'proxy-protocol.cc', + 'proxy-protocol.hh', + 'qtype.cc', + 'qtype.hh', + 'query-local-address.cc', + 'query-local-address.hh', + 'rcpgenerator.cc', + 'rcpgenerator.hh', + 'resolver.cc', + 'resolver.hh', + 'responsestats-auth.cc', + 'responsestats.cc', + 'responsestats.hh', + 'rfc2136handler.cc', + 'secpoll-auth.cc', + 'secpoll-auth.hh', + 'secpoll.cc', + 'secpoll.hh', + 'serialtweaker.cc', + 'sha.hh', + 'shuffle.cc', + 'shuffle.hh', + 'signingpipe.cc', + 'signingpipe.hh', + 'sillyrecords.cc', + 'sstuff.hh', + 'stat_t.hh', + 'statbag.cc', + 'statbag.hh', + 'stubresolver.cc', + 'stubresolver.hh', + 'svc-records.cc', + 'svc-records.hh', + 'tcpreceiver.cc', + 'tcpreceiver.hh', + 'threadname.cc', + 'threadname.hh', + 'tkey.cc', + 'trusted-notification-proxy.cc', + 'trusted-notification-proxy.hh', + 'tsigutils.cc', + 'tsigutils.hh', + 'tsigverifier.cc', + 'tsigverifier.hh', + 'ueberbackend.cc', + 'ueberbackend.hh', + 'unix_semaphore.cc', + 'unix_utility.cc', + 'utility.hh', + 'uuid-utils.cc', + 'uuid-utils.hh', + 'validate.hh', + 'version.cc', + 'version.hh', + 'webserver.cc', + 'webserver.hh', + 'ws-api.cc', + 'ws-api.hh', + 'ws-auth.cc', + 'ws-auth.hh', + 'zonemd.cc', + 'zonemd.hh', + 'zoneparser-tng.cc', + 'zoneparser-tng.hh', +) + +tools = { + 'pdns-auth' : { 'main': 'auth-main.cc' }, + 'pdns-auth-util' : { 'main': 'pdnsutil.cc' }, + 'pdns-auth-control' : { 'main': 'dynloader.cc' }, + 'pdns-zone2sql' : { 'main': 'zone2sql.cc' }, + 'pdns-zone2json' : { 'main': 'zone2json.cc' }, } if get_option('module-ldap') != 'disabled' - tool_libs += { - 'zone2ldap': { - 'main': 'zone2ldap.cc', - 'sources': [ - 'arguments.cc', - 'base32.cc', - 'base64.cc', - 'bindparserclasses.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsrecords.cc', - 'dnswriter.cc', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'zoneparser-tng.cc', - ], - 'deps': [ - deps, - libpdns_bind_parser, - libpdns_bind_dnssec_schema, - libpdns_dnslabeltext, - ], - }, - } + tools += { 'pdns-zone2ldap' : { 'main': 'zone2ldap.cc' } } endif if get_option('tools') - tool_libs += { - 'sdig': { - 'main': 'sdig.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dns.cc', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'dolog.hh', - 'ednsextendederror.cc', - 'ednsextendederror.hh', - 'ednssubnet.cc', - 'iputils.cc', - 'libssl.cc', - 'libssl.hh', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'proxy-protocol.cc', - 'proxy-protocol.hh', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'tcpiohandler.cc', - 'tcpiohandler.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_minicurl, - ], - }, - 'calidns': { - 'main': 'calidns.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dns_random.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'ednsoptions.cc', - 'ednsoptions.hh', - 'ednssubnet.cc', - 'ednssubnet.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - # TODO: Broken - # 'comfun': { - # 'main': 'comfun.cc', - # 'sources': [ - # 'base32.cc', - # 'base64.cc', - # 'dns.cc', - # 'dnsname.cc', - # 'dnsname.hh', - # 'dnsparser.cc', - # 'dnsrecords.cc', - # 'dnswriter.cc', - # 'logger.cc', - # 'misc.cc', - # 'nsecrecords.cc', - # 'qtype.cc', - # 'rcpgenerator.cc', - # 'sillyrecords.cc', - # 'statbag.cc', - # 'svc-records.cc', - # 'svc-records.hh', - # 'unix_utility.cc', - # 'zoneparser-tng.cc', - # 'zoneparser-tng.hh', - # ], - # 'deps': [ - # deps, - # libpdns_dnslabeltext, - # ], - # }, - 'dnsdemog': { - 'main': 'dnsdemog.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnsgram': { - 'main': 'dnsgram.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnspcap2calidns': { - 'main': 'dnspcap2calidns.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'ednsoptions.cc', - 'ednsoptions.hh', - 'ednssubnet.cc', - 'ednssubnet.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnspcap2protobuf': { - 'main': 'dnspcap2protobuf.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'gettime.cc', - 'gettime.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'protozero.cc', - 'protozero.hh', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - 'uuid-utils.hh', - 'uuid-utils.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnsreplay': { - 'main': 'dnsreplay.cc', - 'sources': [ - 'anadns.hh', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'ednsoptions.cc', - 'ednsoptions.hh', - 'ednssubnet.cc', - 'ednssubnet.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnsscan': { - 'main': 'dnsscan.cc', - 'sources': [ - 'anadns.hh', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnsscope': { - 'main': 'dnsscope.cc', - 'sources': [ - 'arguments.cc', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dns.cc', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'histog.hh', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'statnode.cc', - 'statnode.hh', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnswasher': { - 'main': 'dnswasher.cc', - 'sources': [ - 'base64.cc', - 'dnsname.hh', - 'dnsname.cc', - 'dnsparser.hh', - 'dnspcap.cc', - 'dnspcap.hh', - 'dnswriter.hh', - 'ipcipher.cc', - 'ipcipher.hh', - 'logger.cc', - 'misc.cc', - 'qtype.cc', - 'statbag.cc', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'nproxy': { - 'main': 'nproxy.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'logger.cc', - 'misc.cc', - 'mplexer.hh', - 'nsecrecords.cc', - 'pollmplexer.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'nsec3dig': { - 'main': 'nsec3dig.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'gss_context.cc', - 'gss_context.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_signers_pkcs11, - ], - }, - 'pdns-auth-notify': { - 'main': 'notify.cc', - 'sources': [ - 'arguments.cc', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dns.cc', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'pollmplexer.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dumresp': { - 'main': 'dumresp.cc', - 'sources': [ - 'dnsname.cc', - 'dnsname.hh', - 'iputils.cc', - 'iputils.hh', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'qtype.cc', - 'statbag.cc', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'kvresp': { - 'main': 'kvresp.cc', - 'sources': [ - 'dnsname.cc', - 'dnsname.hh', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'qtype.cc', - 'statbag.cc', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'stubquery': { - 'main': 'stubquery.cc', - 'sources': [ - 'arguments.cc', - 'arguments.hh', - 'base32.cc', - 'base64.cc', - 'dnsname.cc', - 'dnsparser.cc', - 'dnsrecords.cc', - 'dnswriter.cc', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'sillyrecords.cc', - 'statbag.cc', - 'stubresolver.cc', - 'stubresolver.hh', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'saxfr': { - 'main': 'saxfr.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dns_random.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'gss_context.cc', - 'gss_context.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_signers_pkcs11, - ], - }, - 'ixplore': { - 'main': 'ixplore.cc', - 'sources': [ - 'arguments.cc', - 'axfr-retriever.cc', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dns.cc', - 'dns_random.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'gss_context.cc', - 'gss_context.hh', - 'iputils.cc', - 'ixfr.cc', - 'ixfr.hh', - 'ixfrutils.cc', - 'ixfrutils.hh', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'query-local-address.hh', - 'query-local-address.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'resolver.cc', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'tsigverifier.cc', - 'tsigverifier.hh', - 'unix_utility.cc', - 'zoneparser-tng.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_signers_pkcs11, - ], - }, + tools += { + 'pdns-auth-notify' : { 'main': 'notify.cc' }, + + 'sdig' : {}, + 'calidns' : {}, + 'dnsdemog' : {}, + 'dnsgram' : {}, + 'dnspcap2calidns' : {}, + 'dnspcap2protobuf' : {}, + 'dnsreplay' : {}, + 'dnsscan' : {}, + 'dnsscope' : {}, + 'dnswasher' : {}, + 'nproxy' : {}, + 'nsec3dig' : {}, + 'dumresp' : {}, + 'kvresp' : {}, + 'stubquery' : {}, + 'saxfr' : {}, + 'ixplore' : {}, + # 'comfun' : {}, # Broken } + common_sources += files( + 'anadns.hh', + 'dnspcap.cc', + 'dnspcap.hh', + 'dolog.hh', + 'ednsextendederror.cc', + 'ednsextendederror.hh', + 'histog.hh', + 'ixfrutils.cc', + 'ixfrutils.hh', + 'libssl.cc', + 'libssl.hh', + 'mplexer.hh', + 'pollmplexer.cc', + 'protozero.cc', + 'protozero.hh', + 'statnode.cc', + 'statnode.hh', + 'tcpiohandler.cc', + 'tcpiohandler.hh', + ) + if have_boost_1_48_0 - tool_libs += { - 'dnstcpbench': { - 'main': 'dnstcpbench.cc', - 'sources': [ - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'threadname.hh', - 'threadname.cc', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, - 'dnsbulktest': { - 'main': 'dnsbulktest.cc', - 'sources': [ - 'arguments.cc', - 'arguments.hh', - 'base32.cc', - 'base64.cc', - 'dns_random.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsrecords.cc', - 'dnswriter.cc', - 'iputils.cc', - 'iputils.hh', - 'logger.cc', - 'misc.cc', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - ], - }, + tools += { + 'dnstcpbench': {}, + 'dnsbulktest': {}, } endif endif if get_option('tools-ixfrdist') - tool_libs += { - 'ixfrdist': { - 'main': 'ixfrdist.cc', - 'sources': [ - 'arguments.cc', - 'axfr-retriever.cc', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'credentials.cc', - 'credentials.hh', - 'dns.cc', - 'dns_random.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'gss_context.cc', - 'gss_context.hh', - 'iputils.hh', - 'iputils.cc', - 'ixfr.cc', - 'ixfr.hh', - 'ixfrdist-stats.hh', - 'ixfrdist-stats.cc', - 'ixfrdist-web.hh', - 'ixfrdist-web.cc', - 'ixfrutils.cc', - 'ixfrutils.hh', - 'logger.cc', - 'logger.hh', - 'misc.cc', - 'misc.hh', - 'mplexer.hh', - 'nsecrecords.cc', - 'pollmplexer.cc', - 'qtype.cc', - 'query-local-address.hh', - 'query-local-address.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'resolver.cc', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'threadname.hh', - 'threadname.cc', - 'tsigverifier.cc', - 'tsigverifier.hh', - 'unix_utility.cc', - 'uuid-utils.hh', - 'uuid-utils.cc', - 'webserver.hh', - 'webserver.cc', - 'zoneparser-tng.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_mplexer_bsd_kqueue, - libpdns_mplexer_linux_epoll, - libpdns_mplexer_sunos_devpoll, - libpdns_signers_pkcs11, - ], - }, - } + tools += { 'ixfrdist': {} } + + common_sources += files( + 'ixfrdist-stats.cc', + 'ixfrdist-stats.hh', + 'ixfrdist-web.cc', + 'ixfrdist-web.hh', + 'ixfrutils.cc', + 'ixfrutils.hh', + 'mplexer.hh', + 'pollmplexer.cc', + ) endif if get_option('unit-tests') - tool_libs += { - 'tsig-tests': { - 'main': 'tsig-tests.cc', - 'sources': [ - 'arguments.cc', - 'axfr-retriever.cc', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'digests.hh', - 'dns.cc', - 'dns_random.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnswriter.cc', - 'dnswriter.hh', - 'gss_context.cc', - 'gss_context.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'query-local-address.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'resolver.cc', - 'sillyrecords.cc', - 'sstuff.hh', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'tsigverifier.cc', - 'tsigverifier.hh', - 'unix_utility.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_signers_pkcs11, - ], - }, - 'speedtest': { - 'main': 'speedtest.cc', - 'sources': [ - 'arguments.cc', - 'arguments.hh', - 'base32.cc', - 'base64.cc', - 'base64.hh', - 'credentials.cc', - 'credentials.hh', - 'dns_random.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnssecinfra.hh', - 'dnswriter.cc', - 'dnswriter.hh', - 'gss_context.cc', - 'gss_context.hh', - 'iputils.cc', - 'logger.cc', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'uuid-utils.cc', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_signers_pkcs11, - ], - }, - 'pdns-auth-testrunner': { - 'main': 'testrunner.cc', - 'sources': [ - 'arguments.cc', - 'auth-caches.cc', - 'auth-caches.hh', - 'auth-packetcache.cc', - 'auth-packetcache.hh', - 'auth-querycache.cc', - 'auth-querycache.hh', - 'auth-zonecache.cc', - 'auth-zonecache.hh', - 'base32.cc', - 'base64.cc', - 'channel.cc', - 'channel.hh', - 'credentials.cc', - 'credentials.hh', - 'dbdnsseckeeper.cc', - 'dns.cc', - 'dnsbackend.cc', - 'dnsname.cc', - 'dnsname.hh', - 'dnspacket.cc', - 'dnsparser.hh', - 'dnsparser.cc', - 'dnsrecords.cc', - 'dnssecinfra.cc', - 'dnssecsigner.cc', - 'dnswriter.cc', - 'ednscookies.cc', - 'ednscookies.hh', - 'ednsoptions.cc', - 'ednsoptions.hh', - 'ednssubnet.cc', - 'gettime.cc', - 'gettime.hh', - 'gss_context.cc', - 'gss_context.hh', - 'histogram.hh', - 'ipcipher.cc', - 'ipcipher.hh', - 'iputils.cc', - 'ixfr.cc', - 'ixfr.hh', - 'logger.cc', - 'lua-auth4.hh', - 'lua-auth4.cc', - 'lua-base4.hh', - 'lua-base4.cc', - 'misc.cc', - 'nameserver.cc', - 'nsecrecords.cc', - 'opensslsigners.cc', - 'opensslsigners.hh', - 'pollmplexer.cc', - 'proxy-protocol.cc', - 'proxy-protocol.hh', - 'qtype.cc', - 'rcpgenerator.cc', - 'responsestats-auth.cc', - 'responsestats.cc', - 'responsestats.hh', - 'shuffle.cc', - 'shuffle.hh', - 'sillyrecords.cc', - 'stat_t.hh', - 'statbag.cc', - 'stubresolver.hh', - 'stubresolver.cc', - 'svc-records.cc', - 'svc-records.hh', - 'test-arguments_cc.cc', - 'test-auth-zonecache_cc.cc', - 'test-base32_cc.cc', - 'test-base64_cc.cc', - 'test-bindparser_cc.cc', - 'test-channel.cc', - 'test-common.hh', - 'test-communicator_hh.cc', - 'test-credentials_cc.cc', - 'test-digests_hh.cc', - 'test-distributor_hh.cc', - 'test-dns_random_hh.cc', - 'test-dnsname_cc.cc', - 'test-dnsparser_cc.cc', - 'test-dnsparser_hh.cc', - 'test-dnsrecordcontent.cc', - 'test-dnsrecords_cc.cc', - 'test-dnswriter_cc.cc', - 'test-ednscookie_cc.cc', - 'test-ipcrypt_cc.cc', - 'test-iputils_hh.cc', - 'test-ixfr_cc.cc', - 'test-lock_hh.cc', - 'test-lua_auth4_cc.cc', - 'test-luawrapper.cc', - 'test-misc_hh.cc', - 'test-mplexer.cc', - 'test-nameserver_cc.cc', - 'test-packetcache_cc.cc', - 'test-packetcache_hh.cc', - 'test-proxy_protocol_cc.cc', - 'test-rcpgenerator_cc.cc', - 'test-sha_hh.cc', - 'test-signers.cc', - 'test-statbag_cc.cc', - 'test-svc_records_cc.cc', - 'test-trusted-notification-proxy_cc.cc', - 'test-tsig.cc', - 'test-ueberbackend_cc.cc', - 'test-webserver_cc.cc', - 'test-zonemd_cc.cc', - 'test-zoneparser_tng_cc.cc', - 'threadname.hh', - 'threadname.cc', - 'trusted-notification-proxy.cc', - 'tsigverifier.cc', - 'tsigverifier.hh', - 'ueberbackend.cc', - 'ueberbackend.hh', - 'unix_utility.cc', - 'uuid-utils.cc', - 'validate.hh', - 'webserver.cc', - 'zonemd.cc', - 'zonemd.hh', - 'zoneparser-tng.cc', - 'zoneparser-tng.hh', - ], - 'deps': [ - deps, - dep_boost_test, - libpdns_bind_parser, - libpdns_dnslabeltext, - libpdns_mplexer_bsd_kqueue, - libpdns_mplexer_linux_epoll, - libpdns_mplexer_sunos_devpoll, - libpdns_signers_decaf, - libpdns_signers_pkcs11, - libpdns_signers_sodium, - ], - }, + tools += { + 'pdns-auth-testrunner': { 'main': 'testrunner.cc' }, + 'tsig-tests' : { 'main': 'tsig-tests.cc' }, + 'speedtest' : {}, } + + common_sources += files( + 'channel.cc', + 'channel.hh', + 'pollmplexer.cc', + 'test-arguments_cc.cc', + 'test-auth-zonecache_cc.cc', + 'test-base32_cc.cc', + 'test-base64_cc.cc', + 'test-bindparser_cc.cc', + 'test-channel.cc', + 'test-common.hh', + 'test-communicator_hh.cc', + 'test-credentials_cc.cc', + 'test-digests_hh.cc', + 'test-distributor_hh.cc', + 'test-dns_random_hh.cc', + 'test-dnsname_cc.cc', + 'test-dnsparser_cc.cc', + 'test-dnsparser_hh.cc', + 'test-dnsrecordcontent.cc', + 'test-dnsrecords_cc.cc', + 'test-dnswriter_cc.cc', + 'test-ednscookie_cc.cc', + 'test-ipcrypt_cc.cc', + 'test-iputils_hh.cc', + 'test-ixfr_cc.cc', + 'test-lock_hh.cc', + 'test-lua_auth4_cc.cc', + 'test-luawrapper.cc', + 'test-misc_hh.cc', + 'test-mplexer.cc', + 'test-nameserver_cc.cc', + 'test-packetcache_cc.cc', + 'test-packetcache_hh.cc', + 'test-proxy_protocol_cc.cc', + 'test-rcpgenerator_cc.cc', + 'test-sha_hh.cc', + 'test-signers.cc', + 'test-statbag_cc.cc', + 'test-svc_records_cc.cc', + 'test-trusted-notification-proxy_cc.cc', + 'test-tsig.cc', + 'test-ueberbackend_cc.cc', + 'test-webserver_cc.cc', + 'test-zonemd_cc.cc', + 'test-zoneparser_tng_cc.cc', + 'zoneparser-tng.hh', + ) endif if get_option('fuzz-targets') - tool_libs += { - 'fuzz_target_moadnsparser': { - 'main': 'fuzz_moadnsparser.cc', - 'sources': [ - 'base32.cc', - 'base32.hh', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnsrecords.hh', - 'dnswriter.cc', - 'dnswriter.hh', - 'logger.cc', - 'logger.hh', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'qtype.hh', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'statbag.hh', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_standalone_fuzz_target_runner, - ], - }, - 'fuzz_target_packetcache': { - 'main': 'fuzz_packetcache.cc', - 'sources': [ - 'dnsname.cc', - 'dnsname.hh', - 'ednsoptions.cc', - 'ednsoptions.hh', - 'misc.cc', - 'misc.hh', - 'packetcache.hh', - 'qtype.cc', - 'qtype.hh', - 'statbag.cc', - 'statbag.hh', - 'svc-records.cc', - 'svc-records.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_standalone_fuzz_target_runner, - ], - }, - 'fuzz_target_proxyprotocol': { - 'main': 'fuzz_proxyprotocol.cc', - 'sources': [ - 'iputils.hh', - 'proxy-protocol.cc', - 'proxy-protocol.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_standalone_fuzz_target_runner, - ], - }, - 'fuzz_target_dnslabeltext_parseRFC1035CharString': { - 'main': 'fuzz_dnslabeltext_parseRFC1035CharString.cc', - 'sources': [], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_standalone_fuzz_target_runner, - ], - }, - 'fuzz_target_yahttp': { - 'main': 'fuzz_yahttp.cc', - 'sources': [], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_standalone_fuzz_target_runner, - ], - }, - 'fuzz_target_zoneparsertng': { - 'main': 'fuzz_zoneparsertng.cc', - 'sources': [ - 'base32.cc', - 'base32.hh', - 'base64.cc', - 'base64.hh', - 'dnsname.cc', - 'dnsname.hh', - 'dnsparser.cc', - 'dnsparser.hh', - 'dnsrecords.cc', - 'dnsrecords.hh', - 'dnswriter.cc', - 'dnswriter.hh', - 'logger.cc', - 'logger.hh', - 'misc.cc', - 'misc.hh', - 'nsecrecords.cc', - 'qtype.cc', - 'qtype.hh', - 'rcpgenerator.cc', - 'rcpgenerator.hh', - 'sillyrecords.cc', - 'statbag.cc', - 'statbag.hh', - 'svc-records.cc', - 'svc-records.hh', - 'unix_utility.cc', - 'utility.hh', - 'zoneparser-tng.cc', - 'zoneparser-tng.hh', - ], - 'deps': [ - deps, - libpdns_dnslabeltext, - libpdns_standalone_fuzz_target_runner, - ], - }, + tools += { + 'fuzz-target-moadnsparser' : { 'main': 'fuzz_moadnsparser.cc' }, + 'fuzz-target-packetcache' : { 'main': 'fuzz_packetcache.cc' }, + 'fuzz-target-proxyprotocol' : { 'main': 'fuzz_proxyprotocol.cc' }, + 'fuzz-target-dnslabeltext-parseRFC1035CharString' : { 'main': 'fuzz_dnslabeltext_parseRFC1035CharString.cc' }, + 'fuzz-target-yahttp' : { 'main': 'fuzz_yahttp.cc' }, + 'fuzz-target-zoneparsertng' : { 'main': 'fuzz_zoneparsertng.cc' }, } endif -source_deps_cache = {} - -foreach tool_name, tool_info: tool_libs - tool_deps = tool_info['deps'] - tool_main = tool_info['main'] - all_sources = tool_info['sources'] +foreach tool, info: tools + tool_name = tool.underscorify() - tool_sources = [] - tool_headers = [] - - foreach source: all_sources - if source.endswith('.cc') - if source not in source_deps_cache - # Create a new cached dependency for this source file. - source_deps_cache += { - source: declare_dependency( - link_whole: static_library( - 'pdns-' + source.replace('/', '__'), - sources: [source], - dependencies: deps, - ) - ) - } - endif - - tool_sources += source_deps_cache[source] - elif source.endswith('.hh') - tool_headers += source - else - error('Unsupported extension for source file `' + source + '`') - endif - endforeach + if 'main' in info + main = info['main'] + else + main = tool_name + '.cc' + endif - set_variable( - 'lib' + tool_name.underscorify(), - declare_dependency( - link_whole: static_library( - tool_name, - sources: [tool_main], - extra_files: tool_headers, - dependencies: tool_deps + tool_sources, - ) - ) - ) + set_variable(tool_name + '_sources', files(main)) endforeach