remove 'illegal' (non-reentrant) log logic from signal handler
[oweals/gnunet.git] / src / gns / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 if HAVE_GLIBCNSS
5 NSS_SUBDIR = nss
6 endif
7
8 SUBDIRS = . $(NSS_SUBDIR)
9
10 pkgdata_DATA = \
11   gnunet-gns-proxy-ca.template
12
13 if HAVE_LIBIDN
14   LIBIDN= -lidn
15 else
16   LIBIDN=
17 endif
18
19 if HAVE_LIBIDN2
20   LIBIDN2= -lidn2
21 else
22   LIBIDN2=
23 endif
24
25 EXTRA_DIST = \
26   test_gns_defaults.conf \
27   test_gns_lookup.conf \
28   test_gns_proxy.conf \
29   test_gns_simple_lookup.conf \
30   openssl.cnf \
31   gnunet-gns-proxy-setup-ca.in \
32   zonefiles/J7POEUT41A8PBFS7KVVDRF88GBOU4HK8PSU5QKVLVE3R9T91E99G.zkey \
33   zonefiles/OEFL7A4VEF1B40QLEMTG5D8G1CN6EN16QUSG5R2DT71GRJN34LSG.zkey \
34   zonefiles/test_zonekey \
35   $(check_SCRIPTS) \
36   $(pkgdata_DATA) \
37   test_gnunet_gns.sh.in
38
39 USE_VPN = $(top_builddir)/src/vpn/libgnunetvpn.la
40
41 if USE_COVERAGE
42   AM_CFLAGS = --coverage -O0
43 endif
44
45 pkgcfgdir = $(pkgdatadir)/config.d/
46
47 libexecdir= $(pkglibdir)/libexec/
48
49 plugindir = $(libdir)/gnunet
50
51 pkgcfg_DATA = \
52   gns.conf
53
54 lib_LTLIBRARIES = \
55   libgnunetgns.la
56
57
58 if HAVE_MHD
59 if HAVE_GNUTLS
60 if HAVE_LIBGNURL
61   DO_PROXY=gnunet-gns-proxy
62 LIB_GNURL=@LIBGNURL@
63 CPP_GNURL=@LIBGNURL_CPPFLAGS@
64 else
65 if HAVE_LIBCURL
66   DO_PROXY=gnunet-gns-proxy
67 LIB_GNURL=@LIBCURL@
68 CPP_GNURL=@LIBCURL_CPPFLAGS@
69 endif
70 endif
71 endif
72 endif
73
74 libexec_PROGRAMS = \
75   gnunet-service-gns \
76   gnunet-dns2gns \
77   $(DO_PROXY)
78
79 bin_PROGRAMS = \
80   gnunet-gns
81
82 noinst_PROGRAMS = \
83   gnunet-gns-benchmark
84
85 if HAVE_MHD
86 if LINUX
87 bin_PROGRAMS += gnunet-bcd
88 endif
89 endif
90
91 if HAVE_MHD
92 if HAVE_JSON
93 REST_PLUGIN = libgnunet_plugin_rest_gns.la
94 endif
95 endif
96
97 plugin_LTLIBRARIES = \
98   libgnunet_plugin_block_gns.la \
99   libgnunet_plugin_gnsrecord_gns.la \
100   $(REST_PLUGIN)
101
102
103 bin_SCRIPTS = \
104   gnunet-gns-proxy-setup-ca
105
106 gnunet-gns-proxy-setup-ca: gnunet-gns-proxy-setup-ca.in Makefile
107         $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $(srcdir)/gnunet-gns-proxy-setup-ca.in > gnunet-gns-proxy-setup-ca
108         @chmod +x gnunet-gns-proxy-setup-ca
109
110 test_gnunet_gns.sh: test_gnunet_gns.sh.in Makefile
111         $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $(srcdir)/test_gnunet_gns.sh.in > test_gnunet_gns.sh
112         @chmod +x test_gnunet_gns.sh
113
114 CLEANFILES = test_gnunet_gns.sh
115
116 libgnunet_plugin_rest_gns_la_SOURCES = \
117   plugin_rest_gns.c
118 libgnunet_plugin_rest_gns_la_LIBADD = \
119   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
120   libgnunetgns.la \
121   $(top_builddir)/src/rest/libgnunetrest.la \
122   $(top_builddir)/src/identity/libgnunetidentity.la \
123   $(top_builddir)/src/json/libgnunetjson.la \
124   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
125   $(LTLIBINTL) -ljansson $(MHD_LIBS)
126 libgnunet_plugin_rest_gns_la_LDFLAGS = \
127  $(GN_PLUGIN_LDFLAGS)
128 libgnunet_plugin_rest_gns_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
129
130
131 libgnunet_plugin_gnsrecord_gns_la_SOURCES = \
132   plugin_gnsrecord_gns.c
133 libgnunet_plugin_gnsrecord_gns_la_LIBADD = \
134   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
135   $(top_builddir)/src/util/libgnunetutil.la \
136   $(LTLIBINTL)
137 libgnunet_plugin_gnsrecord_gns_la_LDFLAGS = \
138  $(GN_PLUGIN_LDFLAGS)
139
140
141 gnunet_gns_SOURCES = \
142  gnunet-gns.c
143 gnunet_gns_LDADD = \
144   libgnunetgns.la \
145   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
146   $(top_builddir)/src/util/libgnunetutil.la \
147   $(LIBIDN) $(LIBIDN2) \
148   $(GN_LIBINTL)
149
150 gnunet_gns_benchmark_SOURCES = \
151  gnunet-gns-benchmark.c
152 gnunet_gns_benchmark_LDADD = \
153   libgnunetgns.la \
154   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
155   $(top_builddir)/src/util/libgnunetutil.la \
156   $(GN_LIBINTL)
157
158
159 gnunet_bcd_SOURCES = \
160  gnunet-bcd.c
161 gnunet_bcd_LDADD = \
162   $(top_builddir)/src/util/libgnunetutil.la \
163   $(GN_LIBINTL) $(MHD_LIBS)
164 gnunet_bcd_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS)
165
166
167 gnunet_dns2gns_SOURCES = \
168  gnunet-dns2gns.c
169 gnunet_dns2gns_LDADD = \
170   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
171   libgnunetgns.la \
172   $(top_builddir)/src/util/libgnunetutil.la \
173   $(top_builddir)/src/identity/libgnunetidentity.la \
174   $(GN_LIBINTL)
175
176 if HAVE_SUDO
177 SUDO_OR_DOAS_BINARY= $(SUDO_BINARY)
178 else
179 if HAVE_DOAS_BINARY
180 SUDO_OR_DOAS_BINARY= $(DOAS_BINARY)
181 endif
182 endif
183
184 if LINUX
185 HIJACKBIN = gnunet-dns2gns
186 install-exec-hook:
187         $(SUDO_OR_DOAS_BINARY) setcap 'cap_net_bind_service=+ep' $(DESTDIR)$(libexecdir)/gnunet-dns2gns || true
188 else
189 install-exec-hook:
190 endif
191
192 gnunet_gns_proxy_SOURCES = \
193  gnunet-gns-proxy.c
194 gnunet_gns_proxy_LDADD = $(MHD_LIBS) $(LIB_GNURL) -lgnutls \
195   libgnunetgns.la \
196   $(top_builddir)/src/identity/libgnunetidentity.la \
197   $(top_builddir)/src/util/libgnunetutil.la \
198   $(GN_LIBINTL)
199 if HAVE_GNUTLS_DANE
200 gnunet_gns_proxy_LDADD += -lgnutls-dane
201 endif
202 gnunet_gns_proxy_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
203
204 test_gns_proxy_SOURCES = \
205   test_gns_proxy.c
206 test_gns_proxy_LDADD = $(MHD_LIBS) $(LIB_GNURL) -lgnutls \
207   $(top_builddir)/src/util/libgnunetutil.la \
208   $(GN_LIBINTL)
209 test_gns_proxy_CFLAGS = $(MHD_CFLAGS) $(CPP_GNURL) $(AM_CFLAGS)
210
211 #gnunet_gns_import_SOURCES = \
212 #  gnunet-gns-import.c
213 #gnunet_gns_import_LDADD = \
214 #  $(top_builddir)/src/identity/libgnunetidentity.la \
215 #  $(top_builddir)/src/namestore/libgnunetnamestore.la \
216 #  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
217 #  $(top_builddir)/src/util/libgnunetutil.la \
218 #  $(GN_LIBINTL)
219
220
221 gnunet_service_gns_SOURCES = \
222  gnunet-service-gns.c gnunet-service-gns.h \
223  gnunet-service-gns_resolver.c gnunet-service-gns_resolver.h \
224  gnunet-service-gns_interceptor.c gnunet-service-gns_interceptor.h
225 gnunet_service_gns_LDADD = \
226   -lm \
227   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
228   $(top_builddir)/src/identity/libgnunetidentity.la \
229   $(top_builddir)/src/revocation/libgnunetrevocation.la \
230   $(top_builddir)/src/statistics/libgnunetstatistics.la \
231   $(top_builddir)/src/util/libgnunetutil.la \
232   $(top_builddir)/src/dns/libgnunetdns.la \
233   $(top_builddir)/src/dht/libgnunetdht.la \
234   $(top_builddir)/src/namecache/libgnunetnamecache.la \
235   $(LIBIDN) $(LIBIDN2) \
236   $(USE_VPN) \
237   $(GN_LIBINTL)
238
239
240 libgnunetgns_la_SOURCES = \
241  gns_api.c gns_api.h \
242  gns_tld_api.c gns.h
243 libgnunetgns_la_LIBADD = \
244  $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
245  $(top_builddir)/src/identity/libgnunetidentity.la \
246  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
247 libgnunetgns_la_LDFLAGS = \
248   $(GN_LIBINTL) \
249   $(GN_LIB_LDFLAGS)
250
251
252 libgnunet_plugin_block_gns_la_SOURCES = \
253   plugin_block_gns.c
254 libgnunet_plugin_block_gns_la_LIBADD = \
255   $(top_builddir)/src/util/libgnunetutil.la \
256   $(top_builddir)/src/block/libgnunetblock.la \
257   $(top_builddir)/src/block/libgnunetblockgroup.la \
258   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
259 libgnunet_plugin_block_gns_la_LDFLAGS = \
260   $(GN_LIBINTL) \
261   $(GN_PLUGIN_LDFLAGS)
262
263 if HAVE_MHD
264 if HAVE_GNUTLS
265 if HAVE_LIBGNURL
266 check_PROGRAMS = \
267   test_gns_proxy
268 endif
269 endif
270 endif
271
272 check_SCRIPTS = \
273   test_gns_lookup.sh \
274   test_gns_config_lookup.sh \
275   test_gns_ipv6_lookup.sh\
276   test_gns_txt_lookup.sh\
277   test_gns_caa_lookup.sh\
278   test_gns_mx_lookup.sh \
279   test_gns_gns2dns_lookup.sh \
280   test_gns_gns2dns_zkey_lookup.sh \
281   test_gns_gns2dns_cname_lookup.sh \
282   test_gns_dht_lookup.sh\
283   test_gns_delegated_lookup.sh \
284   test_gns_at_lookup.sh\
285   test_gns_zkey_lookup.sh\
286   test_gns_rel_expiration.sh\
287   test_gns_soa_lookup.sh\
288   test_gns_revocation.sh\
289   test_gns_cname_lookup.sh
290
291 if HAVE_MHD
292 if HAVE_GNUTLS
293 if HAVE_LIBGNURL
294 check_SCRIPTS += \
295   test_proxy.sh
296 endif
297 endif
298 if HAVE_JSON
299 check_SCRIPTS += \
300   test_plugin_rest_gns.sh
301 endif
302 endif
303
304
305 if ENABLE_TEST_RUN
306 if HAVE_SQLITE
307  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
308  TESTS = $(check_SCRIPTS)
309 endif
310 endif