b2b81d73f1b1fef5af4fbbbfaca3111d70831bc3
[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 if HAVE_MHD
80 if LINUX
81 bin_PROGRAMS += gnunet-bcd
82 endif
83 endif
84
85 bin_SCRIPTS = gnunet-gns-proxy-setup-ca
86
87 plugin_LTLIBRARIES = \
88   libgnunet_plugin_block_gns.la \
89   libgnunet_plugin_gnsrecord_gns.la
90
91
92 if HAVE_MHD
93 if HAVE_JSON
94 plugin_LTLIBRARIES += libgnunet_plugin_rest_gns.la
95 endif
96 endif
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/util/libgnunetutil.la \
115   $(GN_LIBINTL)
116
117
118 gnunet_bcd_SOURCES = \
119  gnunet-bcd.c
120 gnunet_bcd_LDADD = \
121   $(top_builddir)/src/util/libgnunetutil.la \
122   $(GN_LIBINTL) -lmicrohttpd
123
124
125 gnunet_dns2gns_SOURCES = \
126  gnunet-dns2gns.c
127 gnunet_dns2gns_LDADD = \
128   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
129   libgnunetgns.la \
130   $(top_builddir)/src/util/libgnunetutil.la \
131   $(top_builddir)/src/identity/libgnunetidentity.la \
132   $(top_builddir)/src/dns/libgnunetdnsparser.la \
133   $(top_builddir)/src/dns/libgnunetdnsstub.la \
134   $(GN_LIBINTL)
135
136 if LINUX
137 HIJACKBIN = gnunet-dns2gns
138 install-exec-hook:
139         $(SUDO_BINARY) setcap 'cap_net_bind_service=+ep' $(DESTDIR)$(libexecdir)/gnunet-dns2gns || true
140 else
141 install-exec-hook:
142 endif
143
144 gnunet_gns_proxy_SOURCES = \
145  gnunet-gns-proxy.c
146 gnunet_gns_proxy_CPPFLAGS = $(AM_CPPFLAGS) $(CPP_GNURL)
147 gnunet_gns_proxy_LDADD = -lmicrohttpd $(LIB_GNURL) -lgnutls \
148   libgnunetgns.la \
149   $(top_builddir)/src/identity/libgnunetidentity.la \
150   $(top_builddir)/src/util/libgnunetutil.la \
151   $(GN_LIBINTL)
152 if HAVE_GNUTLS_DANE
153 gnunet_gns_proxy_LDADD += -lgnutls-dane
154 endif
155
156 gnunet_gns_helper_service_w32_SOURCES = \
157   gnunet-gns-helper-service-w32.c
158 gnunet_gns_helper_service_w32_LDADD = \
159   libgnunetgns.la \
160   $(top_builddir)/src/identity/libgnunetidentity.la \
161   $(top_builddir)/src/util/libgnunetutil.la \
162   $(GN_LIBINTL)
163
164 gnunet_gns_import_SOURCES = \
165   gnunet-gns-import.c
166 gnunet_gns_import_LDADD = \
167   $(top_builddir)/src/identity/libgnunetidentity.la \
168   $(top_builddir)/src/namestore/libgnunetnamestore.la \
169   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
170   $(top_builddir)/src/util/libgnunetutil.la \
171   $(GN_LIBINTL)
172
173
174 w32nsp_install_SOURCES = \
175   w32nsp-install.c
176 w32nsp_install_LDADD = -lws2_32
177
178 w32nsp_uninstall_SOURCES = \
179   w32nsp-uninstall.c
180 w32nsp_uninstall_LDADD = -lws2_32
181
182 w32nsp_resolve_SOURCES = \
183   w32nsp-resolve.c
184 w32nsp_resolve_LDADD = -lws2_32
185
186 gnunet_service_gns_SOURCES = \
187  gnunet-service-gns.c gnunet-service-gns.h \
188  gnunet-service-gns_resolver.c gnunet-service-gns_resolver.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   $(USE_VPN) \
204   $(GN_LIBINTL)
205
206
207 libw32nsp_la_SOURCES = \
208   w32nsp.c
209 libw32nsp_la_LIBADD = \
210   -lole32 -lws2_32
211 libw32nsp_la_LDFLAGS = \
212   -export-symbols $(top_srcdir)/src/gns/w32nsp.def \
213   -no-undefined -static-libgcc
214
215 libgnunetgns_la_SOURCES = \
216  gns_api.c gns_api.h \
217  gns_tld_api.c gns.h
218 libgnunetgns_la_LIBADD = \
219  $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
220  $(top_builddir)/src/identity/libgnunetidentity.la \
221  $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
222 libgnunetgns_la_LDFLAGS = \
223   $(GN_LIB_LDFLAGS)
224
225
226 libgnunet_plugin_block_gns_la_SOURCES = \
227   plugin_block_gns.c
228 libgnunet_plugin_block_gns_la_LIBADD = \
229   $(top_builddir)/src/util/libgnunetutil.la \
230   $(top_builddir)/src/block/libgnunetblock.la \
231   $(top_builddir)/src/block/libgnunetblockgroup.la \
232   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la
233 libgnunet_plugin_block_gns_la_LDFLAGS = \
234   $(GN_PLUGIN_LDFLAGS)
235
236 libgnunet_plugin_rest_gns_la_SOURCES = \
237   plugin_rest_gns.c
238 libgnunet_plugin_rest_gns_la_LIBADD = \
239   libgnunetgns.la \
240         $(top_builddir)/src/rest/libgnunetrest.la \
241   $(top_builddir)/src/identity/libgnunetidentity.la \
242         $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
243   $(top_builddir)/src/jsonapi/libgnunetjsonapiutils.la \
244   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
245   $(LTLIBINTL) -ljansson -lmicrohttpd
246 libgnunet_plugin_rest_gns_la_LDFLAGS = \
247  $(GN_PLUGIN_LDFLAGS)
248
249
250 check_SCRIPTS = \
251   test_gns_lookup.sh \
252   test_gns_ipv6_lookup.sh\
253   test_gns_txt_lookup.sh\
254   test_gns_mx_lookup.sh \
255   test_gns_gns2dns_lookup.sh \
256   test_gns_dht_lookup.sh\
257   test_gns_delegated_lookup.sh \
258   test_gns_at_lookup.sh\
259   test_gns_zkey_lookup.sh\
260   test_gns_rel_expiration.sh\
261   test_gns_soa_lookup.sh\
262   test_gns_revocation.sh\
263   test_gns_cname_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;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
268  TESTS = $(check_SCRIPTS)
269 endif
270 endif