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