Merge branch 'master' of ssh://git.gnunet.org/gnunet
[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 EXTRA_DIST = \
11   test_gns_defaults.conf \
12   test_gns_lookup.conf \
13   test_gns_proxy.conf \
14   test_gns_simple_lookup.conf \
15   gns-helper-service-w32.conf \
16   w32nsp.def \
17   openssl.cnf \
18   gnunet-gns-proxy-setup-ca.in \
19   zonefiles/J7POEUT41A8PBFS7KVVDRF88GBOU4HK8PSU5QKVLVE3R9T91E99G.zkey \
20   zonefiles/OEFL7A4VEF1B40QLEMTG5D8G1CN6EN16QUSG5R2DT71GRJN34LSG.zkey \
21   zonefiles/test_zonekey \
22   $(check_SCRIPTS)
23
24 if MINGW
25   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
26   DO_W32_HELPER = gnunet-gns-helper-service-w32
27   DO_W32_NSP = libw32nsp.la
28   DO_W32_NSPTOOLS = w32nsp-install w32nsp-uninstall w32nsp-resolve
29   DO_W32_HS_CONF = gns-helper-service-w32.conf
30   DO_NONPOSIX_GNSIMPORT = gnunet-gns-import
31 endif
32 USE_VPN = $(top_builddir)/src/vpn/libgnunetvpn.la
33
34 if USE_COVERAGE
35   AM_CFLAGS = --coverage -O0
36 endif
37
38 pkgcfgdir = $(pkgdatadir)/config.d/
39
40 libexecdir= $(pkglibdir)/libexec/
41
42 plugindir = $(libdir)/gnunet
43
44 pkgcfg_DATA = \
45   gns.conf \
46   $(DO_W32_HS_CONF)
47
48 lib_LTLIBRARIES = \
49   $(DO_W32_NSP) \
50   libgnunetgns.la
51
52
53 if HAVE_MHD
54 if HAVE_GNUTLS
55 if HAVE_LIBGNURL
56   DO_PROXY=gnunet-gns-proxy
57 LIB_GNURL=@LIBGNURL@
58 CPP_GNURL=@LIBGNURL_CPPFLAGS@
59 else
60 if HAVE_LIBCURL
61   DO_PROXY=gnunet-gns-proxy
62 LIB_GNURL=@LIBCURL@
63 CPP_GNURL=@LIBCURL_CPPFLAGS@
64 endif
65 endif
66 endif
67 endif
68
69 libexec_PROGRAMS = \
70   gnunet-service-gns \
71   gnunet-dns2gns \
72   $(DO_W32_HELPER) \
73   $(DO_PROXY)
74
75 bin_PROGRAMS = \
76   $(DO_W32_NSPTOOLS) \
77   $(DO_NONPOSIX_GNSIMPORT) \
78   gnunet-gns
79
80 noinst_PROGRAMS = \
81   gnunet-gns-benchmark
82
83 pkgdata_DATA = \
84   gnunet-gns-proxy-ca.template
85
86 if HAVE_MHD
87 if LINUX
88 bin_PROGRAMS += gnunet-bcd
89 endif
90 endif
91
92 if HAVE_MHD
93 if HAVE_JSON
94 REST_PLUGIN = libgnunet_plugin_rest_gns.la
95 endif
96 endif
97
98 plugin_LTLIBRARIES = \
99   libgnunet_plugin_block_gns.la \
100   libgnunet_plugin_gnsrecord_gns.la \
101   $(REST_PLUGIN)
102
103
104 bin_SCRIPTS = \
105   gnunet-gns-proxy-setup-ca
106
107 # See: https://www.gnu.org/software/automake/manual/html_node/Scripts.html#Scripts
108 do_subst = sed -e 's,[@]pkgdatadir[@],$(pkgdatadir),g'
109
110 gnunet-gns-proxy-setup-ca: gnunet-gns-proxy-setup-ca.in Makefile
111         $(do_subst) < $(srcdir)/gnunet-gns-proxy-setup-ca.in > gnunet-gns-proxy-setup-ca
112         chmod +x gnunet-gns-proxy-setup-ca
113
114
115 libgnunet_plugin_rest_gns_la_SOURCES = \
116   plugin_rest_gns.c
117 libgnunet_plugin_rest_gns_la_LIBADD = \
118   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
119   libgnunetgns.la \
120   $(top_builddir)/src/rest/libgnunetrest.la \
121   $(top_builddir)/src/identity/libgnunetidentity.la \
122   $(top_builddir)/src/json/libgnunetjson.la \
123   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
124   $(LTLIBINTL) -ljansson -lmicrohttpd
125 libgnunet_plugin_rest_gns_la_LDFLAGS = \
126  $(GN_PLUGIN_LDFLAGS)
127
128
129 libgnunet_plugin_gnsrecord_gns_la_SOURCES = \
130   plugin_gnsrecord_gns.c
131 libgnunet_plugin_gnsrecord_gns_la_LIBADD = \
132   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
133   $(top_builddir)/src/util/libgnunetutil.la \
134   $(LTLIBINTL)
135 libgnunet_plugin_gnsrecord_gns_la_LDFLAGS = \
136  $(GN_PLUGIN_LDFLAGS)
137
138
139 gnunet_gns_SOURCES = \
140  gnunet-gns.c
141 gnunet_gns_LDADD = \
142   libgnunetgns.la \
143   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
144   $(top_builddir)/src/util/libgnunetutil.la \
145   $(GN_LIBINTL)
146
147 gnunet_gns_benchmark_SOURCES = \
148  gnunet-gns-benchmark.c
149 gnunet_gns_benchmark_LDADD = \
150   libgnunetgns.la \
151   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
152   $(top_builddir)/src/util/libgnunetutil.la \
153   $(GN_LIBINTL)
154
155
156 gnunet_bcd_SOURCES = \
157  gnunet-bcd.c
158 gnunet_bcd_LDADD = \
159   $(top_builddir)/src/util/libgnunetutil.la \
160   $(GN_LIBINTL) -lmicrohttpd
161
162
163 gnunet_dns2gns_SOURCES = \
164  gnunet-dns2gns.c
165 gnunet_dns2gns_LDADD = \
166   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
167   libgnunetgns.la \
168   $(top_builddir)/src/util/libgnunetutil.la \
169   $(top_builddir)/src/identity/libgnunetidentity.la \
170   $(GN_LIBINTL)
171
172 if LINUX
173 HIJACKBIN = gnunet-dns2gns
174 install-exec-hook:
175         $(SUDO_BINARY) setcap 'cap_net_bind_service=+ep' $(DESTDIR)$(libexecdir)/gnunet-dns2gns || true
176 else
177 install-exec-hook:
178 endif
179
180 gnunet_gns_proxy_SOURCES = \
181  gnunet-gns-proxy.c
182 gnunet_gns_proxy_CPPFLAGS = $(AM_CPPFLAGS) $(CPP_GNURL)
183 gnunet_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
184   libgnunetgns.la \
185   $(top_builddir)/src/identity/libgnunetidentity.la \
186   $(top_builddir)/src/util/libgnunetutil.la \
187   $(GN_LIBINTL)
188 if HAVE_GNUTLS_DANE
189 gnunet_gns_proxy_LDADD += -lgnutls-dane
190 endif
191
192 test_gns_proxy_SOURCES = \
193   test_gns_proxy.c
194 test_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
195   $(top_builddir)/src/util/libgnunetutil.la \
196   $(GN_LIBINTL)
197
198 gnunet_gns_helper_service_w32_SOURCES = \
199   gnunet-gns-helper-service-w32.c
200 gnunet_gns_helper_service_w32_LDADD = \
201   libgnunetgns.la \
202   $(top_builddir)/src/identity/libgnunetidentity.la \
203   $(top_builddir)/src/util/libgnunetutil.la \
204   $(GN_LIBINTL)
205
206 gnunet_gns_import_SOURCES = \
207   gnunet-gns-import.c
208 gnunet_gns_import_LDADD = \
209   $(top_builddir)/src/identity/libgnunetidentity.la \
210   $(top_builddir)/src/namestore/libgnunetnamestore.la \
211   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
212   $(top_builddir)/src/util/libgnunetutil.la \
213   $(GN_LIBINTL)
214
215
216 w32nsp_install_SOURCES = \
217   w32nsp-install.c
218 w32nsp_install_LDADD = -lws2_32
219
220 w32nsp_uninstall_SOURCES = \
221   w32nsp-uninstall.c
222 w32nsp_uninstall_LDADD = -lws2_32
223
224 w32nsp_resolve_SOURCES = \
225   w32nsp-resolve.c
226 w32nsp_resolve_LDADD = -lws2_32
227
228 gnunet_service_gns_SOURCES = \
229  gnunet-service-gns.c gnunet-service-gns.h \
230  gnunet-service-gns_resolver.c gnunet-service-gns_resolver.h \
231  gnunet-service-gns_interceptor.c gnunet-service-gns_interceptor.h
232 gnunet_service_gns_LDADD = \
233   -lm \
234   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
235   $(top_builddir)/src/identity/libgnunetidentity.la \
236   $(top_builddir)/src/revocation/libgnunetrevocation.la \
237   $(top_builddir)/src/statistics/libgnunetstatistics.la \
238   $(top_builddir)/src/util/libgnunetutil.la \
239   $(top_builddir)/src/dns/libgnunetdns.la \
240   $(top_builddir)/src/dht/libgnunetdht.la \
241   $(top_builddir)/src/namecache/libgnunetnamecache.la \
242   $(USE_VPN) \
243   $(GN_LIBINTL)
244
245
246 libw32nsp_la_SOURCES = \
247   w32nsp.c
248 libw32nsp_la_LIBADD = \
249   -lole32 -lws2_32
250 libw32nsp_la_LDFLAGS = \
251   -export-symbols $(top_srcdir)/src/gns/w32nsp.def \
252   -no-undefined -static-libgcc
253
254 libgnunetgns_la_SOURCES = \
255  gns_api.c gns_api.h \
256  gns_tld_api.c gns.h
257 libgnunetgns_la_LIBADD = \
258  $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
259  $(top_builddir)/src/identity/libgnunetidentity.la \
260  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
261 libgnunetgns_la_LDFLAGS = \
262   $(GN_LIB_LDFLAGS)
263
264
265 libgnunet_plugin_block_gns_la_SOURCES = \
266   plugin_block_gns.c
267 libgnunet_plugin_block_gns_la_LIBADD = \
268   $(top_builddir)/src/util/libgnunetutil.la \
269   $(top_builddir)/src/block/libgnunetblock.la \
270   $(top_builddir)/src/block/libgnunetblockgroup.la \
271   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
272 libgnunet_plugin_block_gns_la_LDFLAGS = \
273   $(GN_PLUGIN_LDFLAGS)
274
275 if HAVE_MHD
276 if HAVE_GNUTLS
277 if HAVE_LIBGNURL
278 check_PROGRAMS = \
279   test_gns_proxy
280 endif
281 endif
282 endif
283
284 check_SCRIPTS = \
285   test_gns_lookup.sh \
286   test_gns_config_lookup.sh \
287   test_gns_ipv6_lookup.sh\
288   test_gns_txt_lookup.sh\
289   test_gns_caa_lookup.sh\
290   test_gns_mx_lookup.sh \
291   test_gns_gns2dns_lookup.sh \
292   test_gns_gns2dns_cname_lookup.sh \
293   test_gns_dht_lookup.sh\
294   test_gns_delegated_lookup.sh \
295   test_gns_at_lookup.sh\
296   test_gns_zkey_lookup.sh\
297   test_gns_rel_expiration.sh\
298   test_gns_soa_lookup.sh\
299   test_gns_revocation.sh\
300   test_gns_cname_lookup.sh
301
302 if HAVE_MHD
303 if HAVE_GNUTLS
304 if HAVE_LIBGNURL
305 check_SCRIPTS += \
306   test_proxy.sh
307 endif
308 endif
309 endif
310
311
312 if ENABLE_TEST_RUN
313 if HAVE_SQLITE
314  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
315  TESTS = $(check_SCRIPTS)
316 endif
317 endif