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