Add support for doas.
[oweals/gnunet.git] / src / dns / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 if USE_COVERAGE
5   AM_CFLAGS = --coverage -O0
6 endif
7
8 pkgcfgdir= $(pkgdatadir)/config.d/
9
10 libexecdir= $(pkglibdir)/libexec/
11
12 plugindir = $(libdir)/gnunet
13
14 pkgcfg_DATA = \
15   dns.conf
16
17 if HAVE_SUDO
18 SUDO_OR_DOAS_BINARY= $(SUDO_BINARY)
19 else
20 if HAVE_DOAS_BINARY
21 SUDO_OR_DOAS_BINARY= $(DOAS_BINARY)
22 endif
23 endif
24
25 if LINUX
26 HIJACKBIN = gnunet-helper-dns
27 install-exec-hook:
28         $(top_srcdir)/src/dns/install-dns-helper.sh $(DESTDIR)$(libexecdir) $(GNUNETDNS_GROUP) $(SUDO_OR_DOAS_BINARY) || true
29 else
30 install-exec-hook:
31 endif
32
33 lib_LTLIBRARIES = \
34   libgnunetdns.la
35
36 libexec_PROGRAMS = \
37   gnunet-service-dns $(HIJACKBIN)
38
39 noinst_PROGRAMS = \
40   gnunet-dns-monitor \
41   gnunet-dns-redirector \
42   gnunet-zonewalk
43
44 plugin_LTLIBRARIES = \
45   libgnunet_plugin_block_dns.la
46
47 if LINUX
48 check_SCRIPTS = \
49  test_gnunet_dns.sh
50 endif
51
52 gnunet_helper_dns_SOURCES = \
53  gnunet-helper-dns.c
54
55
56 gnunet_dns_monitor_SOURCES = \
57  gnunet-dns-monitor.c
58 gnunet_dns_monitor_LDADD = \
59   libgnunetdns.la \
60   $(top_builddir)/src/util/libgnunetutil.la \
61   $(GN_LIBINTL)
62
63 gnunet_zonewalk_SOURCES = \
64  gnunet-zonewalk.c
65 gnunet_zonewalk_LDADD = \
66   $(top_builddir)/src/util/libgnunetutil.la \
67   $(GN_LIBINTL)
68
69 gnunet_dns_redirector_SOURCES = \
70  gnunet-dns-redirector.c
71 gnunet_dns_redirector_LDADD = \
72   libgnunetdns.la \
73   $(top_builddir)/src/util/libgnunetutil.la \
74   $(GN_LIBINTL)
75
76 gnunet_service_dns_SOURCES = \
77  gnunet-service-dns.c
78 gnunet_service_dns_LDADD = \
79   $(top_builddir)/src/statistics/libgnunetstatistics.la \
80   $(top_builddir)/src/util/libgnunetutil.la \
81   $(GN_LIBINTL)
82
83 libgnunetdns_la_SOURCES = \
84  dns_api.c dns.h
85 libgnunetdns_la_LIBADD = \
86  $(top_builddir)/src/util/libgnunetutil.la $(XLIB)
87 libgnunetdns_la_LDFLAGS = \
88   $(GN_LIB_LDFLAGS) \
89   -version-info 0:0:0
90
91 libgnunet_plugin_block_dns_la_SOURCES = \
92   plugin_block_dns.c
93 libgnunet_plugin_block_dns_la_LIBADD = \
94   $(top_builddir)/src/block/libgnunetblockgroup.la \
95   $(top_builddir)/src/util/libgnunetutil.la
96 libgnunet_plugin_block_dns_la_LDFLAGS = \
97   $(top_builddir)/src/block/$(GN_PLUGIN_LDFLAGS)
98
99
100 if ENABLE_TEST_RUN
101 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
102 TESTS = $(check_PROGRAMS)  $(check_SCRIPTS)
103 endif
104
105 EXTRA_DIST = \
106   $(check_SCRIPTS)
107
108