]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/dnsdistdist/Makefile.am
rec: Drop remaining capabilities after startup
[thirdparty/pdns.git] / pdns / dnsdistdist / Makefile.am
CommitLineData
fdc3ea42 1AM_CPPFLAGS += $(SYSTEMD_CFLAGS) $(LUA_CFLAGS) $(LIBEDIT_CFLAGS) $(LIBSODIUM_CFLAGS) $(FSTRM_CFLAGS) $(YAHTTP_CFLAGS) $(SANITIZER_FLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) -DSYSCONFDIR=\"${sysconfdir}\"
50bed881 2
91487eb9
PL
3ACLOCAL_AMFLAGS = -I m4
4
f8204e9e 5SUBDIRS=ext/yahttp
bbfefc98 6
50169e30
CH
7CLEANFILES = \
8 dnsmessage.pb.cc \
9 dnsmessage.pb.h \
10 htmlfiles.h.tmp \
11 htmlfiles.h \
12 dnstap.pb.cc \
13 dnstap.pb.h
37a2da85 14
bbfefc98 15dnslabeltext.cc: dnslabeltext.rl
30bfe7f6 16 $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
4676400a 17
56872c22
PL
18BUILT_SOURCES=htmlfiles.h \
19 dnslabeltext.cc
a1f81e3b 20
38b86118
PL
21htmlfiles.h: $(srcdir)/html/*
22 $(AM_V_GEN)$(srcdir)/incfiles $(srcdir) > $@.tmp
23 @mv $@.tmp $@
bbfefc98 24
7cc65f8a
SH
25SRC_JS_FILES := $(wildcard src_js/*.js)
26MIN_JS_FILES := $(patsubst src_js/%.js,html/js/%.min.js,$(SRC_JS_FILES))
27
28html/js/%.min.js: src_js/%.js
29 uglifyjs $< > $@
30
31min_js: $(MIN_JS_FILES)
32
4ed8dfeb 33if HAVE_RE2
34AM_CPPFLAGS += $(RE2_CFLAGS)
35endif
36
a227f47d
RG
37if HAVE_DNS_OVER_TLS
38if HAVE_LIBSSL
39AM_CPPFLAGS += $(LIBSSL_CFLAGS)
40endif
41
42if HAVE_GNUTLS
43AM_CPPFLAGS += $(GNUTLS_CFLAGS)
44endif
45endif
4ed8dfeb 46
190aaf91
PL
47EXTRA_DIST=COPYING \
48 dnslabeltext.rl \
994c0ab3 49 dnsdistconf.lua \
59c83cf6 50 dnsmessage.proto \
82a91ddf 51 dnstap.proto \
994c0ab3 52 README.md \
25553371 53 delaypipe.cc delaypipe.hh \
994c0ab3 54 html \
b3bcfb63 55 contrib \
babc4bab
SH
56 ext/incbin/UNLICENSE \
57 incfiles \
6ab65223 58 src_js \
65613131 59 dnsdist.service.in \
d45189b7
RG
60 lua_hpp.mk \
61 bpf-filter.main.ebpf \
62 bpf-filter.qname.ebpf \
9f4eb5cc 63 bpf-filter.ebpf.src \
0e663c3b
RG
64 DNSDIST-MIB.txt \
65 devpollmplexer.cc \
66 epollmplexer.cc \
67 kqueuemplexer.cc \
8670e40d
PL
68 portsmplexer.cc \
69 builder-support/gen-version
bbfefc98 70
71bin_PROGRAMS = dnsdist
d2143283
PL
72
73if UNIT_TESTS
74noinst_PROGRAMS = testrunner
3c2ea9e5
RG
75TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
76TESTS=testrunner
77else
78check-local:
79 @echo "Unit tests are not enabled"
80 @echo "Run ./configure --enable-unit-tests"
ca404e94
RG
81endif
82
ca9836cb
PL
83dnsdist-web.$(OBJEXT): htmlfiles.h
84
bbfefc98 85dnsdist_SOURCES = \
6ee9a5a2 86 ascii.hh \
1489accc 87 base64.hh \
87b515ed 88 bpf-filter.cc bpf-filter.hh \
05f4003d 89 cachecleaner.hh \
77f8ae1a 90 dns.cc dns.hh \
11e1e08b 91 dnscrypt.cc dnscrypt.hh \
bbfefc98 92 dnsdist.cc dnsdist.hh \
87b515ed 93 dnsdist-dynbpf.cc dnsdist-dynbpf.hh \
886e2cf2 94 dnsdist-cache.cc dnsdist-cache.hh \
96b092a7 95 dnsdist-carbon.cc \
b5521206 96 dnsdist-console.cc dnsdist-console.hh \
11e1e08b 97 dnsdist-dnscrypt.cc \
dc2fd93a 98 dnsdist-dynblocks.hh \
ca404e94 99 dnsdist-ecs.cc dnsdist-ecs.hh \
cf48b0ce 100 dnsdist-lua.hh dnsdist-lua.cc \
6bb38cd6
RG
101 dnsdist-lua-actions.cc \
102 dnsdist-lua-bindings.cc \
103 dnsdist-lua-bindings-dnsquestion.cc \
104 dnsdist-lua-inspection.cc \
105 dnsdist-lua-rules.cc \
106 dnsdist-lua-vars.cc \
ec469dd7 107 dnsdist-protobuf.cc dnsdist-protobuf.hh \
03b00917 108 dnsdist-rings.cc dnsdist-rings.hh \
5f2e235c 109 dnsdist-rules.hh \
5d4e1ef8 110 dnsdist-secpoll.cc dnsdist-secpoll.hh \
9f4eb5cc 111 dnsdist-snmp.cc dnsdist-snmp.hh \
8a5d5053 112 dnsdist-tcp.cc \
50bed881 113 dnsdist-web.cc \
53c57da7 114 dnsdist-xpf.cc dnsdist-xpf.hh \
bbfefc98 115 dnslabeltext.cc \
116 dnsname.cc dnsname.hh \
ca404e94 117 dnsparser.hh dnsparser.cc \
bbfefc98 118 dnswriter.cc dnswriter.hh \
119 dolog.hh \
5c3b5e7f 120 ednsoptions.cc ednsoptions.hh \
ff73f02b 121 ednscookies.cc ednscookies.hh \
ca404e94 122 ednssubnet.cc ednssubnet.hh \
82a91ddf 123 fstrm_logger.cc fstrm_logger.hh \
85c7ca75 124 gettime.cc gettime.hh \
0e663c3b 125 htmlfiles.h \
bbfefc98 126 iputils.cc iputils.hh \
0e41337b 127 lock.hh \
bbfefc98 128 misc.cc misc.hh \
0e663c3b 129 mplexer.hh \
bbfefc98 130 namespaces.hh \
131 pdnsexception.hh \
d9d3f9c1 132 protobuf.cc protobuf.hh \
82a91ddf 133 dnstap.cc dnstap.hh \
bbfefc98 134 qtype.cc qtype.hh \
ec469dd7 135 remote_logger.cc remote_logger.hh \
926444e2 136 pollmplexer.cc \
ecbe9133 137 sholder.hh \
9f4eb5cc 138 snmp-agent.cc snmp-agent.hh \
bbfefc98 139 sodcrypto.cc sodcrypto.hh \
f8204e9e 140 sstuff.hh \
71c94675 141 statnode.cc statnode.hh \
a227f47d 142 tcpiohandler.cc tcpiohandler.hh \
519f5484 143 threadname.hh threadname.cc \
5cc8371b 144 xpf.cc xpf.hh \
f8204e9e
PL
145 ext/luawrapper/include/LuaContext.hpp \
146 ext/json11/json11.cpp \
147 ext/json11/json11.hpp \
87b515ed
RG
148 ext/incbin/incbin.h \
149 ext/libbpf/libbpf.h
bbfefc98 150
151dnsdist_LDFLAGS = \
152 $(AM_LDFLAGS) \
bfb7cc84 153 $(PROGRAM_LDFLAGS) \
50bed881 154 -pthread
bbfefc98 155
156dnsdist_LDADD = \
a6158e7a 157 $(LUA_LIBS) \
d9de8b61 158 $(LIBEDIT_LIBS) \
a6158e7a
RK
159 $(RT_LIBS) \
160 $(YAHTTP_LIBS) \
e85e4d88 161 $(LIBSODIUM_LIBS) \
82a91ddf 162 $(FSTRM_LIBS) \
6ab65223 163 $(SANITIZER_FLAGS) \
9f4eb5cc 164 $(SYSTEMD_LIBS) \
fdc3ea42
RG
165 $(NET_SNMP_LIBS) \
166 $(LIBCAP_LIBS)
bbfefc98 167
4ed8dfeb 168if HAVE_RE2
169dnsdist_LDADD += $(RE2_LIBS)
170endif
171
a227f47d
RG
172if HAVE_DNS_OVER_TLS
173if HAVE_GNUTLS
174dnsdist_LDADD += -lgnutls
175endif
176
177if HAVE_LIBSSL
178dnsdist_LDADD += $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS)
179endif
180endif
181
65613131
PL
182if !HAVE_LUA_HPP
183BUILT_SOURCES += lua.hpp
184nodist_dnsdist_SOURCES = lua.hpp
185CLEANFILES += lua.hpp
186endif
b2eccf5f 187
37a2da85
PL
188if HAVE_PROTOBUF
189if HAVE_PROTOC
b2eccf5f 190dnsmessage.pb.cc: dnsmessage.proto
38b86118 191 $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $<
b2eccf5f 192
82a91ddf
CH
193dnstap.pb.cc: dnstap.proto
194 $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $<
195
196BUILT_SOURCES += dnsmessage.pb.cc dnstap.pb.cc
37a2da85 197
82a91ddf 198nodist_dnsdist_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h dnstap.pb.cc dnstap.pb.h
d8c19b98 199dnsdist_LDADD += $(PROTOBUF_LIBS)
37a2da85 200
82a91ddf 201dnsdist.$(OBJEXT): dnsmessage.pb.cc dnstap.pb.cc
37a2da85 202endif
d8c19b98 203endif
ca404e94 204
0e663c3b
RG
205if HAVE_FREEBSD
206dnsdist_SOURCES += kqueuemplexer.cc
207endif
208
209if HAVE_LINUX
210dnsdist_SOURCES += epollmplexer.cc
211endif
212
213if HAVE_SOLARIS
214dnsdist_SOURCES += \
215 devpollmplexer.cc \
216 portsmplexer.cc
217endif
218
ca404e94 219testrunner_SOURCES = \
11e1e08b
RG
220 base64.hh \
221 dns.hh \
e27e17c3 222 test-base64_cc.cc \
94e4d723 223 test-delaypipe_hh.cc \
47698274 224 test-dnscrypt_cc.cc \
11e1e08b 225 test-dnsdist_cc.cc \
1d3ba133 226 test-dnsdistdynblocks_hh.cc \
886e2cf2 227 test-dnsdistpacketcache_cc.cc \
cfe4b655 228 test-dnsdistrings_cc.cc \
05f4003d 229 test-dnsdistrules_cc.cc \
47698274 230 test-dnsparser_cc.cc \
0047d734 231 test-iputils_hh.cc \
05f4003d 232 cachecleaner.hh \
11e1e08b 233 dnsdist.hh \
886e2cf2 234 dnsdist-cache.cc dnsdist-cache.hh \
ca404e94 235 dnsdist-ecs.cc dnsdist-ecs.hh \
53c57da7 236 dnsdist-xpf.cc dnsdist-xpf.hh \
11e1e08b 237 dnscrypt.cc dnscrypt.hh \
ca404e94
RG
238 dnslabeltext.cc \
239 dnsname.cc dnsname.hh \
240 dnsparser.hh dnsparser.cc \
241 dnswriter.cc dnswriter.hh \
242 dolog.hh \
5c3b5e7f 243 ednsoptions.cc ednsoptions.hh \
ff73f02b 244 ednscookies.cc ednscookies.hh \
ca404e94 245 ednssubnet.cc ednssubnet.hh \
85c7ca75 246 gettime.cc gettime.hh \
ca404e94
RG
247 iputils.cc iputils.hh \
248 misc.cc misc.hh \
249 namespaces.hh \
250 pdnsexception.hh \
251 qtype.cc qtype.hh \
252 sholder.hh \
e27e17c3 253 sodcrypto.cc \
ca404e94 254 sstuff.hh \
94e4d723 255 threadname.hh threadname.cc \
5cc8371b
RG
256 testrunner.cc \
257 xpf.cc xpf.hh
ca404e94
RG
258
259testrunner_LDFLAGS = \
260 $(AM_LDFLAGS) \
261 $(PROGRAM_LDFLAGS) \
262 $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
263 -pthread
264
265testrunner_LDADD = \
266 $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
11e1e08b 267 $(LIBSODIUM_LIBS) \
82a91ddf 268 $(FSTRM_LIBS) \
8d06661a 269 $(RT_LIBS) \
fdc3ea42
RG
270 $(SANITIZER_FLAGS) \
271 $(LIBCAP_LIBS)
ca404e94 272
f68a9074
PL
273MANPAGES=dnsdist.1
274
275dist_man_MANS=$(MANPAGES)
276
20d81666
PL
277if HAVE_VIRTUALENV
278if !HAVE_MANPAGES
279$(MANPAGES): %: docs/manpages/%.rst .venv
280 $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $<
281endif # if !HAVE_MANPAGES
282
283.venv: docs/requirements.txt
284 virtualenv .venv
29455e8a 285 .venv/bin/pip install -U pip setuptools setuptools-git
20d81666
PL
286 .venv/bin/pip install -r $<
287
288latex/dnsdist.pdf: docs/** .venv
289 .venv/bin/python -msphinx -M latexpdf docs .
290
291dnsdist.pdf: latex/dnsdist.pdf
292 mv $< $@
293
294html-docs.tar.bz2: html-docs
295 tar cjf $@ $<
296
297html-docs: docs/** .venv
298 .venv/bin/python -msphinx -b html docs html-docs
299
300all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf
301
302upload-docs: all-docs
60c95446
PL
303 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org
304 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org
305 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org
20d81666
PL
306
307else # if HAVE_VIRTUALENV
f68a9074 308$(MANPAGES):
20d81666
PL
309 @echo "You need virtualenv to generate the manpages"
310 exit 1
311
312html-docs: %: docs/manpages/%.rst .venv
313 @echo "You need virtualenv to generate the HTML documentation"
314 exit 1
315
316dnsdist.pdf:
317 @echo "You need virtualenv to generate the pdf documentation"
f68a9074 318 exit 1
f68a9074 319endif
6ab65223
PL
320
321if HAVE_SYSTEMD
322dnsdist.service: dnsdist.service.in
323 $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@
324
aa663221
PL
325dnsdist@.service: dnsdist.service
326 $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' < $< >$@
327
6ab65223
PL
328systemdsystemunitdir = $(SYSTEMD_DIR)
329
330systemdsystemunit_DATA = \
aa663221
PL
331 dnsdist.service \
332 dnsdist@.service
50169e30
CH
333
334CLEANFILES += \
335 dnsdist.service \
336 dnsdist@.service
6ab65223 337endif
65613131
PL
338
339if !HAVE_LUA_HPP
340include lua_hpp.mk
341endif