d48d6d434fcab8a62af7057b34b0b600562e7fe4
[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 if HAVE_REST
55 lib_LTLIBRARIES += libgnunet_plugin_rest_gns.la
56 endif
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   $(DO_W32_HELPER) \
77   gnunet-dns2gns \
78   $(DO_PROXY)
79
80 bin_PROGRAMS = \
81   $(DO_W32_NSPTOOLS) \
82   $(DO_NONPOSIX_GNSIMPORT) \
83   gnunet-gns
84
85 if HAVE_MHD
86 if LINUX
87 bin_PROGRAMS += gnunet-bcd
88 endif
89 endif
90
91 bin_SCRIPTS = gnunet-gns-proxy-setup-ca
92
93 plugin_LTLIBRARIES = \
94   libgnunet_plugin_block_gns.la \
95   libgnunet_plugin_gnsrecord_gns.la
96
97
98 libgnunet_plugin_gnsrecord_gns_la_SOURCES = \
99   plugin_gnsrecord_gns.c
100 libgnunet_plugin_gnsrecord_gns_la_LIBADD = \
101   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
102   $(top_builddir)/src/dns/libgnunetdnsparser.la \
103   $(top_builddir)/src/util/libgnunetutil.la \
104   $(LTLIBINTL)
105 libgnunet_plugin_gnsrecord_gns_la_LDFLAGS = \
106  $(GN_PLUGIN_LDFLAGS)
107
108
109 gnunet_gns_SOURCES = \
110  gnunet-gns.c
111 gnunet_gns_LDADD = \
112   libgnunetgns.la \
113   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
114   $(top_builddir)/src/namestore/libgnunetnamestore.la \
115   $(top_builddir)/src/identity/libgnunetidentity.la \
116   $(top_builddir)/src/util/libgnunetutil.la \
117   $(GN_LIBINTL)
118
119
120 gnunet_bcd_SOURCES = \
121  gnunet-bcd.c
122 gnunet_bcd_LDADD = \
123   $(top_builddir)/src/util/libgnunetutil.la \
124   $(GN_LIBINTL) -lmicrohttpd
125
126
127 gnunet_dns2gns_SOURCES = \
128  gnunet-dns2gns.c
129 gnunet_dns2gns_LDADD = \
130   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
131   libgnunetgns.la \
132   $(top_builddir)/src/util/libgnunetutil.la \
133   $(top_builddir)/src/identity/libgnunetidentity.la \
134   $(top_builddir)/src/namestore/libgnunetnamestore.la \
135   $(top_builddir)/src/dns/libgnunetdnsparser.la \
136   $(top_builddir)/src/dns/libgnunetdnsstub.la \
137   $(GN_LIBINTL)
138
139 gnunet_gns_proxy_SOURCES = \
140  gnunet-gns-proxy.c
141 gnunet_gns_proxy_CPPFLAGS = $(AM_CPPFLAGS) $(CPP_GNURL)
142 gnunet_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
143   libgnunetgns.la \
144   $(top_builddir)/src/identity/libgnunetidentity.la \
145   $(top_builddir)/src/util/libgnunetutil.la \
146   $(GN_LIBINTL)
147 if HAVE_GNUTLS_DANE
148 gnunet_gns_proxy_LDADD += -lgnutls-dane
149 endif
150
151 gnunet_gns_helper_service_w32_SOURCES = \
152   gnunet-gns-helper-service-w32.c
153 gnunet_gns_helper_service_w32_LDADD = \
154   libgnunetgns.la \
155   $(top_builddir)/src/identity/libgnunetidentity.la \
156   $(top_builddir)/src/util/libgnunetutil.la \
157   $(GN_LIBINTL)
158
159 gnunet_gns_import_SOURCES = \
160   gnunet-gns-import.c
161 gnunet_gns_import_LDADD = \
162   $(top_builddir)/src/identity/libgnunetidentity.la \
163   $(top_builddir)/src/namestore/libgnunetnamestore.la \
164   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
165   $(top_builddir)/src/util/libgnunetutil.la \
166   $(GN_LIBINTL)
167
168
169 w32nsp_install_SOURCES = \
170   w32nsp-install.c
171 w32nsp_install_LDADD = -lws2_32
172
173 w32nsp_uninstall_SOURCES = \
174   w32nsp-uninstall.c
175 w32nsp_uninstall_LDADD = -lws2_32
176
177 w32nsp_resolve_SOURCES = \
178   w32nsp-resolve.c
179 w32nsp_resolve_LDADD = -lws2_32
180
181 gnunet_service_gns_SOURCES = \
182  gnunet-service-gns.c \
183  gnunet-service-gns_resolver.c gnunet-service-gns_resolver.h \
184  gnunet-service-gns_shorten.c gnunet-service-gns_shorten.h \
185  gnunet-service-gns_interceptor.c gnunet-service-gns_interceptor.h
186 gnunet_service_gns_LDADD = \
187   -lm \
188   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
189   $(top_builddir)/src/identity/libgnunetidentity.la \
190   $(top_builddir)/src/revocation/libgnunetrevocation.la \
191   $(top_builddir)/src/statistics/libgnunetstatistics.la \
192   $(top_builddir)/src/util/libgnunetutil.la \
193   $(top_builddir)/src/dns/libgnunetdns.la \
194   $(top_builddir)/src/dns/libgnunetdnsparser.la \
195   $(top_builddir)/src/dns/libgnunetdnsstub.la \
196   $(top_builddir)/src/dht/libgnunetdht.la \
197   $(top_builddir)/src/tun/libgnunettun.la \
198   $(top_builddir)/src/namecache/libgnunetnamecache.la \
199   $(top_builddir)/src/namestore/libgnunetnamestore.la \
200   $(USE_VPN) \
201   $(GN_LIBINTL)
202
203
204 libw32nsp_la_SOURCES = \
205   w32nsp.c
206 libw32nsp_la_LIBADD = \
207   -lole32 -lws2_32
208 libw32nsp_la_LDFLAGS = \
209   -export-symbols $(top_srcdir)/src/gns/w32nsp.def \
210   -no-undefined -static-libgcc
211
212 libgnunetgns_la_SOURCES = \
213  gns_api.c gns.h
214 libgnunetgns_la_LIBADD = \
215  $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
216  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
217 libgnunetgns_la_LDFLAGS = \
218   $(GN_LIB_LDFLAGS)
219
220
221 libgnunet_plugin_block_gns_la_SOURCES = \
222   plugin_block_gns.c
223 libgnunet_plugin_block_gns_la_LIBADD = \
224   $(top_builddir)/src/util/libgnunetutil.la \
225   $(top_builddir)/src/block/libgnunetblock.la \
226   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
227 libgnunet_plugin_block_gns_la_LDFLAGS = \
228   $(GN_PLUGIN_LDFLAGS)
229
230 libgnunet_plugin_rest_gns_la_SOURCES = \
231   plugin_rest_gns.c
232 libgnunet_plugin_rest_gns_la_LIBADD = \
233   libgnunetgns.la \
234   $(top_builddir)/src/identity/libgnunetidentity.la \
235   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
236   $(LTLIBINTL) -ljansson -lmicrohttpd
237 libgnunet_plugin_rest_gns_la_LDFLAGS = \
238  $(GN_PLUGIN_LDFLAGS)
239
240
241 check_SCRIPTS = \
242   test_gns_lookup.sh \
243   test_gns_ipv6_lookup.sh\
244   test_gns_txt_lookup.sh\
245   test_gns_mx_lookup.sh \
246   test_gns_gns2dns_lookup.sh \
247   test_gns_dht_lookup.sh\
248   test_gns_delegated_lookup.sh \
249   test_gns_nick_shorten.sh\
250   test_gns_plus_lookup.sh\
251   test_gns_zkey_lookup.sh\
252   test_gns_rel_expiration.sh\
253   test_gns_soa_lookup.sh\
254   test_gns_revocation.sh\
255   test_gns_cname_lookup.sh
256
257 if ENABLE_TEST_RUN
258 if HAVE_SQLITE
259  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
260  TESTS = $(check_SCRIPTS)
261 endif
262 endif