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