]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/meson.build
8ea3c1a154123a31746a75badefc37a2136613e6
[thirdparty/pdns.git] / pdns / meson.build
1 fs = import('fs')
2
3 dep_cdb = get_variable('dep_cdb', dependency('', required: false))
4 libpdns_cdb = dependency('', required: false)
5 if dep_cdb.found()
6 libpdns_cdb = declare_dependency(
7 link_whole: static_library(
8 'libpdns-cdb',
9 sources: ['cdb.cc'],
10 extra_files: ['cdb.hh'],
11 dependencies: deps,
12 )
13 )
14 endif
15
16 libpdns_bindlexer_cc = 'bindlexer.c'
17 if not fs.is_file(libpdns_bindlexer_cc)
18 flex = find_program('flex', required: true)
19
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')
23
24 flex_generator = generator(
25 flex,
26 output: '@BASENAME@.c',
27 arguments: ['--case-insensitive', '--outfile=@OUTPUT@', '@INPUT@'],
28 )
29
30 libpdns_bindlexer_cc = flex_generator.process('bindlexer.l')
31 endif
32 libpdns_bindlexer_cc = declare_dependency(sources: [libpdns_bindlexer_cc])
33
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)
37 if not bison.found()
38 bison = find_program('yacc', required: true)
39 endif
40
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')
44
45 bison_generator = generator(
46 bison,
47 output: ['@BASENAME@.cc', '@BASENAME@.hh', '@BASENAME@.output'],
48 arguments: ['-d', '--verbose', '--debug', '--output=@OUTPUT0@', '@INPUT@'],
49 )
50
51 libpdns_bindparser_cc = bison_generator.process('bindparser.yy')
52 endif
53 libpdns_bindparser_cc = declare_dependency(sources: [libpdns_bindparser_cc])
54
55 libpdns_bind_parser = declare_dependency(
56 link_whole: static_library(
57 'pdns-bind-parser',
58 cpp_args: '-Wno-redundant-decls',
59 dependencies: [
60 deps,
61 libpdns_bindlexer_cc,
62 libpdns_bindparser_cc,
63 ],
64 )
65 )
66
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(
71 ragel,
72 output: '@BASENAME@.cc',
73 arguments: ['@INPUT@', '-o', '@OUTPUT@'],
74 )
75
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')
79
80 libpdns_dnslabeltext_cc = ragel_generator.process('dnslabeltext.rl')
81 endif
82 libpdns_dnslabeltext = declare_dependency(
83 link_whole: static_library(
84 'pdns-dnslabeltext',
85 sources: [libpdns_dnslabeltext_cc],
86 dependencies: [deps],
87 )
88 )
89
90 libpdns_apidocfiles_h = 'apidocfiles.h'
91 if not fs.is_file(libpdns_apidocfiles_h)
92 py = import('python')
93 python = py.find_installation('python3', modules: 'yaml', required: true)
94
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')
98
99 libpdns_apidocfiles_h = custom_target(
100 'pdns-apidocfiles-h',
101 command: [
102 python,
103 '@INPUT0@',
104 '@INPUT1@',
105 ],
106 input: [
107 'generate-api-swagger.py',
108 product_source_dir / 'docs' / 'http-api' / 'swagger' / 'authoritative-api-swagger.yaml',
109 ],
110 output: 'apidocfiles.h',
111 capture: true,
112 )
113 endif
114 libpdns_apidocfiles = declare_dependency(
115 link_whole: static_library(
116 'pdns-auth-apidocfiles',
117 sources: [libpdns_apidocfiles_h],
118 )
119 )
120
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)
125
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')
129
130 libpdns_bind_dnssec_schema_h = custom_target(
131 'pdns-bind-dnssec-schema',
132 command: [
133 python,
134 '@INPUT0@',
135 '@INPUT1@',
136 ],
137 input: [
138 'generate-bind-dnssec-schema.py',
139 'bind-dnssec.schema.sqlite3.sql',
140 ],
141 output: 'bind-dnssec.schema.sqlite3.sql.h',
142 capture: true,
143 )
144 endif
145 libpdns_bind_dnssec_schema = declare_dependency(
146 link_whole: static_library(
147 'pdns-bind-dnssec-schema',
148 sources: [libpdns_bind_dnssec_schema_h],
149 )
150 )
151
152 tool_libs = {
153 'pdns-auth': {
154 'main': 'auth-main.cc',
155 'sources': [
156 'arguments.cc',
157 'arguments.hh',
158 'auth-caches.cc',
159 'auth-caches.hh',
160 'auth-carbon.cc',
161 'auth-catalogzone.cc',
162 'auth-catalogzone.hh',
163 'auth-main.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',
170 'auth-zonecache.cc',
171 'auth-zonecache.hh',
172 'axfr-retriever.cc',
173 'axfr-retriever.hh',
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.
177 'base32.cc',
178 'base32.hh',
179 'base64.cc',
180 'base64.hh',
181 'burtle.hh',
182 'cachecleaner.hh',
183 'circular_buffer.hh',
184 'comment.hh',
185 'communicator.cc',
186 'communicator.hh',
187 'coverage.cc',
188 'coverage.hh',
189 'credentials.cc',
190 'credentials.hh',
191 'dbdnsseckeeper.cc',
192 'digests.hh',
193 'distributor.hh',
194 'dns.cc',
195 'dns.hh',
196 'dns_random.hh',
197 'dnsbackend.cc',
198 'dnsbackend.hh',
199 'dnsname.cc',
200 'dnsname.hh',
201 'dnspacket.cc',
202 'dnspacket.hh',
203 'dnsparser.cc',
204 'dnsproxy.cc',
205 'dnsproxy.hh',
206 'dnsrecords.cc',
207 'dnsrecords.hh',
208 'dnssecinfra.cc',
209 'dnssecinfra.hh',
210 'dnsseckeeper.hh',
211 'dnssecsigner.cc',
212 'dnswriter.cc',
213 'dynhandler.cc',
214 'dynhandler.hh',
215 'dynlistener.cc',
216 'dynlistener.hh',
217 'dynmessenger.hh',
218 'ednscookies.cc',
219 'ednscookies.hh',
220 'ednsoptions.cc',
221 'ednsoptions.hh',
222 'ednssubnet.cc',
223 'ednssubnet.hh',
224 'gettime.cc',
225 'gettime.hh',
226 'gss_context.cc',
227 'gss_context.hh',
228 'histogram.hh',
229 'iputils.cc',
230 'iputils.hh',
231 'ixfr.cc',
232 'ixfr.hh',
233 'json.cc',
234 'json.hh',
235 'lock.hh',
236 'logger.cc',
237 'logger.hh',
238 'logging.hh',
239 'lua-auth4.cc',
240 'lua-auth4.hh',
241 'lua-base4.cc',
242 'lua-base4.hh',
243 'misc.cc',
244 'misc.hh',
245 'nameserver.cc',
246 'nameserver.hh',
247 'namespaces.hh',
248 'noinitvector.hh',
249 'nsecrecords.cc',
250 'opensslsigners.cc',
251 'opensslsigners.hh',
252 'packetcache.hh',
253 'packethandler.cc',
254 'packethandler.hh',
255 'pdnsexception.hh',
256 'proxy-protocol.cc',
257 'proxy-protocol.hh',
258 'qtype.cc',
259 'qtype.hh',
260 'query-local-address.hh',
261 'query-local-address.cc',
262 'rcpgenerator.cc',
263 'resolver.cc',
264 'resolver.hh',
265 'responsestats.cc',
266 'responsestats.hh',
267 'responsestats-auth.cc',
268 'rfc2136handler.cc',
269 'secpoll-auth.cc',
270 'secpoll-auth.hh',
271 'secpoll.cc',
272 'secpoll.hh',
273 'serialtweaker.cc',
274 'sha.hh',
275 'shuffle.cc',
276 'shuffle.hh',
277 'signingpipe.cc',
278 'signingpipe.hh',
279 'sillyrecords.cc',
280 'stat_t.hh',
281 'statbag.cc',
282 'statbag.hh',
283 'stubresolver.cc',
284 'stubresolver.hh',
285 'svc-records.cc',
286 'svc-records.hh',
287 'tcpreceiver.cc',
288 'tcpreceiver.hh',
289 'threadname.hh',
290 'threadname.cc',
291 'tkey.cc',
292 'trusted-notification-proxy.hh',
293 'trusted-notification-proxy.cc',
294 'tsigutils.hh',
295 'tsigutils.cc',
296 'tsigverifier.cc',
297 'tsigverifier.hh',
298 'ueberbackend.cc',
299 'ueberbackend.hh',
300 'unix_semaphore.cc',
301 'unix_utility.cc',
302 'utility.hh',
303 'uuid-utils.hh',
304 'uuid-utils.cc',
305 'version.cc',
306 'version.hh',
307 'webserver.cc',
308 'webserver.hh',
309 'ws-api.cc',
310 'ws-api.hh',
311 'ws-auth.cc',
312 'ws-auth.hh',
313 'zoneparser-tng.cc',
314
315 'lua-record.cc',
316 'minicurl.cc',
317 'minicurl.hh',
318 'sodiumsigners.cc',
319 'decafsigners.cc',
320 'ssqlite3.cc',
321 'ssqlite3.hh',
322 'pkcs11signers.cc',
323 'pkcs11signers.hh',
324 ],
325 'deps': [
326 deps,
327 libpdns_bind_parser,
328 libpdns_bind_dnssec_schema,
329 libpdns_dnslabeltext,
330 libpdns_apidocfiles,
331 ]
332 },
333 'pdns-auth-util': {
334 'main': 'pdnsutil.cc',
335 'sources': [
336 'arguments.cc',
337 'auth-caches.cc',
338 'auth-caches.hh',
339 'auth-catalogzone.cc',
340 'auth-catalogzone.hh',
341 'auth-packetcache.cc',
342 'auth-packetcache.hh',
343 'auth-querycache.cc',
344 'auth-querycache.hh',
345 'auth-zonecache.cc',
346 'auth-zonecache.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.
350 'base32.cc',
351 'base64.cc',
352 'base64.hh',
353 'cachecleaner.hh',
354 'circular_buffer.hh',
355 'credentials.cc',
356 'credentials.hh',
357 'dbdnsseckeeper.cc',
358 'dns.cc',
359 'dnsbackend.cc',
360 'dnsname.cc',
361 'dnsname.hh',
362 'dnspacket.cc',
363 'dnsparser.cc',
364 'dnsparser.hh',
365 'dnsrecords.cc',
366 'dnssecinfra.cc',
367 'dnssecinfra.hh',
368 'dnssecsigner.cc',
369 'dnswriter.cc',
370 'dnswriter.hh',
371 'dynlistener.cc',
372 'ednscookies.cc',
373 'ednscookies.hh',
374 'ednsoptions.cc',
375 'ednsoptions.hh',
376 'ednssubnet.cc',
377 'gettime.cc',
378 'gettime.hh',
379 'gss_context.cc',
380 'gss_context.hh',
381 'ipcipher.cc',
382 'ipcipher.hh',
383 'iputils.cc',
384 'iputils.hh',
385 'json.cc',
386 'logger.cc',
387 'lua-auth4.cc',
388 'lua-auth4.hh',
389 'lua-base4.cc',
390 'lua-base4.hh',
391 'misc.cc',
392 'misc.hh',
393 'nsecrecords.cc',
394 'opensslsigners.cc',
395 'opensslsigners.hh',
396 'qtype.cc',
397 'rcpgenerator.cc',
398 'rcpgenerator.hh',
399 'serialtweaker.cc',
400 'shuffle.cc',
401 'shuffle.hh',
402 'signingpipe.cc',
403 'sillyrecords.cc',
404 'sstuff.hh',
405 'statbag.cc',
406 'stubresolver.cc',
407 'stubresolver.hh',
408 'svc-records.cc',
409 'svc-records.hh',
410 'threadname.hh',
411 'threadname.cc',
412 'tsigutils.hh',
413 'tsigutils.cc',
414 'ueberbackend.cc',
415 'unix_utility.cc',
416 'uuid-utils.hh',
417 'uuid-utils.cc',
418 'validate.hh',
419 'zonemd.hh',
420 'zonemd.cc',
421 'zoneparser-tng.cc',
422
423 'sodiumsigners.cc',
424 'decafsigners.cc',
425 'ssqlite3.cc',
426 'ssqlite3.hh',
427 'pkcs11signers.cc',
428 'pkcs11signers.hh',
429 ],
430 'deps': [
431 deps,
432 libpdns_bind_parser,
433 libpdns_dnslabeltext,
434 ],
435 },
436 'pdns-auth-control': {
437 'main': 'dynloader.cc',
438 'sources': [
439 'arguments.cc',
440 'dnsname.cc',
441 'dynmessenger.cc',
442 'logger.cc',
443 'misc.cc',
444 'qtype.cc',
445 'statbag.cc',
446 'unix_utility.cc',
447 ],
448 'deps': [
449 deps,
450 libpdns_dnslabeltext,
451 ],
452 },
453 'zone2sql': {
454 'main': 'zone2sql.cc',
455 'sources': [
456 'arguments.cc',
457 'base32.cc',
458 'base64.cc',
459 'bindparserclasses.hh',
460 'dns.cc',
461 'dnsname.cc',
462 'dnsname.hh',
463 'dnsparser.cc',
464 'dnsrecords.cc',
465 'dnswriter.cc',
466 'json.cc',
467 'json.hh',
468 'logger.cc',
469 'misc.cc',
470 'nsecrecords.cc',
471 'qtype.cc',
472 'rcpgenerator.cc',
473 'sillyrecords.cc',
474 'statbag.cc',
475 'svc-records.cc',
476 'svc-records.hh',
477 'unix_utility.cc',
478 'zoneparser-tng.cc',
479 ],
480 'deps': [
481 deps,
482 libpdns_bind_parser,
483 libpdns_bind_dnssec_schema,
484 libpdns_dnslabeltext,
485 ],
486 },
487 'zone2json': {
488 'main': 'zone2json.cc',
489 'sources': [
490 'arguments.cc',
491 'base32.cc',
492 'base64.cc',
493 'bindparserclasses.hh',
494 'dnsname.cc',
495 'dnsname.hh',
496 'dnsparser.cc',
497 'dnsrecords.cc',
498 'dnswriter.cc',
499 'logger.cc',
500 'misc.cc',
501 'nsecrecords.cc',
502 'qtype.cc',
503 'rcpgenerator.cc',
504 'sillyrecords.cc',
505 'statbag.cc',
506 'svc-records.cc',
507 'svc-records.hh',
508 'unix_utility.cc',
509 'zoneparser-tng.cc',
510 ],
511 'deps': [
512 deps,
513 libpdns_bind_parser,
514 libpdns_bind_dnssec_schema,
515 libpdns_dnslabeltext,
516 ],
517 },
518 }
519
520 if get_option('module-ldap') != 'disabled'
521 tool_libs += {
522 'zone2ldap': {
523 'main': 'zone2ldap.cc',
524 'sources': [
525 'arguments.cc',
526 'base32.cc',
527 'base64.cc',
528 'bindparserclasses.hh',
529 'dnsname.cc',
530 'dnsname.hh',
531 'dnsparser.cc',
532 'dnsrecords.cc',
533 'dnswriter.cc',
534 'logger.cc',
535 'misc.cc',
536 'nsecrecords.cc',
537 'qtype.cc',
538 'rcpgenerator.cc',
539 'sillyrecords.cc',
540 'statbag.cc',
541 'svc-records.cc',
542 'svc-records.hh',
543 'unix_utility.cc',
544 'zoneparser-tng.cc',
545 ],
546 'deps': [
547 deps,
548 libpdns_bind_parser,
549 libpdns_bind_dnssec_schema,
550 libpdns_dnslabeltext,
551 ],
552 },
553 }
554 endif
555
556 if get_option('tools')
557 tool_libs += {
558 'sdig': {
559 'main': 'sdig.cc',
560 'sources': [
561 'base32.cc',
562 'base64.cc',
563 'base64.hh',
564 'dns.cc',
565 'dnsname.cc',
566 'dnsname.hh',
567 'dnsparser.cc',
568 'dnsparser.hh',
569 'dnsrecords.cc',
570 'dnswriter.cc',
571 'dnswriter.hh',
572 'dolog.hh',
573 'ednsextendederror.cc',
574 'ednsextendederror.hh',
575 'ednssubnet.cc',
576 'iputils.cc',
577 'libssl.cc',
578 'libssl.hh',
579 'logger.cc',
580 'misc.cc',
581 'misc.hh',
582 'nsecrecords.cc',
583 'proxy-protocol.cc',
584 'proxy-protocol.hh',
585 'qtype.cc',
586 'rcpgenerator.cc',
587 'rcpgenerator.hh',
588 'sillyrecords.cc',
589 'sstuff.hh',
590 'statbag.cc',
591 'svc-records.cc',
592 'svc-records.hh',
593 'tcpiohandler.cc',
594 'tcpiohandler.hh',
595 'unix_utility.cc',
596
597 'minicurl.cc',
598 'minicurl.hh',
599 ],
600 'deps': [
601 deps,
602 libpdns_dnslabeltext,
603 ],
604 },
605 'calidns': {
606 'main': 'calidns.cc',
607 'sources': [
608 'base32.cc',
609 'base64.cc',
610 'base64.hh',
611 'dns_random.hh',
612 'dnsname.cc',
613 'dnsname.hh',
614 'dnsparser.cc',
615 'dnsparser.hh',
616 'dnsrecords.cc',
617 'dnswriter.cc',
618 'dnswriter.hh',
619 'ednsoptions.cc',
620 'ednsoptions.hh',
621 'ednssubnet.cc',
622 'ednssubnet.hh',
623 'iputils.cc',
624 'logger.cc',
625 'misc.cc',
626 'misc.hh',
627 'nsecrecords.cc',
628 'qtype.cc',
629 'rcpgenerator.cc',
630 'rcpgenerator.hh',
631 'sillyrecords.cc',
632 'sstuff.hh',
633 'statbag.cc',
634 'svc-records.cc',
635 'svc-records.hh',
636 'unix_utility.cc',
637 ],
638 'deps': [
639 deps,
640 libpdns_dnslabeltext,
641 ],
642 },
643 # TODO: Broken
644 # 'comfun': {
645 # 'main': 'comfun.cc',
646 # 'sources': [
647 # 'base32.cc',
648 # 'base64.cc',
649 # 'dns.cc',
650 # 'dnsname.cc',
651 # 'dnsname.hh',
652 # 'dnsparser.cc',
653 # 'dnsrecords.cc',
654 # 'dnswriter.cc',
655 # 'logger.cc',
656 # 'misc.cc',
657 # 'nsecrecords.cc',
658 # 'qtype.cc',
659 # 'rcpgenerator.cc',
660 # 'sillyrecords.cc',
661 # 'statbag.cc',
662 # 'svc-records.cc',
663 # 'svc-records.hh',
664 # 'unix_utility.cc',
665 # 'zoneparser-tng.cc',
666 # 'zoneparser-tng.hh',
667 # ],
668 # 'deps': [
669 # deps,
670 # libpdns_dnslabeltext,
671 # ],
672 # },
673 'dnsdemog': {
674 'main': 'dnsdemog.cc',
675 'sources': [
676 'base32.cc',
677 'base64.cc',
678 'base64.hh',
679 'dnsname.cc',
680 'dnsname.hh',
681 'dnsparser.cc',
682 'dnsparser.hh',
683 'dnspcap.cc',
684 'dnspcap.hh',
685 'dnsrecords.cc',
686 'dnswriter.cc',
687 'dnswriter.hh',
688 'logger.cc',
689 'misc.cc',
690 'nsecrecords.cc',
691 'qtype.cc',
692 'rcpgenerator.cc',
693 'rcpgenerator.hh',
694 'sillyrecords.cc',
695 'statbag.cc',
696 'svc-records.cc',
697 'svc-records.hh',
698 'unix_utility.cc',
699 'utility.hh',
700 ],
701 'deps': [
702 deps,
703 libpdns_dnslabeltext,
704 ],
705 },
706 'dnsgram': {
707 'main': 'dnsgram.cc',
708 'sources': [
709 'base32.cc',
710 'base64.cc',
711 'base64.hh',
712 'dnsname.cc',
713 'dnsname.hh',
714 'dnsparser.cc',
715 'dnsparser.hh',
716 'dnspcap.cc',
717 'dnspcap.hh',
718 'dnsrecords.cc',
719 'dnswriter.cc',
720 'dnswriter.hh',
721 'logger.cc',
722 'misc.cc',
723 'nsecrecords.cc',
724 'qtype.cc',
725 'rcpgenerator.cc',
726 'rcpgenerator.hh',
727 'sillyrecords.cc',
728 'statbag.cc',
729 'svc-records.cc',
730 'svc-records.hh',
731 'unix_utility.cc',
732 'utility.hh',
733 ],
734 'deps': [
735 deps,
736 libpdns_dnslabeltext,
737 ],
738 },
739 'dnspcap2calidns': {
740 'main': 'dnspcap2calidns.cc',
741 'sources': [
742 'base32.cc',
743 'base64.cc',
744 'base64.hh',
745 'dnsname.cc',
746 'dnsname.hh',
747 'dnsparser.cc',
748 'dnsparser.hh',
749 'dnspcap.cc',
750 'dnspcap.hh',
751 'dnsrecords.cc',
752 'dnswriter.cc',
753 'dnswriter.hh',
754 'ednsoptions.cc',
755 'ednsoptions.hh',
756 'ednssubnet.cc',
757 'ednssubnet.hh',
758 'iputils.cc',
759 'logger.cc',
760 'misc.cc',
761 'nsecrecords.cc',
762 'qtype.cc',
763 'rcpgenerator.cc',
764 'rcpgenerator.hh',
765 'sillyrecords.cc',
766 'statbag.cc',
767 'svc-records.cc',
768 'svc-records.hh',
769 'unix_utility.cc',
770 'utility.hh',
771 ],
772 'deps': [
773 deps,
774 libpdns_dnslabeltext,
775 ],
776 },
777 'dnspcap2protobuf': {
778 'main': 'dnspcap2protobuf.cc',
779 'sources': [
780 'base32.cc',
781 'base64.cc',
782 'base64.hh',
783 'dnsname.cc',
784 'dnsname.hh',
785 'dnsparser.cc',
786 'dnsparser.hh',
787 'dnspcap.cc',
788 'dnspcap.hh',
789 'dnsrecords.cc',
790 'dnswriter.cc',
791 'dnswriter.hh',
792 'gettime.cc',
793 'gettime.hh',
794 'iputils.cc',
795 'logger.cc',
796 'misc.cc',
797 'nsecrecords.cc',
798 'protozero.cc',
799 'protozero.hh',
800 'qtype.cc',
801 'rcpgenerator.cc',
802 'rcpgenerator.hh',
803 'sillyrecords.cc',
804 'statbag.cc',
805 'svc-records.cc',
806 'svc-records.hh',
807 'unix_utility.cc',
808 'utility.hh',
809 'uuid-utils.hh',
810 'uuid-utils.cc',
811 ],
812 'deps': [
813 deps,
814 libpdns_dnslabeltext,
815 ],
816 },
817 'dnsreplay': {
818 'main': 'dnsreplay.cc',
819 'sources': [
820 'anadns.hh',
821 'base32.cc',
822 'base64.cc',
823 'base64.hh',
824 'dnsname.cc',
825 'dnsname.hh',
826 'dnsparser.cc',
827 'dnsparser.hh',
828 'dnspcap.cc',
829 'dnspcap.hh',
830 'dnsrecords.cc',
831 'dnswriter.cc',
832 'dnswriter.hh',
833 'ednsoptions.cc',
834 'ednsoptions.hh',
835 'ednssubnet.cc',
836 'ednssubnet.hh',
837 'iputils.cc',
838 'logger.cc',
839 'misc.cc',
840 'nsecrecords.cc',
841 'qtype.cc',
842 'rcpgenerator.cc',
843 'rcpgenerator.hh',
844 'sillyrecords.cc',
845 'statbag.cc',
846 'svc-records.cc',
847 'svc-records.hh',
848 'unix_utility.cc',
849 'utility.hh',
850 ],
851 'deps': [
852 deps,
853 libpdns_dnslabeltext,
854 ],
855 },
856 'dnsscan': {
857 'main': 'dnsscan.cc',
858 'sources': [
859 'anadns.hh',
860 'base32.cc',
861 'base64.cc',
862 'base64.hh',
863 'dnsname.cc',
864 'dnsname.hh',
865 'dnsparser.cc',
866 'dnsparser.hh',
867 'dnspcap.cc',
868 'dnspcap.hh',
869 'dnsrecords.cc',
870 'dnswriter.cc',
871 'dnswriter.hh',
872 'logger.cc',
873 'misc.cc',
874 'nsecrecords.cc',
875 'qtype.cc',
876 'rcpgenerator.cc',
877 'rcpgenerator.hh',
878 'sillyrecords.cc',
879 'statbag.cc',
880 'svc-records.cc',
881 'svc-records.hh',
882 'unix_utility.cc',
883 'utility.hh',
884 ],
885 'deps': [
886 deps,
887 libpdns_dnslabeltext,
888 ],
889 },
890 'dnsscope': {
891 'main': 'dnsscope.cc',
892 'sources': [
893 'arguments.cc',
894 'base32.cc',
895 'base64.cc',
896 'base64.hh',
897 'dns.cc',
898 'dnsname.cc',
899 'dnsname.hh',
900 'dnsparser.cc',
901 'dnsparser.hh',
902 'dnspcap.cc',
903 'dnspcap.hh',
904 'dnsrecords.cc',
905 'dnswriter.cc',
906 'dnswriter.hh',
907 'histog.hh',
908 'logger.cc',
909 'misc.cc',
910 'nsecrecords.cc',
911 'qtype.cc',
912 'rcpgenerator.cc',
913 'rcpgenerator.hh',
914 'sillyrecords.cc',
915 'statbag.cc',
916 'statnode.cc',
917 'statnode.hh',
918 'svc-records.cc',
919 'svc-records.hh',
920 'unix_utility.cc',
921 'utility.hh',
922 ],
923 'deps': [
924 deps,
925 libpdns_dnslabeltext,
926 ],
927 },
928 'dnswasher': {
929 'main': 'dnswasher.cc',
930 'sources': [
931 'base64.cc',
932 'dnsname.hh',
933 'dnsname.cc',
934 'dnsparser.hh',
935 'dnspcap.cc',
936 'dnspcap.hh',
937 'dnswriter.hh',
938 'ipcipher.cc',
939 'ipcipher.hh',
940 'logger.cc',
941 'misc.cc',
942 'qtype.cc',
943 'statbag.cc',
944 'unix_utility.cc',
945 ],
946 'deps': [
947 deps,
948 libpdns_dnslabeltext,
949 ],
950 },
951 'nproxy': {
952 'main': 'nproxy.cc',
953 'sources': [
954 'base32.cc',
955 'base64.cc',
956 'base64.hh',
957 'dnsname.cc',
958 'dnsname.hh',
959 'dnsparser.cc',
960 'dnsparser.hh',
961 'dnsrecords.cc',
962 'dnswriter.cc',
963 'dnswriter.hh',
964 'logger.cc',
965 'misc.cc',
966 'mplexer.hh',
967 'nsecrecords.cc',
968 'pollmplexer.cc',
969 'qtype.cc',
970 'rcpgenerator.cc',
971 'rcpgenerator.hh',
972 'sillyrecords.cc',
973 'statbag.cc',
974 'svc-records.cc',
975 'svc-records.hh',
976 'unix_utility.cc',
977 ],
978 'deps': [
979 deps,
980 libpdns_dnslabeltext,
981 ],
982 },
983 'nsec3dig': {
984 'main': 'nsec3dig.cc',
985 'sources': [
986 'base32.cc',
987 'base64.cc',
988 'base64.hh',
989 'dnsname.cc',
990 'dnsname.hh',
991 'dnsparser.cc',
992 'dnsparser.hh',
993 'dnsrecords.cc',
994 'dnssecinfra.cc',
995 'dnswriter.cc',
996 'dnswriter.hh',
997 'gss_context.cc',
998 'gss_context.hh',
999 'iputils.cc',
1000 'logger.cc',
1001 'misc.cc',
1002 'misc.hh',
1003 'nsecrecords.cc',
1004 'qtype.cc',
1005 'rcpgenerator.cc',
1006 'rcpgenerator.hh',
1007 'sillyrecords.cc',
1008 'sstuff.hh',
1009 'statbag.cc',
1010 'svc-records.cc',
1011 'svc-records.hh',
1012 'unix_utility.cc',
1013
1014 'pkcs11signers.cc',
1015 'pkcs11signers.hh',
1016 ],
1017 'deps': [
1018 deps,
1019 libpdns_dnslabeltext,
1020 ],
1021 },
1022 'pdns-auth-notify': {
1023 'main': 'notify.cc',
1024 'sources': [
1025 'arguments.cc',
1026 'base32.cc',
1027 'base64.cc',
1028 'base64.hh',
1029 'dns.cc',
1030 'dnsname.cc',
1031 'dnsname.hh',
1032 'dnsparser.cc',
1033 'dnsparser.hh',
1034 'dnsrecords.cc',
1035 'dnswriter.cc',
1036 'dnswriter.hh',
1037 'logger.cc',
1038 'misc.cc',
1039 'nsecrecords.cc',
1040 'pollmplexer.cc',
1041 'qtype.cc',
1042 'rcpgenerator.cc',
1043 'rcpgenerator.hh',
1044 'sillyrecords.cc',
1045 'statbag.cc',
1046 'svc-records.cc',
1047 'svc-records.hh',
1048 'unix_utility.cc',
1049 ],
1050 'deps': [
1051 deps,
1052 libpdns_dnslabeltext,
1053 ],
1054 },
1055 'dumresp': {
1056 'main': 'dumresp.cc',
1057 'sources': [
1058 'dnsname.cc',
1059 'dnsname.hh',
1060 'iputils.cc',
1061 'iputils.hh',
1062 'logger.cc',
1063 'misc.cc',
1064 'misc.hh',
1065 'qtype.cc',
1066 'statbag.cc',
1067 'unix_utility.cc',
1068 ],
1069 'deps': [
1070 deps,
1071 libpdns_dnslabeltext,
1072 ],
1073 },
1074 'kvresp': {
1075 'main': 'kvresp.cc',
1076 'sources': [
1077 'dnsname.cc',
1078 'dnsname.hh',
1079 'logger.cc',
1080 'misc.cc',
1081 'misc.hh',
1082 'qtype.cc',
1083 'statbag.cc',
1084 'unix_utility.cc',
1085 ],
1086 'deps': [
1087 deps,
1088 libpdns_dnslabeltext,
1089 ],
1090 },
1091 'stubquery': {
1092 'main': 'stubquery.cc',
1093 'sources': [
1094 'arguments.cc',
1095 'arguments.hh',
1096 'base32.cc',
1097 'base64.cc',
1098 'dnsname.cc',
1099 'dnsparser.cc',
1100 'dnsrecords.cc',
1101 'dnswriter.cc',
1102 'iputils.cc',
1103 'logger.cc',
1104 'misc.cc',
1105 'nsecrecords.cc',
1106 'qtype.cc',
1107 'rcpgenerator.cc',
1108 'sillyrecords.cc',
1109 'statbag.cc',
1110 'stubresolver.cc',
1111 'stubresolver.hh',
1112 'svc-records.cc',
1113 'svc-records.hh',
1114 'unix_utility.cc',
1115 ],
1116 'deps': [
1117 deps,
1118 libpdns_dnslabeltext,
1119 ],
1120 },
1121 'saxfr': {
1122 'main': 'saxfr.cc',
1123 'sources': [
1124 'base32.cc',
1125 'base64.cc',
1126 'base64.hh',
1127 'dns_random.hh',
1128 'dnsname.cc',
1129 'dnsname.hh',
1130 'dnsparser.cc',
1131 'dnsparser.hh',
1132 'dnsrecords.cc',
1133 'dnssecinfra.cc',
1134 'dnswriter.cc',
1135 'dnswriter.hh',
1136 'gss_context.cc',
1137 'gss_context.hh',
1138 'iputils.cc',
1139 'logger.cc',
1140 'misc.cc',
1141 'misc.hh',
1142 'nsecrecords.cc',
1143 'qtype.cc',
1144 'rcpgenerator.cc',
1145 'rcpgenerator.hh',
1146 'sillyrecords.cc',
1147 'sstuff.hh',
1148 'statbag.cc',
1149 'svc-records.cc',
1150 'svc-records.hh',
1151 'unix_utility.cc',
1152
1153 'pkcs11signers.cc',
1154 'pkcs11signers.hh',
1155 ],
1156 'deps': [
1157 deps,
1158 libpdns_dnslabeltext,
1159 ],
1160 },
1161 }
1162
1163 if have_boost_1_48_0
1164 tool_libs += {
1165 'dnstcpbench': {
1166 'main': 'dnstcpbench.cc',
1167 'sources': [
1168 'base32.cc',
1169 'base64.cc',
1170 'base64.hh',
1171 'dnsname.cc',
1172 'dnsname.hh',
1173 'dnsparser.cc',
1174 'dnsparser.hh',
1175 'dnsrecords.cc',
1176 'dnswriter.cc',
1177 'dnswriter.hh',
1178 'iputils.cc',
1179 'logger.cc',
1180 'misc.cc',
1181 'misc.hh',
1182 'nsecrecords.cc',
1183 'qtype.cc',
1184 'rcpgenerator.cc',
1185 'rcpgenerator.hh',
1186 'sillyrecords.cc',
1187 'sstuff.hh',
1188 'statbag.cc',
1189 'svc-records.cc',
1190 'svc-records.hh',
1191 'threadname.hh',
1192 'threadname.cc',
1193 'unix_utility.cc',
1194 ],
1195 'deps': [
1196 deps,
1197 libpdns_dnslabeltext,
1198 ],
1199 },
1200 'dnsbulktest': {
1201 'main': 'dnsbulktest.cc',
1202 'sources': [
1203 'arguments.cc',
1204 'arguments.hh',
1205 'base32.cc',
1206 'base64.cc',
1207 'dns_random.hh',
1208 'dnsname.cc',
1209 'dnsname.hh',
1210 'dnsparser.cc',
1211 'dnsrecords.cc',
1212 'dnswriter.cc',
1213 'iputils.cc',
1214 'iputils.hh',
1215 'logger.cc',
1216 'misc.cc',
1217 'nsecrecords.cc',
1218 'qtype.cc',
1219 'rcpgenerator.cc',
1220 'sillyrecords.cc',
1221 'statbag.cc',
1222 'svc-records.cc',
1223 'svc-records.hh',
1224 'unix_utility.cc',
1225 ],
1226 'deps': [
1227 deps,
1228 libpdns_dnslabeltext,
1229 ],
1230 },
1231 }
1232 endif
1233 endif
1234
1235 if get_option('tools-ixfrdist')
1236 tool_libs += {
1237 'ixfrdist': {
1238 'main': 'ixfrdist.cc',
1239 'sources': [
1240 'arguments.cc',
1241 'axfr-retriever.cc',
1242 'base32.cc',
1243 'base64.cc',
1244 'base64.hh',
1245 'credentials.cc',
1246 'credentials.hh',
1247 'dns.cc',
1248 'dns_random.hh',
1249 'dnsname.cc',
1250 'dnsname.hh',
1251 'dnsparser.cc',
1252 'dnsparser.hh',
1253 'dnsrecords.cc',
1254 'dnssecinfra.cc',
1255 'dnswriter.cc',
1256 'dnswriter.hh',
1257 'gss_context.cc',
1258 'gss_context.hh',
1259 'iputils.hh',
1260 'iputils.cc',
1261 'ixfr.cc',
1262 'ixfr.hh',
1263 'ixfrdist-stats.hh',
1264 'ixfrdist-stats.cc',
1265 'ixfrdist-web.hh',
1266 'ixfrdist-web.cc',
1267 'ixfrutils.cc',
1268 'ixfrutils.hh',
1269 'logger.cc',
1270 'logger.hh',
1271 'misc.cc',
1272 'misc.hh',
1273 'mplexer.hh',
1274 'nsecrecords.cc',
1275 'pollmplexer.cc',
1276 'qtype.cc',
1277 'query-local-address.hh',
1278 'query-local-address.cc',
1279 'rcpgenerator.cc',
1280 'rcpgenerator.hh',
1281 'resolver.cc',
1282 'sillyrecords.cc',
1283 'sstuff.hh',
1284 'statbag.cc',
1285 'svc-records.cc',
1286 'svc-records.hh',
1287 'threadname.hh',
1288 'threadname.cc',
1289 'tsigverifier.cc',
1290 'tsigverifier.hh',
1291 'unix_utility.cc',
1292 'uuid-utils.hh',
1293 'uuid-utils.cc',
1294 'webserver.hh',
1295 'webserver.cc',
1296 'zoneparser-tng.cc',
1297
1298 'pkcs11signers.cc',
1299 'pkcs11signers.hh',
1300 'kqueuemplexer.cc',
1301 'epollmplexer.cc',
1302 'devpollmplexer.cc',
1303 'portsmplexer.cc',
1304 ],
1305 'deps': [
1306 deps,
1307 libpdns_dnslabeltext,
1308 ],
1309 },
1310 'ixplore': {
1311 'main': 'ixplore.cc',
1312 'sources': [
1313 'arguments.cc',
1314 'axfr-retriever.cc',
1315 'base32.cc',
1316 'base64.cc',
1317 'base64.hh',
1318 'dns.cc',
1319 'dns_random.hh',
1320 'dnsname.cc',
1321 'dnsname.hh',
1322 'dnsparser.cc',
1323 'dnsparser.hh',
1324 'dnsrecords.cc',
1325 'dnssecinfra.cc',
1326 'dnswriter.cc',
1327 'dnswriter.hh',
1328 'gss_context.cc',
1329 'gss_context.hh',
1330 'iputils.cc',
1331 'ixfr.cc',
1332 'ixfr.hh',
1333 'ixfrutils.cc',
1334 'ixfrutils.hh',
1335 'logger.cc',
1336 'misc.cc',
1337 'misc.hh',
1338 'nsecrecords.cc',
1339 'qtype.cc',
1340 'query-local-address.hh',
1341 'query-local-address.cc',
1342 'rcpgenerator.cc',
1343 'rcpgenerator.hh',
1344 'resolver.cc',
1345 'sillyrecords.cc',
1346 'sstuff.hh',
1347 'statbag.cc',
1348 'svc-records.cc',
1349 'svc-records.hh',
1350 'tsigverifier.cc',
1351 'tsigverifier.hh',
1352 'unix_utility.cc',
1353 'zoneparser-tng.cc',
1354
1355 'pkcs11signers.cc',
1356 'pkcs11signers.hh',
1357 ],
1358 'deps': [
1359 deps,
1360 libpdns_dnslabeltext,
1361 ],
1362 },
1363 }
1364 endif
1365
1366 if get_option('unit-tests') or get_option('unit-tests-backends')
1367 tool_libs += {
1368 'tsig_tests': {
1369 'main': 'tsig-tests.cc',
1370 'sources': [
1371 'arguments.cc',
1372 'axfr-retriever.cc',
1373 'base32.cc',
1374 'base64.cc',
1375 'base64.hh',
1376 'digests.hh',
1377 'dns.cc',
1378 'dns_random.hh',
1379 'dnsname.cc',
1380 'dnsname.hh',
1381 'dnsparser.cc',
1382 'dnsparser.hh',
1383 'dnsrecords.cc',
1384 'dnssecinfra.cc',
1385 'dnswriter.cc',
1386 'dnswriter.hh',
1387 'gss_context.cc',
1388 'gss_context.hh',
1389 'iputils.cc',
1390 'logger.cc',
1391 'misc.cc',
1392 'misc.hh',
1393 'nsecrecords.cc',
1394 'qtype.cc',
1395 'query-local-address.cc',
1396 'rcpgenerator.cc',
1397 'rcpgenerator.hh',
1398 'resolver.cc',
1399 'sillyrecords.cc',
1400 'sstuff.hh',
1401 'statbag.cc',
1402 'svc-records.cc',
1403 'svc-records.hh',
1404 'tsigverifier.cc',
1405 'tsigverifier.hh',
1406 'unix_utility.cc',
1407
1408 'pkcs11signers.cc',
1409 'pkcs11signers.hh',
1410 ],
1411 'deps': [
1412 deps,
1413 libpdns_dnslabeltext,
1414 ],
1415 },
1416 'speedtest': {
1417 'main': 'speedtest.cc',
1418 'sources': [
1419 'arguments.cc',
1420 'arguments.hh',
1421 'base32.cc',
1422 'base64.cc',
1423 'base64.hh',
1424 'credentials.cc',
1425 'credentials.hh',
1426 'dns_random.hh',
1427 'dnsname.cc',
1428 'dnsname.hh',
1429 'dnsparser.cc',
1430 'dnsparser.hh',
1431 'dnsrecords.cc',
1432 'dnssecinfra.cc',
1433 'dnssecinfra.hh',
1434 'dnswriter.cc',
1435 'dnswriter.hh',
1436 'gss_context.cc',
1437 'gss_context.hh',
1438 'iputils.cc',
1439 'logger.cc',
1440 'misc.cc',
1441 'misc.hh',
1442 'nsecrecords.cc',
1443 'qtype.cc',
1444 'rcpgenerator.cc',
1445 'rcpgenerator.hh',
1446 'sillyrecords.cc',
1447 'statbag.cc',
1448 'svc-records.cc',
1449 'svc-records.hh',
1450 'unix_utility.cc',
1451 'uuid-utils.cc',
1452
1453 'pkcs11signers.cc',
1454 'pkcs11signers.hh',
1455 ],
1456 'deps': [
1457 deps,
1458 libpdns_dnslabeltext,
1459 ],
1460 },
1461 'pdns-auth-testrunner': {
1462 'main': 'testrunner.cc',
1463 'sources': [
1464 'arguments.cc',
1465 'auth-caches.cc',
1466 'auth-caches.hh',
1467 'auth-packetcache.cc',
1468 'auth-packetcache.hh',
1469 'auth-querycache.cc',
1470 'auth-querycache.hh',
1471 'auth-zonecache.cc',
1472 'auth-zonecache.hh',
1473 'base32.cc',
1474 'base64.cc',
1475 'channel.cc',
1476 'channel.hh',
1477 'credentials.cc',
1478 'credentials.hh',
1479 'dbdnsseckeeper.cc',
1480 'dns.cc',
1481 'dnsbackend.cc',
1482 'dnsname.cc',
1483 'dnsname.hh',
1484 'dnspacket.cc',
1485 'dnsparser.hh',
1486 'dnsparser.cc',
1487 'dnsrecords.cc',
1488 'dnssecinfra.cc',
1489 'dnssecsigner.cc',
1490 'dnswriter.cc',
1491 'ednscookies.cc',
1492 'ednscookies.hh',
1493 'ednsoptions.cc',
1494 'ednsoptions.hh',
1495 'ednssubnet.cc',
1496 'gettime.cc',
1497 'gettime.hh',
1498 'gss_context.cc',
1499 'gss_context.hh',
1500 'histogram.hh',
1501 'ipcipher.cc',
1502 'ipcipher.hh',
1503 'iputils.cc',
1504 'ixfr.cc',
1505 'ixfr.hh',
1506 'logger.cc',
1507 'lua-auth4.hh',
1508 'lua-auth4.cc',
1509 'lua-base4.hh',
1510 'lua-base4.cc',
1511 'misc.cc',
1512 'nameserver.cc',
1513 'nsecrecords.cc',
1514 'opensslsigners.cc',
1515 'opensslsigners.hh',
1516 'pollmplexer.cc',
1517 'proxy-protocol.cc',
1518 'proxy-protocol.hh',
1519 'qtype.cc',
1520 'rcpgenerator.cc',
1521 'responsestats-auth.cc',
1522 'responsestats.cc',
1523 'responsestats.hh',
1524 'shuffle.cc',
1525 'shuffle.hh',
1526 'sillyrecords.cc',
1527 'stat_t.hh',
1528 'statbag.cc',
1529 'stubresolver.hh',
1530 'stubresolver.cc',
1531 'svc-records.cc',
1532 'svc-records.hh',
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',
1538 'test-channel.cc',
1539 'test-common.hh',
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',
1554 'test-ixfr_cc.cc',
1555 'test-lock_hh.cc',
1556 'test-lua_auth4_cc.cc',
1557 'test-luawrapper.cc',
1558 'test-misc_hh.cc',
1559 'test-mplexer.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',
1565 'test-sha_hh.cc',
1566 'test-signers.cc',
1567 'test-statbag_cc.cc',
1568 'test-svc_records_cc.cc',
1569 'test-trusted-notification-proxy_cc.cc',
1570 'test-tsig.cc',
1571 'test-ueberbackend_cc.cc',
1572 'test-webserver_cc.cc',
1573 'test-zonemd_cc.cc',
1574 'test-zoneparser_tng_cc.cc',
1575 'threadname.hh',
1576 'threadname.cc',
1577 'trusted-notification-proxy.cc',
1578 'tsigverifier.cc',
1579 'tsigverifier.hh',
1580 'ueberbackend.cc',
1581 'ueberbackend.hh',
1582 'unix_utility.cc',
1583 'uuid-utils.cc',
1584 'validate.hh',
1585 'webserver.cc',
1586 'zonemd.cc',
1587 'zonemd.hh',
1588 'zoneparser-tng.cc',
1589 'zoneparser-tng.hh',
1590
1591 'pkcs11signers.cc',
1592 'pkcs11signers.hh',
1593 'sodiumsigners.cc',
1594 'decafsigners.cc',
1595 'kqueuemplexer.cc',
1596 'epollmplexer.cc',
1597 'devpollmplexer.cc',
1598 'portsmplexer.cc',
1599 ],
1600 'deps': [
1601 deps,
1602 libpdns_bind_parser,
1603 libpdns_dnslabeltext,
1604 ],
1605 },
1606 }
1607 endif
1608
1609 if get_option('fuzz-targets')
1610 tool_libs += {
1611 'fuzz_target_moadnsparser': {
1612 'main': 'fuzz_moadnsparser.cc',
1613 'sources': [
1614 'base32.cc',
1615 'base32.hh',
1616 'base64.cc',
1617 'base64.hh',
1618 'dnsname.cc',
1619 'dnsname.hh',
1620 'dnsparser.cc',
1621 'dnsparser.hh',
1622 'dnsrecords.cc',
1623 'dnsrecords.hh',
1624 'dnswriter.cc',
1625 'dnswriter.hh',
1626 'logger.cc',
1627 'logger.hh',
1628 'misc.cc',
1629 'misc.hh',
1630 'nsecrecords.cc',
1631 'qtype.cc',
1632 'qtype.hh',
1633 'rcpgenerator.cc',
1634 'rcpgenerator.hh',
1635 'sillyrecords.cc',
1636 'statbag.cc',
1637 'statbag.hh',
1638 'svc-records.cc',
1639 'svc-records.hh',
1640 'unix_utility.cc',
1641 'utility.hh',
1642
1643 'standalone_fuzz_target_runner.cc',
1644 ],
1645 'deps': [
1646 deps,
1647 libpdns_dnslabeltext,
1648 ],
1649 },
1650 'fuzz_target_packetcache': {
1651 'main': 'fuzz_packetcache.cc',
1652 'sources': [
1653 'dnsname.cc',
1654 'dnsname.hh',
1655 'ednsoptions.cc',
1656 'ednsoptions.hh',
1657 'misc.cc',
1658 'misc.hh',
1659 'packetcache.hh',
1660 'qtype.cc',
1661 'qtype.hh',
1662 'statbag.cc',
1663 'statbag.hh',
1664 'svc-records.cc',
1665 'svc-records.hh',
1666
1667 'standalone_fuzz_target_runner.cc',
1668 ],
1669 'deps': [
1670 deps,
1671 libpdns_dnslabeltext,
1672 ],
1673 },
1674 'fuzz_target_proxyprotocol': {
1675 'main': 'fuzz_proxyprotocol.cc',
1676 'sources': [
1677 'iputils.hh',
1678 'proxy-protocol.cc',
1679 'proxy-protocol.hh',
1680
1681 'standalone_fuzz_target_runner.cc',
1682 ],
1683 'deps': [
1684 deps,
1685 libpdns_dnslabeltext,
1686 ],
1687 },
1688 'fuzz_target_dnslabeltext_parseRFC1035CharString': {
1689 'main': 'fuzz_dnslabeltext_parseRFC1035CharString.cc',
1690 'sources': [
1691 'standalone_fuzz_target_runner.cc',
1692 ],
1693 'deps': [
1694 deps,
1695 libpdns_dnslabeltext,
1696 ],
1697 },
1698 'fuzz_target_yahttp': {
1699 'main': 'fuzz_yahttp.cc',
1700 'sources': [
1701 'standalone_fuzz_target_runner.cc',
1702 ],
1703 'deps': [
1704 deps,
1705 libpdns_dnslabeltext,
1706 ],
1707 },
1708 'fuzz_target_zoneparsertng': {
1709 'main': 'fuzz_zoneparsertng.cc',
1710 'sources': [
1711 'base32.cc',
1712 'base32.hh',
1713 'base64.cc',
1714 'base64.hh',
1715 'dnsname.cc',
1716 'dnsname.hh',
1717 'dnsparser.cc',
1718 'dnsparser.hh',
1719 'dnsrecords.cc',
1720 'dnsrecords.hh',
1721 'dnswriter.cc',
1722 'dnswriter.hh',
1723 'logger.cc',
1724 'logger.hh',
1725 'misc.cc',
1726 'misc.hh',
1727 'nsecrecords.cc',
1728 'qtype.cc',
1729 'qtype.hh',
1730 'rcpgenerator.cc',
1731 'rcpgenerator.hh',
1732 'sillyrecords.cc',
1733 'statbag.cc',
1734 'statbag.hh',
1735 'svc-records.cc',
1736 'svc-records.hh',
1737 'unix_utility.cc',
1738 'utility.hh',
1739 'zoneparser-tng.cc',
1740 'zoneparser-tng.hh',
1741
1742 'standalone_fuzz_target_runner.cc',
1743 ],
1744 'deps': [
1745 deps,
1746 libpdns_dnslabeltext,
1747 ],
1748 },
1749 }
1750 endif
1751
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),
1757
1758 'tsigutils.cc': dep_gss_tsig.found(),
1759 'tsigutils.hh': dep_gss_tsig.found(),
1760
1761 'tsigverifier.cc': dep_gss_tsig.found(),
1762 'tsigverifier.hh': dep_gss_tsig.found(),
1763
1764 'ssqlite3.cc': get_variable('dep_sqlite3', dependency('', required: false)).found(),
1765 'ssqlite3.hh': get_variable('dep_sqlite3', dependency('', required: false)).found(),
1766
1767 'minicurl.cc': dep_lua_records.found() or dep_libcurl.found(),
1768 'minicurl.hh': dep_lua_records.found() or dep_libcurl.found(),
1769
1770 'ipcipher.cc': enable_ipcipher,
1771 'ipcipher.hh': enable_ipcipher,
1772
1773 'lua-base4.cc': dep_lua.found(),
1774 'lua-base4.hh': dep_lua.found(),
1775
1776 'lua-record.cc': dep_lua_records.found(),
1777
1778 'sodiumsigners.cc': dep_libsodium.found(),
1779
1780 'decafsigners.cc': dep_libdecaf.found(),
1781
1782 'pkcs11signers.cc': dep_pkcs11.found(),
1783 'pkcs11signers.hh': dep_pkcs11.found(),
1784
1785 'standalone_fuzz_target_runner.cc': get_option('fuzz-targets'),
1786 }
1787
1788 source_deps = {}
1789
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']
1794
1795 tool_sources = []
1796 tool_headers = []
1797
1798 foreach source: all_sources
1799 if source.endswith('.cc')
1800 # name = source.underscorify().replace('/', '__')
1801
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.
1806 source_deps += {
1807 source: declare_dependency(
1808 link_whole: static_library(
1809 'pdns-' + source.replace('/', '__'),
1810 sources: [source],
1811 dependencies: deps,
1812 )
1813 )
1814 }
1815 elif not conditional_sources[source]
1816 source_deps += {
1817 source: dependency('', required: false)
1818 }
1819 endif
1820 endif
1821
1822 tool_sources += source_deps[source]
1823 elif source.endswith('.hh')
1824 tool_headers += source
1825 else
1826 error('Unsupported extension for source file ' + source)
1827 endif
1828 endforeach
1829
1830 set_variable(
1831 'lib' + tool_name.underscorify(),
1832 declare_dependency(
1833 link_whole: static_library(
1834 tool_name,
1835 sources: [tool_main],
1836 extra_files: tool_headers,
1837 dependencies: tool_deps + tool_sources,
1838 )
1839 )
1840 )
1841 endforeach