2c7bb8ebba6a7ae9115e04405c3a363759b75df3
[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 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/util/libgnunetutil.la \
106   $(LTLIBINTL)
107 libgnunet_plugin_gnsrecord_gns_la_LDFLAGS = \
108  $(GN_PLUGIN_LDFLAGS)
109
110
111 gnunet_gns_SOURCES = \
112  gnunet-gns.c
113 gnunet_gns_LDADD = \
114   libgnunetgns.la \
115   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
116   $(top_builddir)/src/util/libgnunetutil.la \
117   $(GN_LIBINTL)
118
119 gnunet_gns_benchmark_SOURCES = \
120  gnunet-gns-benchmark.c
121 gnunet_gns_benchmark_LDADD = \
122   libgnunetgns.la \
123   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
124   $(top_builddir)/src/util/libgnunetutil.la \
125   $(GN_LIBINTL)
126
127
128 gnunet_bcd_SOURCES = \
129  gnunet-bcd.c
130 gnunet_bcd_LDADD = \
131   $(top_builddir)/src/util/libgnunetutil.la \
132   $(GN_LIBINTL) -lmicrohttpd
133
134
135 gnunet_dns2gns_SOURCES = \
136  gnunet-dns2gns.c
137 gnunet_dns2gns_LDADD = \
138   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
139   libgnunetgns.la \
140   $(top_builddir)/src/util/libgnunetutil.la \
141   $(top_builddir)/src/identity/libgnunetidentity.la \
142   $(GN_LIBINTL)
143
144 if LINUX
145 HIJACKBIN = gnunet-dns2gns
146 install-exec-hook:
147         $(SUDO_BINARY) setcap 'cap_net_bind_service=+ep' $(DESTDIR)$(libexecdir)/gnunet-dns2gns || true
148 else
149 install-exec-hook:
150 endif
151
152 gnunet_gns_proxy_SOURCES = \
153  gnunet-gns-proxy.c
154 gnunet_gns_proxy_CPPFLAGS = $(AM_CPPFLAGS) $(CPP_GNURL)
155 gnunet_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
156   libgnunetgns.la \
157   $(top_builddir)/src/identity/libgnunetidentity.la \
158   $(top_builddir)/src/util/libgnunetutil.la \
159   $(GN_LIBINTL)
160 if HAVE_GNUTLS_DANE
161 gnunet_gns_proxy_LDADD += -lgnutls-dane
162 endif
163
164 gnunet_gns_helper_service_w32_SOURCES = \
165   gnunet-gns-helper-service-w32.c
166 gnunet_gns_helper_service_w32_LDADD = \
167   libgnunetgns.la \
168   $(top_builddir)/src/identity/libgnunetidentity.la \
169   $(top_builddir)/src/util/libgnunetutil.la \
170   $(GN_LIBINTL)
171
172 gnunet_gns_import_SOURCES = \
173   gnunet-gns-import.c
174 gnunet_gns_import_LDADD = \
175   $(top_builddir)/src/identity/libgnunetidentity.la \
176   $(top_builddir)/src/namestore/libgnunetnamestore.la \
177   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
178   $(top_builddir)/src/util/libgnunetutil.la \
179   $(GN_LIBINTL)
180
181
182 w32nsp_install_SOURCES = \
183   w32nsp-install.c
184 w32nsp_install_LDADD = -lws2_32
185
186 w32nsp_uninstall_SOURCES = \
187   w32nsp-uninstall.c
188 w32nsp_uninstall_LDADD = -lws2_32
189
190 w32nsp_resolve_SOURCES = \
191   w32nsp-resolve.c
192 w32nsp_resolve_LDADD = -lws2_32
193
194 gnunet_service_gns_SOURCES = \
195  gnunet-service-gns.c gnunet-service-gns.h \
196  gnunet-service-gns_resolver.c gnunet-service-gns_resolver.h \
197  gnunet-service-gns_interceptor.c gnunet-service-gns_interceptor.h
198 gnunet_service_gns_LDADD = \
199   -lm \
200   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
201   $(top_builddir)/src/identity/libgnunetidentity.la \
202   $(top_builddir)/src/revocation/libgnunetrevocation.la \
203   $(top_builddir)/src/statistics/libgnunetstatistics.la \
204   $(top_builddir)/src/util/libgnunetutil.la \
205   $(top_builddir)/src/dns/libgnunetdns.la \
206   $(top_builddir)/src/dht/libgnunetdht.la \
207   $(top_builddir)/src/namecache/libgnunetnamecache.la \
208   $(USE_VPN) \
209   $(GN_LIBINTL)
210
211
212 libw32nsp_la_SOURCES = \
213   w32nsp.c
214 libw32nsp_la_LIBADD = \
215   -lole32 -lws2_32
216 libw32nsp_la_LDFLAGS = \
217   -export-symbols $(top_srcdir)/src/gns/w32nsp.def \
218   -no-undefined -static-libgcc
219
220 libgnunetgns_la_SOURCES = \
221  gns_api.c gns_api.h \
222  gns_tld_api.c gns.h
223 libgnunetgns_la_LIBADD = \
224  $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
225  $(top_builddir)/src/identity/libgnunetidentity.la \
226  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
227 libgnunetgns_la_LDFLAGS = \
228   $(GN_LIB_LDFLAGS)
229
230
231 libgnunet_plugin_block_gns_la_SOURCES = \
232   plugin_block_gns.c
233 libgnunet_plugin_block_gns_la_LIBADD = \
234   $(top_builddir)/src/util/libgnunetutil.la \
235   $(top_builddir)/src/block/libgnunetblock.la \
236   $(top_builddir)/src/block/libgnunetblockgroup.la \
237   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
238 libgnunet_plugin_block_gns_la_LDFLAGS = \
239   $(GN_PLUGIN_LDFLAGS)
240
241 libgnunet_plugin_rest_gns_la_SOURCES = \
242   plugin_rest_gns.c
243 libgnunet_plugin_rest_gns_la_LIBADD = \
244   libgnunetgns.la \
245         $(top_builddir)/src/rest/libgnunetrest.la \
246   $(top_builddir)/src/identity/libgnunetidentity.la \
247         $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
248   $(top_builddir)/src/jsonapi/libgnunetjsonapiutils.la \
249   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
250   $(LTLIBINTL) -ljansson -lmicrohttpd
251 libgnunet_plugin_rest_gns_la_LDFLAGS = \
252  $(GN_PLUGIN_LDFLAGS)
253
254
255 check_SCRIPTS = \
256   test_gns_lookup.sh \
257   test_gns_ipv6_lookup.sh\
258   test_gns_txt_lookup.sh\
259   test_gns_mx_lookup.sh \
260   test_gns_gns2dns_lookup.sh \
261   test_gns_gns2dns_cname_lookup.sh \
262   test_gns_dht_lookup.sh\
263   test_gns_delegated_lookup.sh \
264   test_gns_at_lookup.sh\
265   test_gns_zkey_lookup.sh\
266   test_gns_rel_expiration.sh\
267   test_gns_soa_lookup.sh\
268   test_gns_revocation.sh\
269   test_gns_cname_lookup.sh
270
271 if ENABLE_TEST_RUN
272 if HAVE_SQLITE
273  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
274  TESTS = $(check_SCRIPTS)
275 endif
276 endif