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