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