]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/recursordist/Makefile.am
Merge pull request #8946 from omoerbeek/rec-buildbot-test
[thirdparty/pdns.git] / pdns / recursordist / Makefile.am
1 JSON11_LIBS = $(top_srcdir)/ext/json11/libjson11.la
2 PROBDS_LIBS = $(top_srcdir)/ext/probds/libprobds.la
3
4 AM_CPPFLAGS = $(LUA_CFLAGS) $(YAHTTP_CFLAGS) $(BOOST_CPPFLAGS) $(LIBSODIUM_CFLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) $(SANITIZER_FLAGS) -O3 -Wall -pthread -DSYSCONFDIR=\"${sysconfdir}\" $(SYSTEMD_CFLAGS)
5
6 AM_CPPFLAGS += \
7 -I$(top_srcdir)/ext/json11 \
8 $(YAHTTP_CFLAGS) \
9 $(LIBCRYPTO_INCLUDES)
10
11 AM_CXXFLAGS = \
12 -DSYSCONFDIR=\"$(sysconfdir)\" \
13 -DPKGLIBDIR=\"$(pkglibdir)\" \
14 -DLOCALSTATEDIR=\"$(socketdir)\"
15
16 if NOD_ENABLED
17 AM_CXXFLAGS += \
18 -DNODCACHEDIR=\"$(nodcachedir)\"
19 endif
20
21 if FSTRM
22 AM_CPPFLAGS += \
23 $(FSTRM_CFLAGS)
24 endif
25
26 AM_LDFLAGS = \
27 $(PROGRAM_LDFLAGS) \
28 $(THREADFLAGS)
29
30 ACLOCAL_AMFLAGS = -I m4
31
32 BUILT_SOURCES=htmlfiles.h \
33 dnslabeltext.cc
34
35 CLEANFILES = htmlfiles.h \
36 dnsmessage.pb.cc \
37 dnsmessage.pb.h \
38 dnstap.pb.cc \
39 dnstap.pb.h \
40 recursor.conf-dist
41
42 htmlfiles.h: html/*
43 ./incfiles > $@
44
45 SUBDIRS=ext
46
47 if LUA
48 AM_CPPFLAGS +=$(LUA_CFLAGS)
49 endif
50
51 EXTRA_DIST = \
52 contrib/* \
53 COPYING \
54 devpollmplexer.cc \
55 dnslabeltext.cc \
56 dnslabeltext.rl \
57 dnsmessage.proto \
58 effective_tld_names.dat \
59 epollmplexer.cc \
60 kqueuemplexer.cc \
61 lua_hpp.mk \
62 malloctrace.cc malloctrace.hh \
63 mkpubsuffixcc \
64 mtasker.cc \
65 mtasker_fcontext.cc mtasker_ucontext.cc \
66 NOTICE \
67 opensslsigners.hh opensslsigners.cc \
68 portsmplexer.cc \
69 dnstap.proto dnstap.cc dnstap.hh fstrm_logger.cc fstrm_logger.hh rec-dnstap.hh \
70 rrd/* \
71 html incfiles \
72 test_libcrypto \
73 pdns-recursor.service.in \
74 RECURSOR-MIB.txt \
75 builder-support/gen-version
76
77 dist-hook:
78 for file in $$(find $(distdir)/docs -type l); do \
79 t=`stat -c%N $$file | awk '{print $$NF}' | sed "s/'//g"` ; \
80 ln -fs ../$$t $$file; \
81 done
82
83 sbin_PROGRAMS = pdns_recursor
84 bin_PROGRAMS = rec_control
85
86 TESTS=test_libcrypto
87
88 if UNIT_TESTS
89 noinst_PROGRAMS = testrunner
90 TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
91 TESTS += testrunner
92 else
93 check-local:
94 @echo "Unit tests are not enabled"
95 @echo "Run ./configure --enable-unit-tests"
96 endif
97
98 pdns_recursor_SOURCES = \
99 arguments.cc \
100 ascii.hh \
101 base32.cc base32.hh \
102 base64.cc base64.hh \
103 cachecleaner.hh \
104 capabilities.cc capabilities.hh \
105 circular_buffer.hh \
106 comment.hh \
107 dns.hh dns.cc \
108 dns_random.hh dns_random.cc \
109 dnsbackend.hh \
110 dnslabeltext.cc \
111 dnsname.cc dnsname.hh \
112 dnspacket.hh \
113 dnsparser.hh dnsparser.cc \
114 dnsrecords.cc dnsrecords.hh \
115 dnssecinfra.hh dnssecinfra.cc \
116 dnsseckeeper.hh \
117 dnswriter.cc dnswriter.hh \
118 ednsoptions.cc ednsoptions.hh \
119 ednssubnet.cc ednssubnet.hh \
120 filterpo.cc filterpo.hh \
121 fstrm_logger.cc fstrm_logger.hh \
122 gettime.cc gettime.hh \
123 gss_context.cc gss_context.hh \
124 iputils.hh iputils.cc \
125 ixfr.cc ixfr.hh \
126 json.cc json.hh \
127 lazy_allocator.hh \
128 lock.hh \
129 logger.hh logger.cc \
130 lua-base4.cc lua-base4.hh \
131 lua-recursor4.cc lua-recursor4.hh \
132 lua-recursor4-ffi.hh \
133 lwres.cc lwres.hh \
134 misc.hh misc.cc \
135 mplexer.hh \
136 mtasker.hh \
137 mtasker_context.cc mtasker_context.hh \
138 namespaces.hh \
139 negcache.hh negcache.cc \
140 nsecrecords.cc \
141 opensslsigners.cc opensslsigners.hh \
142 packetcache.hh \
143 pdns_recursor.cc \
144 pdnsexception.hh \
145 pollmplexer.cc \
146 protobuf.cc protobuf.hh \
147 proxy-protocol.cc proxy-protocol.hh \
148 pubsuffix.hh pubsuffix.cc \
149 pubsuffixloader.cc \
150 qtype.hh qtype.cc \
151 rcpgenerator.cc rcpgenerator.hh \
152 rec-carbon.cc \
153 rec-lua-conf.hh rec-lua-conf.cc \
154 rec-protobuf.cc rec-protobuf.hh \
155 rec-snmp.hh rec-snmp.cc \
156 rec_channel.cc rec_channel.hh rec_metrics.hh \
157 rec_channel_rec.cc \
158 recpacketcache.cc recpacketcache.hh \
159 recursor_cache.cc recursor_cache.hh \
160 reczones.cc \
161 remote_logger.cc remote_logger.hh \
162 resolver.hh resolver.cc \
163 resolve-context.hh \
164 responsestats.hh responsestats.cc \
165 root-addresses.hh \
166 root-dnssec.hh \
167 rpzloader.cc rpzloader.hh \
168 secpoll-recursor.cc secpoll-recursor.hh \
169 secpoll.cc secpoll.hh \
170 sholder.hh \
171 sillyrecords.cc \
172 snmp-agent.hh snmp-agent.cc \
173 sortlist.cc sortlist.hh \
174 sstuff.hh \
175 stable-bloom.hh \
176 syncres.cc syncres.hh \
177 threadname.hh threadname.cc \
178 tsigverifier.cc tsigverifier.hh \
179 ueberbackend.hh \
180 unix_utility.cc \
181 utility.hh \
182 uuid-utils.hh uuid-utils.cc \
183 validate.cc validate.hh validate-recursor.cc validate-recursor.hh \
184 version.cc version.hh \
185 webserver.cc webserver.hh \
186 ws-api.cc ws-api.hh \
187 ws-recursor.cc ws-recursor.hh \
188 xpf.cc xpf.hh \
189 zoneparser-tng.cc zoneparser-tng.hh
190
191 if !HAVE_LUA_HPP
192 BUILT_SOURCES += lua.hpp
193 nodist_pdns_recursor_SOURCES = lua.hpp
194 endif
195
196 CLEANFILES += lua.hpp
197
198 pdns_recursor_LDADD = \
199 $(YAHTTP_LIBS) \
200 $(JSON11_LIBS) \
201 $(LIBCRYPTO_LIBS) \
202 $(BOOST_CONTEXT_LIBS) \
203 $(NET_SNMP_LIBS) \
204 $(SYSTEMD_LIBS) \
205 $(RT_LIBS) \
206 $(BOOST_SYSTEM_LIBS) \
207 $(PROBDS_LIBS) \
208 $(LIBCAP_LIBS)
209
210 pdns_recursor_LDFLAGS = $(AM_LDFLAGS) \
211 $(LIBCRYPTO_LDFLAGS) $(BOOST_CONTEXT_LDFLAGS) \
212 $(BOOST_SYSTEM_LDFLAGS)
213
214 if NOD_ENABLED
215 pdns_recursor_SOURCES += nod.hh nod.cc
216 pdns_recursor_LDADD += \
217 $(BOOST_FILESYSTEM_LIBS)
218 pdns_recursor_LDFLAGS += \
219 $(BOOST_FILESYSTEM_LDFLAGS)
220 endif
221
222 testrunner_SOURCES = \
223 arguments.cc \
224 base32.cc \
225 base64.cc base64.hh \
226 circular_buffer.hh \
227 dns.cc dns.hh \
228 dns_random.cc dns_random.hh \
229 dnslabeltext.cc \
230 dnsname.cc dnsname.hh \
231 dnsparser.hh dnsparser.cc \
232 dnsrecords.cc \
233 dnssecinfra.cc \
234 dnsseckeeper.hh \
235 dnswriter.cc dnswriter.hh \
236 ednscookies.cc ednscookies.hh \
237 ednsoptions.cc ednsoptions.hh \
238 ednssubnet.cc ednssubnet.hh \
239 filterpo.cc filterpo.hh \
240 gettime.cc gettime.hh \
241 gss_context.cc gss_context.hh \
242 iputils.cc iputils.hh \
243 ixfr.cc ixfr.hh \
244 logger.cc logger.hh \
245 misc.cc misc.hh \
246 mtasker_context.cc \
247 negcache.hh negcache.cc \
248 namespaces.hh \
249 nsecrecords.cc \
250 pdnsexception.hh \
251 opensslsigners.cc opensslsigners.hh \
252 pollmplexer.cc \
253 protobuf.cc protobuf.hh \
254 qtype.cc qtype.hh \
255 rcpgenerator.cc \
256 rec-protobuf.cc rec-protobuf.hh \
257 recpacketcache.cc recpacketcache.hh \
258 recursor_cache.cc recursor_cache.hh \
259 responsestats.cc \
260 rpzloader.cc rpzloader.hh \
261 resolver.hh resolver.cc \
262 root-dnssec.hh \
263 secpoll.cc \
264 sillyrecords.cc \
265 sholder.hh \
266 sstuff.hh \
267 stable-bloom.hh \
268 syncres.cc syncres.hh \
269 test-arguments_cc.cc \
270 test-base32_cc.cc \
271 test-base64_cc.cc \
272 test-common.hh \
273 test-dnsrecordcontent.cc \
274 test-dns_random_hh.cc \
275 test-dnsname_cc.cc \
276 test-dnsparser_hh.cc \
277 test-dnsrecords_cc.cc \
278 test-ednsoptions_cc.cc \
279 test-filterpo_cc.cc \
280 test-iputils_hh.cc \
281 test-ixfr_cc.cc \
282 test-misc_hh.cc \
283 test-mtasker.cc \
284 test-mplexer.cc \
285 test-negcache_cc.cc \
286 test-packetcache_hh.cc \
287 test-rcpgenerator_cc.cc \
288 test-recpacketcache_cc.cc \
289 test-recursorcache_cc.cc \
290 test-rpzloader_cc.cc \
291 test-secpoll_cc.cc \
292 test-signers.cc \
293 test-syncres_cc.hh \
294 test-syncres_cc.cc \
295 test-syncres_cc1.cc \
296 test-syncres_cc2.cc \
297 test-syncres_cc3.cc \
298 test-syncres_cc4.cc \
299 test-syncres_cc5.cc \
300 test-syncres_cc6.cc \
301 test-syncres_cc7.cc \
302 test-syncres_cc8.cc \
303 test-syncres_cc9.cc \
304 test-tsig.cc \
305 test-xpf_cc.cc \
306 testrunner.cc \
307 threadname.hh threadname.cc \
308 tsigverifier.cc tsigverifier.hh \
309 unix_utility.cc \
310 validate.cc validate.hh \
311 validate-recursor.cc validate-recursor.hh \
312 xpf.cc xpf.hh \
313 zoneparser-tng.cc zoneparser-tng.hh
314
315 testrunner_LDFLAGS = \
316 $(AM_LDFLAGS) \
317 $(BOOST_CONTEXT_LDFLAGS) \
318 $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
319 $(LIBCRYPTO_LDFLAGS) \
320 $(BOOST_SYSTEM_LDFLAGS)
321
322 testrunner_LDADD = \
323 $(BOOST_CONTEXT_LIBS) \
324 $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
325 $(LIBCRYPTO_LIBS) \
326 $(RT_LIBS) \
327 $(BOOST_SYSTEM_LIBS) \
328 $(PROBDS_LIBS) \
329 $(LIBCAP_LIBS)
330
331 if NOD_ENABLED
332 testrunner_SOURCES += nod.hh nod.cc \
333 test-nod_cc.cc
334
335 testrunner_LDADD += \
336 $(BOOST_FILESYSTEM_LIBS)
337 testrunner_LDFLAGS += \
338 $(BOOST_FILESYSTEM_LDFLAGS)
339 endif
340
341 if LIBSODIUM
342 pdns_recursor_SOURCES += \
343 sodiumsigners.cc
344 pdns_recursor_LDADD += $(LIBSODIUM_LIBS)
345 testrunner_SOURCES += \
346 sodiumsigners.cc
347 testrunner_LDADD += $(LIBSODIUM_LIBS)
348 endif
349
350 if LIBDECAF
351 pdns_recursor_SOURCES += \
352 decafsigners.cc
353 pdns_recursor_LDADD += $(LIBDECAF_LIBS)
354 endif
355
356 if MALLOC_TRACE
357 pdns_recursor_SOURCES += \
358 malloctrace.cc \
359 malloctrace.hh
360 pdns_recursor_LDFLAGS += -rdynamic
361 endif
362
363 if LUA
364 pdns_recursor_LDADD += $(LUA_LIBS)
365 endif
366
367 if HAVE_FREEBSD
368 pdns_recursor_SOURCES += kqueuemplexer.cc
369 testrunner_SOURCES += kqueuemplexer.cc
370 endif
371
372 if HAVE_LINUX
373 pdns_recursor_SOURCES += epollmplexer.cc
374 testrunner_SOURCES += epollmplexer.cc
375 endif
376
377 if HAVE_SOLARIS
378 pdns_recursor_SOURCES += \
379 devpollmplexer.cc \
380 portsmplexer.cc
381 testrunner_SOURCES += \
382 devpollmplexer.cc \
383 portsmplexer.cc
384 endif
385
386 if HAVE_PROTOBUF
387 if HAVE_PROTOC
388 dnsmessage.pb.cc: dnsmessage.proto
389 $(AM_V_GEN)$(PROTOC) --cpp_out=./ $<
390
391 if FSTRM
392 dnstap.pb.cc: dnstap.proto
393 $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $<
394 endif
395
396
397 BUILT_SOURCES += dnsmessage.pb.cc
398 pdns_recursor_LDADD += $(PROTOBUF_LIBS)
399 nodist_pdns_recursor_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
400 nodist_testrunner_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
401
402 if FSTRM
403 BUILT_SOURCES += dnstap.pb.cc
404 pdns_recursor.$(OBJEXT): dnstap.pb.cc dnsmessage.pb.cc
405 testrunner$(OBJEXT): dnstap.pb.cc dnsmessage.pb.cc
406 nodist_pdns_recursor_SOURCES += dnstap.pb.cc dnstap.pb.h
407 nodist_testrunner_SOURCES += dnstap.pb.cc dnstap.pb.h
408 else
409 pdns_recursor.$(OBJEXT): dnsmessage.pb.cc
410 testrunner$(OBJEXT): dnsmessage.pb.cc
411 endif
412
413 testrunner_LDADD += $(PROTOBUF_LIBS)
414
415 endif
416 endif
417
418 if FSTRM
419 pdns_recursor_SOURCES += \
420 dnstap.cc dnstap.hh rec-dnstap.hh
421
422 pdns_recursor_LDADD += \
423 $(FSTRM_LIBS)
424 endif
425
426 rec_control_SOURCES = \
427 arguments.cc arguments.hh \
428 dnsname.hh dnsname.cc \
429 dnslabeltext.cc \
430 logger.cc \
431 misc.cc \
432 qtype.cc \
433 rec_channel.cc rec_channel.hh \
434 rec_control.cc \
435 unix_utility.cc
436
437 dnslabeltext.cc: dnslabeltext.rl
438 $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
439
440 curl_verbose = $(curl_verbose_$(V))
441 curl_verbose_ = $(curl_verbose_$(AM_DEFAULT_VERBOSITY))
442 curl_verbose_0 = @echo " CURL " $@;
443 $(srcdir)/effective_tld_names.dat:
444 $(curl_verbose)if ! curl -s -S https://publicsuffix.org/list/public_suffix_list.dat > $@; then rm -f $@; exit 1; fi
445
446 pubsuffix.cc: $(srcdir)/effective_tld_names.dat
447 $(AM_V_GEN)./mkpubsuffixcc
448
449 ## Config file
450 sysconf_DATA = recursor.conf-dist
451
452 recursor.conf-dist: pdns_recursor
453 $(AM_V_GEN)./pdns_recursor --config > $@
454
455 ## Manpages
456 MANPAGES=pdns_recursor.1 \
457 rec_control.1
458
459 dist_man_MANS=$(MANPAGES)
460
461 if HAVE_VIRTUALENV
462 if !HAVE_MANPAGES
463 $(MANPAGES): %: docs/manpages/%.rst .venv
464 .venv/bin/python -msphinx -b man docs . $<
465 endif # if !HAVE_MANPAGES
466
467 .venv: docs/requirements.txt
468 virtualenv .venv
469 .venv/bin/pip install -U pip setuptools setuptools-git
470 .venv/bin/pip install -r docs/requirements.txt
471
472 html-docs: docs/** .venv
473 .venv/bin/python -msphinx -b html docs html-docs
474
475 latex/PowerDNS-Recursor.pdf: docs/** .venv
476 .venv/bin/python -msphinx -M latexpdf docs .
477
478 PowerDNS-Recursor.pdf: latex/PowerDNS-Recursor.pdf
479 mv $< $@
480
481 html-docs.tar.bz2: html-docs
482 tar cjf $@ $<
483
484 all-docs: PowerDNS-Recursor.pdf html-docs html-docs.tar.bz2
485
486 upload-docs: all-docs
487 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
488 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
489 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./PowerDNS-Recursor.pdf web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
490
491 else # if HAVE_VIRTUALENV
492 $(MANPAGES):
493 echo "You need virtualenv to generate the manpages"
494 exit 1
495
496 PowerDNS-Recursor.pdf:
497 echo "You need virtualenv to generate the PDF"
498 exit 1
499
500 html-docs:
501 echo "You need virtualenv to generate the HTML docs"
502 exit 1
503 endif
504
505 if HAVE_SYSTEMD
506 pdns-recursor.service: pdns-recursor.service.in
507 $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' -e 's![@]service_user[@]!$(service_user)!' -e 's![@]service_group[@]!$(service_group)!' < $< > $@
508 if !HAVE_SYSTEMD_LOCK_PERSONALITY
509 $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@
510 endif
511 if !HAVE_SYSTEMD_PRIVATE_DEVICES
512 $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@
513 endif
514 if !HAVE_SYSTEMD_PRIVATE_TMP
515 $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@
516 endif
517 if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS
518 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@
519 endif
520 if !HAVE_SYSTEMD_PROTECT_HOME
521 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@
522 endif
523 if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES
524 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@
525 endif
526 if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES
527 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@
528 endif
529 if !HAVE_SYSTEMD_PROTECT_SYSTEM
530 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@
531 endif
532 if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES
533 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@
534 endif
535 if !HAVE_SYSTEMD_RESTRICT_NAMESPACES
536 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@
537 endif
538 if !HAVE_SYSTEMD_RESTRICT_REALTIME
539 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@
540 endif
541 if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES
542 $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@
543 endif
544 if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER
545 $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@
546 endif
547
548 pdns-recursor@.service: pdns-recursor.service
549 $(AM_V_GEN)sed -e 's!/pdns_recursor!& --config-name=%i!' \
550 -e 's!Recursor!& %i!' \
551 < $< > $@
552
553 systemdsystemunitdir = $(SYSTEMD_DIR)
554
555 systemdsystemunit_DATA = \
556 pdns-recursor.service \
557 pdns-recursor@.service
558
559 CLEANFILES += \
560 pdns-recursor.service \
561 pdns-recursor@.service
562
563 endif
564
565 if !HAVE_LUA_HPP
566 include lua_hpp.mk
567 endif