]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/recursordist/Makefile.am
Move UUID generators to a common function, fix boost 1.69.0 warning
[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 validate.cc validate.hh validate-recursor.cc validate-recursor.hh \
172 version.cc version.hh \
173 webserver.cc webserver.hh \
174 ws-api.cc ws-api.hh \
175 ws-recursor.cc ws-recursor.hh \
176 xpf.cc xpf.hh \
177 zoneparser-tng.cc zoneparser-tng.hh
178
179 if !HAVE_LUA_HPP
180 BUILT_SOURCES += lua.hpp
181 nodist_pdns_recursor_SOURCES = lua.hpp
182 CLEANFILES += lua.hpp
183 endif
184
185 pdns_recursor_LDADD = \
186 $(YAHTTP_LIBS) \
187 $(JSON11_LIBS) \
188 $(LIBCRYPTO_LIBS) \
189 $(BOOST_CONTEXT_LIBS) \
190 $(NET_SNMP_LIBS) \
191 $(SYSTEMD_LIBS) \
192 $(RT_LIBS) \
193 $(BOOST_SYSTEM_LIBS) \
194 $(PROBDS_LIBS) \
195 $(LIBCAP_LIBS)
196
197 pdns_recursor_LDFLAGS = $(AM_LDFLAGS) \
198 $(LIBCRYPTO_LDFLAGS) $(BOOST_CONTEXT_LDFLAGS) \
199 $(BOOST_SYSTEM_LDFLAGS)
200
201 if NOD_ENABLED
202 pdns_recursor_SOURCES += nod.hh nod.cc
203 pdns_recursor_LDADD += \
204 $(BOOST_FILESYSTEM_LIBS)
205 pdns_recursor_LDFLAGS += \
206 $(BOOST_FILESYSTEM_LDFLAGS)
207 endif
208
209 testrunner_SOURCES = \
210 arguments.cc \
211 base32.cc \
212 base64.cc base64.hh \
213 dns.cc dns.hh \
214 dns_random.cc dns_random.hh \
215 dnslabeltext.cc \
216 dnsname.cc dnsname.hh \
217 dnsparser.hh dnsparser.cc \
218 dnsrecords.cc \
219 dnssecinfra.cc \
220 dnsseckeeper.hh \
221 dnswriter.cc dnswriter.hh \
222 ednscookies.cc ednscookies.hh \
223 ednsoptions.cc ednsoptions.hh \
224 ednssubnet.cc ednssubnet.hh \
225 filterpo.cc filterpo.hh \
226 gettime.cc gettime.hh \
227 gss_context.cc gss_context.hh \
228 iputils.cc iputils.hh \
229 ixfr.cc ixfr.hh \
230 logger.cc logger.hh \
231 misc.cc misc.hh \
232 mtasker_context.cc \
233 negcache.hh negcache.cc \
234 namespaces.hh \
235 nsecrecords.cc \
236 pdnsexception.hh \
237 opensslsigners.cc opensslsigners.hh \
238 protobuf.cc protobuf.hh \
239 qtype.cc qtype.hh \
240 rcpgenerator.cc \
241 rec-protobuf.cc rec-protobuf.hh \
242 recpacketcache.cc recpacketcache.hh \
243 recursor_cache.cc recursor_cache.hh \
244 responsestats.cc \
245 root-dnssec.hh \
246 sillyrecords.cc \
247 sholder.hh \
248 sstuff.hh \
249 stable-bloom.hh \
250 syncres.cc syncres.hh \
251 test-arguments_cc.cc \
252 test-base32_cc.cc \
253 test-base64_cc.cc \
254 test-common.hh \
255 test-dnsrecordcontent.cc \
256 test-dns_random_hh.cc \
257 test-dnsname_cc.cc \
258 test-dnsparser_hh.cc \
259 test-dnsrecords_cc.cc \
260 test-ednsoptions_cc.cc \
261 test-filterpo_cc.cc \
262 test-iputils_hh.cc \
263 test-ixfr_cc.cc \
264 test-misc_hh.cc \
265 test-mtasker.cc \
266 test-negcache_cc.cc \
267 test-packetcache_hh.cc \
268 test-rcpgenerator_cc.cc \
269 test-recpacketcache_cc.cc \
270 test-recursorcache_cc.cc \
271 test-signers.cc \
272 test-syncres_cc.cc \
273 test-tsig.cc \
274 test-xpf_cc.cc \
275 testrunner.cc \
276 threadname.hh threadname.cc \
277 tsigverifier.cc tsigverifier.hh \
278 unix_utility.cc \
279 validate.cc validate.hh \
280 validate-recursor.cc validate-recursor.hh \
281 xpf.cc xpf.hh \
282 zoneparser-tng.cc zoneparser-tng.hh
283
284 testrunner_LDFLAGS = \
285 $(AM_LDFLAGS) \
286 $(BOOST_CONTEXT_LDFLAGS) \
287 $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
288 $(LIBCRYPTO_LDFLAGS) \
289 $(BOOST_SYSTEM_LDFLAGS)
290
291 testrunner_LDADD = \
292 $(BOOST_CONTEXT_LIBS) \
293 $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
294 $(LIBCRYPTO_LIBS) \
295 $(RT_LIBS) \
296 $(BOOST_SYSTEM_LIBS) \
297 $(PROBDS_LIBS) \
298 $(LIBCAP_LIBS)
299
300 if NOD_ENABLED
301 testrunner_SOURCES += nod.hh nod.cc \
302 test-nod_cc.cc
303
304 testrunner_LDADD += \
305 $(BOOST_FILESYSTEM_LIBS)
306 testrunner_LDFLAGS += \
307 $(BOOST_FILESYSTEM_LDFLAGS)
308 endif
309
310 if LIBSODIUM
311 pdns_recursor_SOURCES += \
312 sodiumsigners.cc
313 pdns_recursor_LDADD += $(LIBSODIUM_LIBS)
314 testrunner_SOURCES += \
315 sodiumsigners.cc
316 testrunner_LDADD += $(LIBSODIUM_LIBS)
317 endif
318
319 if LIBDECAF
320 pdns_recursor_SOURCES += \
321 decafsigners.cc
322 pdns_recursor_LDADD += $(LIBDECAF_LIBS)
323 endif
324
325 if MALLOC_TRACE
326 pdns_recursor_SOURCES += \
327 malloctrace.cc \
328 malloctrace.hh
329 pdns_recursor_LDFLAGS += -rdynamic
330 endif
331
332 if LUA
333 pdns_recursor_LDADD += $(LUA_LIBS)
334 endif
335
336 if HAVE_FREEBSD
337 pdns_recursor_SOURCES += kqueuemplexer.cc
338 endif
339
340 if HAVE_LINUX
341 pdns_recursor_SOURCES += epollmplexer.cc
342 endif
343
344 if HAVE_SOLARIS
345 pdns_recursor_SOURCES += \
346 devpollmplexer.cc \
347 portsmplexer.cc
348 endif
349
350 if HAVE_PROTOBUF
351 if HAVE_PROTOC
352 dnsmessage.pb.cc: dnsmessage.proto
353 $(AM_V_GEN)$(PROTOC) --cpp_out=./ $<
354
355 BUILT_SOURCES += dnsmessage.pb.cc
356 pdns_recursor_LDADD += $(PROTOBUF_LIBS)
357 nodist_pdns_recursor_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
358 pdns_recursor.$(OBJEXT): dnsmessage.pb.cc
359
360 nodist_testrunner_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
361 testrunner_LDADD += $(PROTOBUF_LIBS)
362 testrunner$(OBJEXT): dnsmessage.pb.cc
363
364 endif
365
366 pdns_recursor_SOURCES += \
367 uuid-utils.hh uuid-utils.cc
368
369 endif
370
371 rec_control_SOURCES = \
372 arguments.cc arguments.hh \
373 dnsname.hh dnsname.cc \
374 dnslabeltext.cc \
375 logger.cc \
376 misc.cc \
377 qtype.cc \
378 rec_channel.cc rec_channel.hh \
379 rec_control.cc \
380 unix_utility.cc
381
382 dnslabeltext.cc: dnslabeltext.rl
383 $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
384
385 curl_verbose = $(curl_verbose_$(V))
386 curl_verbose_ = $(curl_verbose_$(AM_DEFAULT_VERBOSITY))
387 curl_verbose_0 = @echo " CURL " $@;
388 $(srcdir)/effective_tld_names.dat:
389 $(curl_verbose)if ! curl -s -S https://publicsuffix.org/list/public_suffix_list.dat > $@; then rm -f $@; exit 1; fi
390
391 pubsuffix.cc: $(srcdir)/effective_tld_names.dat
392 $(AM_V_GEN)./mkpubsuffixcc
393
394 ## Config file
395 sysconf_DATA = recursor.conf-dist
396
397 recursor.conf-dist: pdns_recursor
398 $(AM_V_GEN)./pdns_recursor --config > $@
399
400 ## Manpages
401 MANPAGES=pdns_recursor.1 \
402 rec_control.1
403
404 dist_man_MANS=$(MANPAGES)
405
406 if HAVE_VIRTUALENV
407 if !HAVE_MANPAGES
408 $(MANPAGES): %: docs/manpages/%.rst .venv
409 .venv/bin/python -msphinx -b man docs . $<
410 endif # if !HAVE_MANPAGES
411
412 .venv: docs/requirements.txt
413 virtualenv .venv
414 .venv/bin/pip install -U pip setuptools setuptools-git
415 .venv/bin/pip install -r docs/requirements.txt
416
417 html-docs: docs/** .venv
418 .venv/bin/python -msphinx -b html docs html-docs
419
420 latex/PowerDNS-Recursor.pdf: docs/** .venv
421 .venv/bin/python -msphinx -M latexpdf docs .
422
423 PowerDNS-Recursor.pdf: latex/PowerDNS-Recursor.pdf
424 mv $< $@
425
426 html-docs.tar.bz2: html-docs
427 tar cjf $@ $<
428
429 all-docs: PowerDNS-Recursor.pdf html-docs html-docs.tar.bz2
430
431 upload-docs: all-docs
432 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
433 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
434 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./PowerDNS-Recursor.pdf web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
435
436 else # if HAVE_VIRTUALENV
437 $(MANPAGES):
438 echo "You need virtualenv to generate the manpages"
439 exit 1
440
441 PowerDNS-Recursor.pdf:
442 echo "You need virtualenv to generate the PDF"
443 exit 1
444
445 html-docs:
446 echo "You need virtualenv to generate the HTML docs"
447 exit 1
448 endif
449
450 if HAVE_SYSTEMD
451 pdns-recursor.service: pdns-recursor.service.in
452 $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' < $< > $@
453
454 pdns-recursor@.service: pdns-recursor.service
455 $(AM_V_GEN)sed -e 's!/pdns_recursor!& --config-name=%i!' \
456 -e 's!Recursor!& %i!' \
457 < $< > $@
458
459 systemdsystemunitdir = $(SYSTEMD_DIR)
460
461 systemdsystemunit_DATA = \
462 pdns-recursor.service \
463 pdns-recursor@.service
464
465 CLEANFILES += \
466 pdns-recursor.service \
467 pdns-recursor@.service
468
469 endif
470
471 if !HAVE_LUA_HPP
472 include lua_hpp.mk
473 endif