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