]>
Commit | Line | Data |
---|---|---|
1 | AM_CPPFLAGS += $(SYSTEMD_CFLAGS) $(LUA_CFLAGS) $(LIBEDIT_CFLAGS) $(LIBSODIUM_CFLAGS) $(FSTRM_CFLAGS) $(YAHTTP_CFLAGS) $(SANITIZER_FLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) -DSYSCONFDIR=\"${sysconfdir}\" | |
2 | ||
3 | ACLOCAL_AMFLAGS = -I m4 | |
4 | ||
5 | SUBDIRS=ext/ipcrypt \ | |
6 | ext/yahttp | |
7 | ||
8 | CLEANFILES = \ | |
9 | dnsmessage.pb.cc \ | |
10 | dnsmessage.pb.h \ | |
11 | htmlfiles.h.tmp \ | |
12 | htmlfiles.h \ | |
13 | dnstap.pb.cc \ | |
14 | dnstap.pb.h | |
15 | ||
16 | dnslabeltext.cc: dnslabeltext.rl | |
17 | $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc | |
18 | ||
19 | BUILT_SOURCES=htmlfiles.h \ | |
20 | dnslabeltext.cc | |
21 | ||
22 | htmlfiles.h: $(srcdir)/html/* | |
23 | $(AM_V_GEN)$(srcdir)/incfiles $(srcdir) > $@.tmp | |
24 | @mv $@.tmp $@ | |
25 | ||
26 | SRC_JS_FILES := $(wildcard src_js/*.js) | |
27 | MIN_JS_FILES := $(patsubst src_js/%.js,html/js/%.min.js,$(SRC_JS_FILES)) | |
28 | ||
29 | html/js/%.min.js: src_js/%.js | |
30 | uglifyjs $< > $@ | |
31 | ||
32 | min_js: $(MIN_JS_FILES) | |
33 | ||
34 | if HAVE_RE2 | |
35 | AM_CPPFLAGS += $(RE2_CFLAGS) | |
36 | endif | |
37 | ||
38 | if HAVE_DNS_OVER_TLS | |
39 | if HAVE_LIBSSL | |
40 | AM_CPPFLAGS += $(LIBSSL_CFLAGS) | |
41 | endif | |
42 | ||
43 | if HAVE_GNUTLS | |
44 | AM_CPPFLAGS += $(GNUTLS_CFLAGS) | |
45 | endif | |
46 | endif | |
47 | ||
48 | if HAVE_LIBCRYPTO | |
49 | AM_CPPFLAGS += $(LIBCRYPTO_INCLUDES) | |
50 | endif | |
51 | ||
52 | if HAVE_LMDB | |
53 | AM_CPPFLAGS += $(LMDB_CFLAGS) | |
54 | endif | |
55 | ||
56 | if HAVE_DNS_OVER_HTTPS | |
57 | if HAVE_LIBSSL | |
58 | AM_CPPFLAGS += $(LIBSSL_CFLAGS) | |
59 | endif | |
60 | ||
61 | if HAVE_LIBH2OEVLOOP | |
62 | AM_CPPFLAGS += $(LIBH2OEVLOOP_CFLAGS) | |
63 | endif | |
64 | endif | |
65 | ||
66 | EXTRA_DIST=COPYING \ | |
67 | dnslabeltext.rl \ | |
68 | dnsdistconf.lua \ | |
69 | dnsmessage.proto \ | |
70 | dnstap.proto \ | |
71 | README.md \ | |
72 | delaypipe.cc delaypipe.hh \ | |
73 | html \ | |
74 | contrib \ | |
75 | ext/incbin/UNLICENSE \ | |
76 | incfiles \ | |
77 | src_js \ | |
78 | dnsdist.service.in \ | |
79 | lua_hpp.mk \ | |
80 | bpf-filter.main.ebpf \ | |
81 | bpf-filter.qname.ebpf \ | |
82 | bpf-filter.ebpf.src \ | |
83 | DNSDIST-MIB.txt \ | |
84 | devpollmplexer.cc \ | |
85 | epollmplexer.cc \ | |
86 | kqueuemplexer.cc \ | |
87 | portsmplexer.cc \ | |
88 | builder-support/gen-version | |
89 | ||
90 | bin_PROGRAMS = dnsdist | |
91 | ||
92 | if UNIT_TESTS | |
93 | noinst_PROGRAMS = testrunner | |
94 | TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)' | |
95 | TESTS=testrunner | |
96 | else | |
97 | check-local: | |
98 | @echo "Unit tests are not enabled" | |
99 | @echo "Run ./configure --enable-unit-tests" | |
100 | endif | |
101 | ||
102 | dnsdist-web.$(OBJEXT): htmlfiles.h | |
103 | ||
104 | dnsdist_SOURCES = \ | |
105 | ascii.hh \ | |
106 | base64.hh \ | |
107 | bpf-filter.cc bpf-filter.hh \ | |
108 | cachecleaner.hh \ | |
109 | capabilities.cc capabilities.hh \ | |
110 | circular_buffer.hh \ | |
111 | dns.cc dns.hh \ | |
112 | dnscrypt.cc dnscrypt.hh \ | |
113 | dnsdist.cc dnsdist.hh \ | |
114 | dnsdist-dynbpf.cc dnsdist-dynbpf.hh \ | |
115 | dnsdist-cache.cc dnsdist-cache.hh \ | |
116 | dnsdist-carbon.cc \ | |
117 | dnsdist-console.cc dnsdist-console.hh \ | |
118 | dnsdist-dnscrypt.cc \ | |
119 | dnsdist-dynblocks.hh \ | |
120 | dnsdist-ecs.cc dnsdist-ecs.hh \ | |
121 | dnsdist-idstate.cc \ | |
122 | dnsdist-kvs.hh dnsdist-kvs.cc \ | |
123 | dnsdist-lua.hh dnsdist-lua.cc \ | |
124 | dnsdist-lua-actions.cc \ | |
125 | dnsdist-lua-bindings.cc \ | |
126 | dnsdist-lua-bindings-dnsquestion.cc \ | |
127 | dnsdist-lua-inspection.cc \ | |
128 | dnsdist-lua-inspection-ffi.cc dnsdist-lua-inspection-ffi.hh \ | |
129 | dnsdist-lua-rules.cc \ | |
130 | dnsdist-lua-vars.cc \ | |
131 | dnsdist-protobuf.cc dnsdist-protobuf.hh \ | |
132 | dnsdist-rings.cc dnsdist-rings.hh \ | |
133 | dnsdist-rules.hh \ | |
134 | dnsdist-secpoll.cc dnsdist-secpoll.hh \ | |
135 | dnsdist-snmp.cc dnsdist-snmp.hh \ | |
136 | dnsdist-tcp.cc \ | |
137 | dnsdist-web.cc \ | |
138 | dnsdist-xpf.cc dnsdist-xpf.hh \ | |
139 | dnslabeltext.cc \ | |
140 | dnsname.cc dnsname.hh \ | |
141 | dnsparser.hh dnsparser.cc \ | |
142 | dnswriter.cc dnswriter.hh \ | |
143 | doh.hh doh.cc \ | |
144 | dolog.hh \ | |
145 | ednsoptions.cc ednsoptions.hh \ | |
146 | ednscookies.cc ednscookies.hh \ | |
147 | ednssubnet.cc ednssubnet.hh \ | |
148 | fstrm_logger.cc fstrm_logger.hh \ | |
149 | gettime.cc gettime.hh \ | |
150 | htmlfiles.h \ | |
151 | iputils.cc iputils.hh \ | |
152 | libssl.cc libssl.hh \ | |
153 | lock.hh \ | |
154 | misc.cc misc.hh \ | |
155 | mplexer.hh \ | |
156 | namespaces.hh \ | |
157 | pdnsexception.hh \ | |
158 | protobuf.cc protobuf.hh \ | |
159 | dnstap.cc dnstap.hh \ | |
160 | qtype.cc qtype.hh \ | |
161 | remote_logger.cc remote_logger.hh \ | |
162 | pollmplexer.cc \ | |
163 | sholder.hh \ | |
164 | snmp-agent.cc snmp-agent.hh \ | |
165 | sodcrypto.cc sodcrypto.hh \ | |
166 | sstuff.hh \ | |
167 | statnode.cc statnode.hh \ | |
168 | tcpiohandler.cc tcpiohandler.hh \ | |
169 | threadname.hh threadname.cc \ | |
170 | uuid-utils.hh uuid-utils.cc \ | |
171 | xpf.cc xpf.hh \ | |
172 | ext/luawrapper/include/LuaContext.hpp \ | |
173 | ext/json11/json11.cpp \ | |
174 | ext/json11/json11.hpp \ | |
175 | ext/incbin/incbin.h \ | |
176 | ext/libbpf/libbpf.h | |
177 | ||
178 | testrunner_SOURCES = \ | |
179 | base64.hh \ | |
180 | dns.hh \ | |
181 | test-base64_cc.cc \ | |
182 | test-delaypipe_hh.cc \ | |
183 | test-dnscrypt_cc.cc \ | |
184 | test-dnsdist_cc.cc \ | |
185 | test-dnsdistdynblocks_hh.cc \ | |
186 | test-dnsdistkvs_cc.cc \ | |
187 | test-dnsdistpacketcache_cc.cc \ | |
188 | test-dnsdistrings_cc.cc \ | |
189 | test-dnsdistrules_cc.cc \ | |
190 | test-dnsparser_cc.cc \ | |
191 | test-iputils_hh.cc \ | |
192 | test-mplexer.cc \ | |
193 | cachecleaner.hh \ | |
194 | circular_buffer.hh \ | |
195 | dnsdist.hh \ | |
196 | dnsdist-cache.cc dnsdist-cache.hh \ | |
197 | dnsdist-ecs.cc dnsdist-ecs.hh \ | |
198 | dnsdist-kvs.cc dnsdist-kvs.hh \ | |
199 | dnsdist-rings.hh \ | |
200 | dnsdist-xpf.cc dnsdist-xpf.hh \ | |
201 | dnscrypt.cc dnscrypt.hh \ | |
202 | dnslabeltext.cc \ | |
203 | dnsname.cc dnsname.hh \ | |
204 | dnsparser.hh dnsparser.cc \ | |
205 | dnswriter.cc dnswriter.hh \ | |
206 | dolog.hh \ | |
207 | ednsoptions.cc ednsoptions.hh \ | |
208 | ednscookies.cc ednscookies.hh \ | |
209 | ednssubnet.cc ednssubnet.hh \ | |
210 | gettime.cc gettime.hh \ | |
211 | iputils.cc iputils.hh \ | |
212 | misc.cc misc.hh \ | |
213 | namespaces.hh \ | |
214 | pdnsexception.hh \ | |
215 | pollmplexer.cc \ | |
216 | qtype.cc qtype.hh \ | |
217 | sholder.hh \ | |
218 | sodcrypto.cc \ | |
219 | sstuff.hh \ | |
220 | statnode.cc statnode.hh \ | |
221 | threadname.hh threadname.cc \ | |
222 | testrunner.cc \ | |
223 | xpf.cc xpf.hh | |
224 | ||
225 | dnsdist_LDFLAGS = \ | |
226 | $(AM_LDFLAGS) \ | |
227 | $(PROGRAM_LDFLAGS) \ | |
228 | -pthread | |
229 | ||
230 | dnsdist_LDADD = \ | |
231 | $(LUA_LIBS) \ | |
232 | $(LIBEDIT_LIBS) \ | |
233 | $(RT_LIBS) \ | |
234 | $(YAHTTP_LIBS) \ | |
235 | $(LIBSODIUM_LIBS) \ | |
236 | $(FSTRM_LIBS) \ | |
237 | $(SANITIZER_FLAGS) \ | |
238 | $(SYSTEMD_LIBS) \ | |
239 | $(NET_SNMP_LIBS) \ | |
240 | $(LIBCAP_LIBS) \ | |
241 | $(IPCRYPT_LIBS) | |
242 | ||
243 | testrunner_LDFLAGS = \ | |
244 | $(AM_LDFLAGS) \ | |
245 | $(PROGRAM_LDFLAGS) \ | |
246 | $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \ | |
247 | -pthread | |
248 | ||
249 | testrunner_LDADD = \ | |
250 | $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \ | |
251 | $(LIBSODIUM_LIBS) \ | |
252 | $(FSTRM_LIBS) \ | |
253 | $(RT_LIBS) \ | |
254 | $(SANITIZER_FLAGS) \ | |
255 | $(LIBCAP_LIBS) | |
256 | ||
257 | if HAVE_RE2 | |
258 | dnsdist_LDADD += $(RE2_LIBS) | |
259 | endif | |
260 | ||
261 | if HAVE_LIBSSL | |
262 | dnsdist_LDADD += $(LIBSSL_LIBS) | |
263 | endif | |
264 | ||
265 | if HAVE_LIBCRYPTO | |
266 | dnsdist_LDADD += $(LIBCRYPTO_LDFLAGS) $(LIBCRYPTO_LIBS) | |
267 | dnsdist_SOURCES += ipcipher.cc ipcipher.hh | |
268 | endif | |
269 | ||
270 | if HAVE_LMDB | |
271 | dnsdist_LDADD += $(LMDB_LDFLAGS) $(LMDB_LIBS) | |
272 | testrunner_LDADD += $(LMDB_LDFLAGS) $(LMDB_LIBS) | |
273 | dnsdist_SOURCES += lmdb-safe.cc lmdb-safe.hh | |
274 | testrunner_SOURCES += lmdb-safe.cc lmdb-safe.hh | |
275 | endif | |
276 | ||
277 | if HAVE_DNS_OVER_TLS | |
278 | if HAVE_GNUTLS | |
279 | dnsdist_LDADD += -lgnutls | |
280 | endif | |
281 | endif | |
282 | ||
283 | if HAVE_DNS_OVER_HTTPS | |
284 | ||
285 | if HAVE_LIBH2OEVLOOP | |
286 | dnsdist_LDADD += $(LIBH2OEVLOOP_LIBS) | |
287 | endif | |
288 | ||
289 | endif | |
290 | ||
291 | if !HAVE_LUA_HPP | |
292 | BUILT_SOURCES += lua.hpp | |
293 | nodist_dnsdist_SOURCES = lua.hpp | |
294 | CLEANFILES += lua.hpp | |
295 | endif | |
296 | ||
297 | if HAVE_PROTOBUF | |
298 | if HAVE_PROTOC | |
299 | dnsmessage.pb.cc: dnsmessage.proto | |
300 | $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $< | |
301 | ||
302 | dnstap.pb.cc: dnstap.proto | |
303 | $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $< | |
304 | ||
305 | BUILT_SOURCES += dnsmessage.pb.cc dnstap.pb.cc | |
306 | ||
307 | nodist_dnsdist_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h dnstap.pb.cc dnstap.pb.h | |
308 | dnsdist_LDADD += $(PROTOBUF_LIBS) | |
309 | ||
310 | dnsdist.$(OBJEXT): dnsmessage.pb.cc dnstap.pb.cc | |
311 | endif | |
312 | endif | |
313 | ||
314 | if HAVE_FREEBSD | |
315 | dnsdist_SOURCES += kqueuemplexer.cc | |
316 | testrunner_SOURCES += kqueuemplexer.cc | |
317 | endif | |
318 | ||
319 | if HAVE_LINUX | |
320 | dnsdist_SOURCES += epollmplexer.cc | |
321 | testrunner_SOURCES += epollmplexer.cc | |
322 | endif | |
323 | ||
324 | if HAVE_SOLARIS | |
325 | dnsdist_SOURCES += \ | |
326 | devpollmplexer.cc \ | |
327 | portsmplexer.cc | |
328 | testrunner_SOURCES += \ | |
329 | devpollmplexer.cc \ | |
330 | portsmplexer.cc | |
331 | endif | |
332 | ||
333 | MANPAGES=dnsdist.1 | |
334 | ||
335 | dist_man_MANS=$(MANPAGES) | |
336 | ||
337 | if HAVE_VIRTUALENV | |
338 | if !HAVE_MANPAGES | |
339 | $(MANPAGES): %: docs/manpages/%.rst .venv | |
340 | $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $< | |
341 | endif # if !HAVE_MANPAGES | |
342 | ||
343 | .venv: docs/requirements.txt | |
344 | virtualenv .venv | |
345 | .venv/bin/pip install -U pip setuptools setuptools-git | |
346 | .venv/bin/pip install -r $< | |
347 | ||
348 | latex/dnsdist.pdf: docs/** .venv | |
349 | .venv/bin/python -msphinx -M latexpdf docs . | |
350 | ||
351 | dnsdist.pdf: latex/dnsdist.pdf | |
352 | mv $< $@ | |
353 | ||
354 | html-docs.tar.bz2: html-docs | |
355 | tar cjf $@ $< | |
356 | ||
357 | html-docs: docs/** .venv | |
358 | .venv/bin/python -msphinx -b html docs html-docs | |
359 | ||
360 | all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf | |
361 | ||
362 | upload-docs: all-docs | |
363 | rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org | |
364 | rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org | |
365 | rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org | |
366 | ||
367 | else # if HAVE_VIRTUALENV | |
368 | $(MANPAGES): | |
369 | @echo "You need virtualenv to generate the manpages" | |
370 | exit 1 | |
371 | ||
372 | html-docs: %: docs/manpages/%.rst .venv | |
373 | @echo "You need virtualenv to generate the HTML documentation" | |
374 | exit 1 | |
375 | ||
376 | dnsdist.pdf: | |
377 | @echo "You need virtualenv to generate the pdf documentation" | |
378 | exit 1 | |
379 | endif | |
380 | ||
381 | if HAVE_SYSTEMD | |
382 | dnsdist.service: dnsdist.service.in | |
383 | $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@ | |
384 | if !HAVE_SYSTEMD_LOCK_PERSONALITY | |
385 | $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@ | |
386 | endif | |
387 | if !HAVE_SYSTEMD_PRIVATE_DEVICES | |
388 | $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@ | |
389 | endif | |
390 | if !HAVE_SYSTEMD_PRIVATE_TMP | |
391 | $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@ | |
392 | endif | |
393 | if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS | |
394 | $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@ | |
395 | endif | |
396 | if !HAVE_SYSTEMD_PROTECT_HOME | |
397 | $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@ | |
398 | endif | |
399 | if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES | |
400 | $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@ | |
401 | endif | |
402 | if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES | |
403 | $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@ | |
404 | endif | |
405 | if !HAVE_SYSTEMD_PROTECT_SYSTEM | |
406 | $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@ | |
407 | endif | |
408 | if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES | |
409 | $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@ | |
410 | endif | |
411 | if !HAVE_SYSTEMD_RESTRICT_NAMESPACES | |
412 | $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@ | |
413 | endif | |
414 | if !HAVE_SYSTEMD_RESTRICT_REALTIME | |
415 | $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@ | |
416 | endif | |
417 | if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES | |
418 | $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@ | |
419 | endif | |
420 | if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER | |
421 | $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@ | |
422 | endif | |
423 | ||
424 | dnsdist@.service: dnsdist.service | |
425 | $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' < $< >$@ | |
426 | ||
427 | systemdsystemunitdir = $(SYSTEMD_DIR) | |
428 | ||
429 | systemdsystemunit_DATA = \ | |
430 | dnsdist.service \ | |
431 | dnsdist@.service | |
432 | ||
433 | CLEANFILES += \ | |
434 | dnsdist.service \ | |
435 | dnsdist@.service | |
436 | endif | |
437 | ||
438 | if !HAVE_LUA_HPP | |
439 | include lua_hpp.mk | |
440 | endif |