Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials
[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 if INSTALL_NSS
6 NSS_SUBDIR = nss
7 endif
8 endif
9
10 SUBDIRS = . $(NSS_SUBDIR)
11
12 EXTRA_DIST = \
13   test_gns_defaults.conf \
14   test_gns_lookup.conf \
15   test_gns_nick_shorten.conf \
16   test_gns_proxy.conf \
17   test_gns_simple_lookup.conf \
18   gns-helper-service-w32.conf \
19   w32nsp.def \
20   gnunet-gns-proxy-setup-ca \
21   zonefiles/J7POEUT41A8PBFS7KVVDRF88GBOU4HK8PSU5QKVLVE3R9T91E99G.zkey \
22   zonefiles/OEFL7A4VEF1B40QLEMTG5D8G1CN6EN16QUSG5R2DT71GRJN34LSG.zkey \
23   zonefiles/test_zonekey \
24   $(check_SCRIPTS)
25
26 if MINGW
27   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
28   DO_W32_HELPER = gnunet-gns-helper-service-w32
29   DO_W32_NSP = libw32nsp.la
30   DO_W32_NSPTOOLS = w32nsp-install w32nsp-uninstall w32nsp-resolve
31   DO_W32_HS_CONF = gns-helper-service-w32.conf
32   DO_NONPOSIX_GNSIMPORT = gnunet-gns-import
33 endif
34 USE_VPN = $(top_builddir)/src/vpn/libgnunetvpn.la
35
36 if USE_COVERAGE
37   AM_CFLAGS = --coverage -O0
38 endif
39
40 pkgcfgdir = $(pkgdatadir)/config.d/
41
42 libexecdir= $(pkglibdir)/libexec/
43
44 plugindir = $(libdir)/gnunet
45
46 pkgcfg_DATA = \
47   gns.conf \
48   $(DO_W32_HS_CONF)
49
50 lib_LTLIBRARIES = \
51   $(DO_W32_NSP) \
52   libgnunetgns.la
53
54
55 if HAVE_MHD
56 if HAVE_GNUTLS
57 if HAVE_LIBGNURL
58   DO_PROXY=gnunet-gns-proxy
59 LIB_GNURL=@LIBGNURL@
60 CPP_GNURL=@LIBGNURL_CPPFLAGS@
61 else
62 if HAVE_LIBCURL
63   DO_PROXY=gnunet-gns-proxy
64 LIB_GNURL=@LIBCURL@
65 CPP_GNURL=@LIBCURL_CPPFLAGS@
66 endif
67 endif
68 endif
69 endif
70
71 libexec_PROGRAMS = \
72   gnunet-service-gns \
73   $(DO_W32_HELPER) \
74   gnunet-dns2gns \
75   $(DO_PROXY)
76
77 bin_PROGRAMS = \
78   $(DO_W32_NSPTOOLS) \
79   $(DO_NONPOSIX_GNSIMPORT) \
80   gnunet-gns
81
82 if HAVE_MHD
83 if LINUX
84 bin_PROGRAMS += gnunet-bcd
85 endif
86 endif
87
88 bin_SCRIPTS = gnunet-gns-proxy-setup-ca
89
90 plugin_LTLIBRARIES = \
91   libgnunet_plugin_block_gns.la \
92   libgnunet_plugin_gnsrecord_gns.la
93
94
95 if HAVE_MHD
96 if HAVE_JSON
97 plugin_LTLIBRARIES += libgnunet_plugin_rest_gns.la
98 endif
99 endif
100
101 libgnunet_plugin_gnsrecord_gns_la_SOURCES = \
102   plugin_gnsrecord_gns.c
103 libgnunet_plugin_gnsrecord_gns_la_LIBADD = \
104   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
105   $(top_builddir)/src/dns/libgnunetdnsparser.la \
106   $(top_builddir)/src/util/libgnunetutil.la \
107   $(LTLIBINTL)
108 libgnunet_plugin_gnsrecord_gns_la_LDFLAGS = \
109  $(GN_PLUGIN_LDFLAGS)
110
111
112 gnunet_gns_SOURCES = \
113  gnunet-gns.c
114 gnunet_gns_LDADD = \
115   libgnunetgns.la \
116   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
117   $(top_builddir)/src/namestore/libgnunetnamestore.la \
118   $(top_builddir)/src/identity/libgnunetidentity.la \
119   $(top_builddir)/src/util/libgnunetutil.la \
120   $(GN_LIBINTL)
121
122
123 gnunet_bcd_SOURCES = \
124  gnunet-bcd.c
125 gnunet_bcd_LDADD = \
126   $(top_builddir)/src/util/libgnunetutil.la \
127   $(GN_LIBINTL) -lmicrohttpd
128
129
130 gnunet_dns2gns_SOURCES = \
131  gnunet-dns2gns.c
132 gnunet_dns2gns_LDADD = \
133   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
134   libgnunetgns.la \
135   $(top_builddir)/src/util/libgnunetutil.la \
136   $(top_builddir)/src/identity/libgnunetidentity.la \
137   $(top_builddir)/src/namestore/libgnunetnamestore.la \
138   $(top_builddir)/src/dns/libgnunetdnsparser.la \
139   $(top_builddir)/src/dns/libgnunetdnsstub.la \
140   $(GN_LIBINTL)
141
142 gnunet_gns_proxy_SOURCES = \
143  gnunet-gns-proxy.c
144 gnunet_gns_proxy_CPPFLAGS = $(AM_CPPFLAGS) $(CPP_GNURL)
145 gnunet_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
146   libgnunetgns.la \
147   $(top_builddir)/src/identity/libgnunetidentity.la \
148   $(top_builddir)/src/util/libgnunetutil.la \
149   $(GN_LIBINTL)
150 if HAVE_GNUTLS_DANE
151 gnunet_gns_proxy_LDADD += -lgnutls-dane
152 endif
153
154 gnunet_gns_helper_service_w32_SOURCES = \
155   gnunet-gns-helper-service-w32.c
156 gnunet_gns_helper_service_w32_LDADD = \
157   libgnunetgns.la \
158   $(top_builddir)/src/identity/libgnunetidentity.la \
159   $(top_builddir)/src/util/libgnunetutil.la \
160   $(GN_LIBINTL)
161
162 gnunet_gns_import_SOURCES = \
163   gnunet-gns-import.c
164 gnunet_gns_import_LDADD = \
165   $(top_builddir)/src/identity/libgnunetidentity.la \
166   $(top_builddir)/src/namestore/libgnunetnamestore.la \
167   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
168   $(top_builddir)/src/util/libgnunetutil.la \
169   $(GN_LIBINTL)
170
171
172 w32nsp_install_SOURCES = \
173   w32nsp-install.c
174 w32nsp_install_LDADD = -lws2_32
175
176 w32nsp_uninstall_SOURCES = \
177   w32nsp-uninstall.c
178 w32nsp_uninstall_LDADD = -lws2_32
179
180 w32nsp_resolve_SOURCES = \
181   w32nsp-resolve.c
182 w32nsp_resolve_LDADD = -lws2_32
183
184 gnunet_service_gns_SOURCES = \
185  gnunet-service-gns.c \
186  gnunet-service-gns_resolver.c gnunet-service-gns_resolver.h \
187  gnunet-service-gns_reverser.c gnunet-service-gns_reverser.h \
188  gnunet-service-gns_shorten.c gnunet-service-gns_shorten.h \
189  gnunet-service-gns_interceptor.c gnunet-service-gns_interceptor.h
190 gnunet_service_gns_LDADD = \
191   -lm \
192   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
193   $(top_builddir)/src/identity/libgnunetidentity.la \
194   $(top_builddir)/src/revocation/libgnunetrevocation.la \
195   $(top_builddir)/src/statistics/libgnunetstatistics.la \
196   $(top_builddir)/src/util/libgnunetutil.la \
197   $(top_builddir)/src/dns/libgnunetdns.la \
198   $(top_builddir)/src/dns/libgnunetdnsparser.la \
199   $(top_builddir)/src/dns/libgnunetdnsstub.la \
200   $(top_builddir)/src/dht/libgnunetdht.la \
201   $(top_builddir)/src/tun/libgnunettun.la \
202   $(top_builddir)/src/namecache/libgnunetnamecache.la \
203   $(top_builddir)/src/namestore/libgnunetnamestore.la \
204   $(USE_VPN) \
205   $(GN_LIBINTL)
206
207
208 libw32nsp_la_SOURCES = \
209   w32nsp.c
210 libw32nsp_la_LIBADD = \
211   -lole32 -lws2_32
212 libw32nsp_la_LDFLAGS = \
213   -export-symbols $(top_srcdir)/src/gns/w32nsp.def \
214   -no-undefined -static-libgcc
215
216 libgnunetgns_la_SOURCES = \
217  gns_api.c gns.h
218 libgnunetgns_la_LIBADD = \
219  $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
220  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
221 libgnunetgns_la_LDFLAGS = \
222   $(GN_LIB_LDFLAGS)
223
224
225 libgnunet_plugin_block_gns_la_SOURCES = \
226   plugin_block_gns.c
227 libgnunet_plugin_block_gns_la_LIBADD = \
228   $(top_builddir)/src/util/libgnunetutil.la \
229   $(top_builddir)/src/block/libgnunetblock.la \
230   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
231 libgnunet_plugin_block_gns_la_LDFLAGS = \
232   $(GN_PLUGIN_LDFLAGS)
233
234 libgnunet_plugin_rest_gns_la_SOURCES = \
235   plugin_rest_gns.c
236 libgnunet_plugin_rest_gns_la_LIBADD = \
237   libgnunetgns.la \
238         $(top_builddir)/src/rest/libgnunetrest.la \
239   $(top_builddir)/src/identity/libgnunetidentity.la \
240         $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
241   $(top_builddir)/src/jsonapi/libgnunetjsonapiutils.la \
242   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
243   $(LTLIBINTL) -ljansson -lmicrohttpd
244 libgnunet_plugin_rest_gns_la_LDFLAGS = \
245  $(GN_PLUGIN_LDFLAGS)
246
247
248 check_SCRIPTS = \
249   test_gns_lookup.sh \
250   test_gns_ipv6_lookup.sh\
251   test_gns_txt_lookup.sh\
252   test_gns_mx_lookup.sh \
253   test_gns_gns2dns_lookup.sh \
254   test_gns_dht_lookup.sh\
255   test_gns_delegated_lookup.sh \
256   test_gns_nick_shorten.sh\
257   test_gns_plus_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         test_gns_reverse_lookup.sh
264
265 if ENABLE_TEST_RUN
266 if HAVE_SQLITE
267  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
268  TESTS = $(check_SCRIPTS)
269 endif
270 endif