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