3 dep_cdb = get_variable('dep_cdb', dependency('', required: false))
4 libpdns_cdb = dependency('', required: false)
6 libpdns_cdb = declare_dependency(
7 link_whole: static_library(
10 extra_files: ['cdb.hh'],
16 libpdns_bindlexer_cc = 'bindlexer.c'
17 if not fs.is_file(libpdns_bindlexer_cc)
18 flex = find_program('flex', required: true)
20 summary('Flex', flex.found(), bool_yn: true, section: 'BIND Parser')
21 summary('Flex Path', flex.full_path(), section: 'BIND Parser')
22 summary('Flex Version', flex.version(), section: 'BIND Parser')
24 flex_generator = generator(
26 output: '@BASENAME@.c',
27 arguments: ['--case-insensitive', '--outfile=@OUTPUT@', '@INPUT@'],
30 libpdns_bindlexer_cc = flex_generator.process('bindlexer.l')
32 libpdns_bindlexer_cc = declare_dependency(sources: [libpdns_bindlexer_cc])
34 libpdns_bindparser_cc = 'bindparser.cc'
35 if not fs.is_file(libpdns_bindparser_cc) and not fs.is_file('bindparser.hh')
36 bison = find_program('bison', required: false)
38 bison = find_program('yacc', required: true)
41 summary('Bison/YACC', bison.found(), bool_yn: true, section: 'BIND Parser')
42 summary('Bison/YACC Path', bison.full_path(), section: 'BIND Parser')
43 summary('Bison/YACC Version', bison.version(), section: 'BIND Parser')
45 bison_generator = generator(
47 output: ['@BASENAME@.cc', '@BASENAME@.hh', '@BASENAME@.output'],
48 arguments: ['-d', '--verbose', '--debug', '--output=@OUTPUT0@', '@INPUT@'],
51 libpdns_bindparser_cc = bison_generator.process('bindparser.yy')
53 libpdns_bindparser_cc = declare_dependency(sources: [libpdns_bindparser_cc])
55 libpdns_bind_parser = declare_dependency(
56 link_whole: static_library(
58 cpp_args: '-Wno-redundant-decls',
62 libpdns_bindparser_cc,
67 libpdns_dnslabeltext_cc = 'dnslabeltext.cc'
68 if not fs.is_file(libpdns_dnslabeltext_cc)
69 ragel = find_program('ragel', required: true)
70 ragel_generator = generator(
72 output: '@BASENAME@.cc',
73 arguments: ['@INPUT@', '-o', '@OUTPUT@'],
76 summary('Ragel', ragel.found(), bool_yn: ragel.found(), section: 'DNS Labels')
77 summary('Ragel Path', ragel.full_path(), section: 'DNS Labels')
78 summary('Ragel Version', ragel.version(), section: 'DNS Labels')
80 libpdns_dnslabeltext_cc = ragel_generator.process('dnslabeltext.rl')
82 libpdns_dnslabeltext = declare_dependency(
83 link_whole: static_library(
85 sources: [libpdns_dnslabeltext_cc],
90 libpdns_apidocfiles_h = 'apidocfiles.h'
91 if not fs.is_file(libpdns_apidocfiles_h)
93 python = py.find_installation('python3', modules: 'yaml', required: true)
95 summary('Python', python.found(), bool_yn: true, section: 'Swagger API')
96 summary('Path', python.full_path(), section: 'Swagger API')
97 summary('Version', python.version(), section: 'Swagger API')
99 libpdns_apidocfiles_h = custom_target(
100 'pdns-apidocfiles-h',
107 'generate-api-swagger.py',
108 product_source_dir / 'docs' / 'http-api' / 'swagger' / 'authoritative-api-swagger.yaml',
110 output: 'apidocfiles.h',
114 libpdns_apidocfiles = declare_dependency(
115 link_whole: static_library(
116 'pdns-auth-apidocfiles',
117 sources: [libpdns_apidocfiles_h],
121 libpdns_bind_dnssec_schema_h = 'bind-dnssec.schema.sqlite3.sql.h'
122 if not fs.is_file(libpdns_bind_dnssec_schema_h)
123 py = import('python')
124 python = py.find_installation('python3', required: true)
126 summary('Python', python.found(), bool_yn: true, section: 'BIND DNSSEC Schema')
127 summary('Path', python.full_path(), section: 'BIND DNSSEC Schema')
128 summary('Version', python.version(), section: 'BIND DNSSEC Schema')
130 libpdns_bind_dnssec_schema_h = custom_target(
131 'pdns-bind-dnssec-schema',
138 'generate-bind-dnssec-schema.py',
139 'bind-dnssec.schema.sqlite3.sql',
141 output: 'bind-dnssec.schema.sqlite3.sql.h',
145 libpdns_bind_dnssec_schema = declare_dependency(
146 link_whole: static_library(
147 'pdns-bind-dnssec-schema',
148 sources: [libpdns_bind_dnssec_schema_h],
154 'main': 'auth-main.cc',
161 'auth-catalogzone.cc',
162 'auth-catalogzone.hh',
164 'auth-packetcache.cc',
165 'auth-packetcache.hh',
166 'auth-primarycommunicator.cc',
167 'auth-querycache.cc',
168 'auth-querycache.hh',
169 'auth-secondarycommunicator.cc',
174 'backends' / 'gsql' / 'gsqlbackend.cc', # TODO Move to a separate module.
175 'backends' / 'gsql' / 'gsqlbackend.hh', # TODO Move to a separate module.
176 'backends' / 'gsql' / 'ssql.hh', # TODO Move to a separate module.
183 'circular_buffer.hh',
260 'query-local-address.hh',
261 'query-local-address.cc',
267 'responsestats-auth.cc',
292 'trusted-notification-proxy.hh',
293 'trusted-notification-proxy.cc',
328 libpdns_bind_dnssec_schema,
329 libpdns_dnslabeltext,
334 'main': 'pdnsutil.cc',
339 'auth-catalogzone.cc',
340 'auth-catalogzone.hh',
341 'auth-packetcache.cc',
342 'auth-packetcache.hh',
343 'auth-querycache.cc',
344 'auth-querycache.hh',
347 'backends' / 'gsql' / 'gsqlbackend.cc', # TODO Move to a separate module.
348 'backends' / 'gsql' / 'gsqlbackend.hh', # TODO Move to a separate module.
349 'backends' / 'gsql' / 'ssql.hh', # TODO Move to a separate module.
354 'circular_buffer.hh',
433 libpdns_dnslabeltext,
436 'pdns-auth-control': {
437 'main': 'dynloader.cc',
450 libpdns_dnslabeltext,
454 'main': 'zone2sql.cc',
459 'bindparserclasses.hh',
483 libpdns_bind_dnssec_schema,
484 libpdns_dnslabeltext,
488 'main': 'zone2json.cc',
493 'bindparserclasses.hh',
514 libpdns_bind_dnssec_schema,
515 libpdns_dnslabeltext,
520 if get_option('module-ldap') != 'disabled'
523 'main': 'zone2ldap.cc',
528 'bindparserclasses.hh',
549 libpdns_bind_dnssec_schema,
550 libpdns_dnslabeltext,
556 if get_option('tools')
573 'ednsextendederror.cc',
574 'ednsextendederror.hh',
602 libpdns_dnslabeltext,
606 'main': 'calidns.cc',
640 libpdns_dnslabeltext,
645 # 'main': 'comfun.cc',
665 # 'zoneparser-tng.cc',
666 # 'zoneparser-tng.hh',
670 # libpdns_dnslabeltext,
674 'main': 'dnsdemog.cc',
703 libpdns_dnslabeltext,
707 'main': 'dnsgram.cc',
736 libpdns_dnslabeltext,
740 'main': 'dnspcap2calidns.cc',
774 libpdns_dnslabeltext,
777 'dnspcap2protobuf': {
778 'main': 'dnspcap2protobuf.cc',
814 libpdns_dnslabeltext,
818 'main': 'dnsreplay.cc',
853 libpdns_dnslabeltext,
857 'main': 'dnsscan.cc',
887 libpdns_dnslabeltext,
891 'main': 'dnsscope.cc',
925 libpdns_dnslabeltext,
929 'main': 'dnswasher.cc',
948 libpdns_dnslabeltext,
980 libpdns_dnslabeltext,
984 'main': 'nsec3dig.cc',
1019 libpdns_dnslabeltext,
1022 'pdns-auth-notify': {
1023 'main': 'notify.cc',
1052 libpdns_dnslabeltext,
1056 'main': 'dumresp.cc',
1071 libpdns_dnslabeltext,
1075 'main': 'kvresp.cc',
1088 libpdns_dnslabeltext,
1092 'main': 'stubquery.cc',
1118 libpdns_dnslabeltext,
1158 libpdns_dnslabeltext,
1163 if have_boost_1_48_0
1166 'main': 'dnstcpbench.cc',
1197 libpdns_dnslabeltext,
1201 'main': 'dnsbulktest.cc',
1228 libpdns_dnslabeltext,
1235 if get_option('tools-ixfrdist')
1238 'main': 'ixfrdist.cc',
1241 'axfr-retriever.cc',
1263 'ixfrdist-stats.hh',
1264 'ixfrdist-stats.cc',
1277 'query-local-address.hh',
1278 'query-local-address.cc',
1296 'zoneparser-tng.cc',
1302 'devpollmplexer.cc',
1307 libpdns_dnslabeltext,
1311 'main': 'ixplore.cc',
1314 'axfr-retriever.cc',
1340 'query-local-address.hh',
1341 'query-local-address.cc',
1353 'zoneparser-tng.cc',
1360 libpdns_dnslabeltext,
1366 if get_option('unit-tests') or get_option('unit-tests-backends')
1369 'main': 'tsig-tests.cc',
1372 'axfr-retriever.cc',
1395 'query-local-address.cc',
1413 libpdns_dnslabeltext,
1417 'main': 'speedtest.cc',
1458 libpdns_dnslabeltext,
1461 'pdns-auth-testrunner': {
1462 'main': 'testrunner.cc',
1467 'auth-packetcache.cc',
1468 'auth-packetcache.hh',
1469 'auth-querycache.cc',
1470 'auth-querycache.hh',
1471 'auth-zonecache.cc',
1472 'auth-zonecache.hh',
1479 'dbdnsseckeeper.cc',
1514 'opensslsigners.cc',
1515 'opensslsigners.hh',
1517 'proxy-protocol.cc',
1518 'proxy-protocol.hh',
1521 'responsestats-auth.cc',
1533 'test-arguments_cc.cc',
1534 'test-auth-zonecache_cc.cc',
1535 'test-base32_cc.cc',
1536 'test-base64_cc.cc',
1537 'test-bindparser_cc.cc',
1540 'test-communicator_hh.cc',
1541 'test-credentials_cc.cc',
1542 'test-digests_hh.cc',
1543 'test-distributor_hh.cc',
1544 'test-dns_random_hh.cc',
1545 'test-dnsname_cc.cc',
1546 'test-dnsparser_cc.cc',
1547 'test-dnsparser_hh.cc',
1548 'test-dnsrecordcontent.cc',
1549 'test-dnsrecords_cc.cc',
1550 'test-dnswriter_cc.cc',
1551 'test-ednscookie_cc.cc',
1552 'test-ipcrypt_cc.cc',
1553 'test-iputils_hh.cc',
1556 'test-lua_auth4_cc.cc',
1557 'test-luawrapper.cc',
1560 'test-nameserver_cc.cc',
1561 'test-packetcache_cc.cc',
1562 'test-packetcache_hh.cc',
1563 'test-proxy_protocol_cc.cc',
1564 'test-rcpgenerator_cc.cc',
1567 'test-statbag_cc.cc',
1568 'test-svc_records_cc.cc',
1569 'test-trusted-notification-proxy_cc.cc',
1571 'test-ueberbackend_cc.cc',
1572 'test-webserver_cc.cc',
1573 'test-zonemd_cc.cc',
1574 'test-zoneparser_tng_cc.cc',
1577 'trusted-notification-proxy.cc',
1588 'zoneparser-tng.cc',
1589 'zoneparser-tng.hh',
1597 'devpollmplexer.cc',
1602 libpdns_bind_parser,
1603 libpdns_dnslabeltext,
1609 if get_option('fuzz-targets')
1611 'fuzz_target_moadnsparser': {
1612 'main': 'fuzz_moadnsparser.cc',
1643 'standalone_fuzz_target_runner.cc',
1647 libpdns_dnslabeltext,
1650 'fuzz_target_packetcache': {
1651 'main': 'fuzz_packetcache.cc',
1667 'standalone_fuzz_target_runner.cc',
1671 libpdns_dnslabeltext,
1674 'fuzz_target_proxyprotocol': {
1675 'main': 'fuzz_proxyprotocol.cc',
1678 'proxy-protocol.cc',
1679 'proxy-protocol.hh',
1681 'standalone_fuzz_target_runner.cc',
1685 libpdns_dnslabeltext,
1688 'fuzz_target_dnslabeltext_parseRFC1035CharString': {
1689 'main': 'fuzz_dnslabeltext_parseRFC1035CharString.cc',
1691 'standalone_fuzz_target_runner.cc',
1695 libpdns_dnslabeltext,
1698 'fuzz_target_yahttp': {
1699 'main': 'fuzz_yahttp.cc',
1701 'standalone_fuzz_target_runner.cc',
1705 libpdns_dnslabeltext,
1708 'fuzz_target_zoneparsertng': {
1709 'main': 'fuzz_zoneparsertng.cc',
1739 'zoneparser-tng.cc',
1740 'zoneparser-tng.hh',
1742 'standalone_fuzz_target_runner.cc',
1746 libpdns_dnslabeltext,
1752 conditional_sources = {
1753 'devpollmplexer.cc': get_variable('have_sunos', false),
1754 'portsmplexer.cc': get_variable('have_sunos', false),
1755 'epollmplexer.cc': get_variable('have_linux', false),
1756 'kqueuemplexer.cc': get_variable('have_openbsd', false) or get_variable('have_freebsd', false),
1758 'tsigutils.cc': dep_gss_tsig.found(),
1759 'tsigutils.hh': dep_gss_tsig.found(),
1761 'tsigverifier.cc': dep_gss_tsig.found(),
1762 'tsigverifier.hh': dep_gss_tsig.found(),
1764 'ssqlite3.cc': get_variable('dep_sqlite3', dependency('', required: false)).found(),
1765 'ssqlite3.hh': get_variable('dep_sqlite3', dependency('', required: false)).found(),
1767 'minicurl.cc': dep_lua_records.found() or dep_libcurl.found(),
1768 'minicurl.hh': dep_lua_records.found() or dep_libcurl.found(),
1770 'ipcipher.cc': enable_ipcipher,
1771 'ipcipher.hh': enable_ipcipher,
1773 'lua-base4.cc': dep_lua.found(),
1774 'lua-base4.hh': dep_lua.found(),
1776 'lua-record.cc': dep_lua_records.found(),
1778 'sodiumsigners.cc': dep_libsodium.found(),
1780 'decafsigners.cc': dep_libdecaf.found(),
1782 'pkcs11signers.cc': dep_pkcs11.found(),
1783 'pkcs11signers.hh': dep_pkcs11.found(),
1785 'standalone_fuzz_target_runner.cc': get_option('fuzz-targets'),
1790 foreach tool_name, tool_info: tool_libs
1791 tool_deps = tool_info['deps']
1792 tool_main = tool_info['main']
1793 all_sources = tool_info['sources']
1798 foreach source: all_sources
1799 if source.endswith('.cc')
1800 # name = source.underscorify().replace('/', '__')
1802 if source not in source_deps
1803 # Check if the source is conditionally built.
1804 if source not in conditional_sources or (source in conditional_sources and conditional_sources[source])
1805 # Create a new cached dependency for this source file.
1807 source: declare_dependency(
1808 link_whole: static_library(
1809 'pdns-' + source.replace('/', '__'),
1815 elif not conditional_sources[source]
1817 source: dependency('', required: false)
1822 tool_sources += source_deps[source]
1823 elif source.endswith('.hh')
1824 tool_headers += source
1826 error('Unsupported extension for source file ' + source)
1831 'lib' + tool_name.underscorify(),
1833 link_whole: static_library(
1835 sources: [tool_main],
1836 extra_files: tool_headers,
1837 dependencies: tool_deps + tool_sources,