More fixes for #3522
[oweals/gnunet.git] / src / namestore / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include $(POSTGRESQL_CPPFLAGS)
2
3 plugindir = $(libdir)/gnunet
4
5 pkgcfgdir= $(pkgdatadir)/config.d/
6
7 libexecdir= $(pkglibdir)/libexec/
8
9 pkgcfg_DATA = \
10    namestore.conf
11
12
13 if MINGW
14   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = --coverage -O0
19   XLIBS = -lgcov
20 endif
21
22 if HAVE_SQLITE
23 SQLITE_PLUGIN = libgnunet_plugin_namestore_sqlite.la
24 if HAVE_TESTING
25 SQLITE_TESTS = test_plugin_namestore_sqlite
26 endif
27 endif
28
29 if HAVE_POSTGRESQL
30 # postgres doesn't even build yet; thus: experimental!
31 POSTGRES_PLUGIN = libgnunet_plugin_namestore_postgres.la
32 if HAVE_TESTING
33 POSTGRES_TESTS = test_plugin_namestore_postgres
34 endif
35 endif
36
37 # testcases do not even build yet; thus: experimental!
38 if HAVE_TESTING
39 TESTING_TESTS = \
40  test_namestore_api_store \
41  test_namestore_api_store_update \
42  test_namestore_api_lookup_public \
43  test_namestore_api_lookup_private \
44  test_namestore_api_lookup_nick \
45  test_namestore_api_lookup_shadow \
46  test_namestore_api_lookup_shadow_filter \
47  test_namestore_api_remove \
48  test_namestore_api_remove_not_existing_record \
49  test_namestore_api_zone_iteration \
50  test_namestore_api_zone_iteration_nick \
51  test_namestore_api_zone_iteration_specific_zone \
52  test_namestore_api_zone_iteration_stop \
53  test_namestore_api_monitoring \
54  test_namestore_api_monitoring_existing
55 # test_namestore_api_zone_to_name
56 endif
57
58 if HAVE_SQLITE
59 check_PROGRAMS = \
60  $(SQLITE_TESTS) \
61  $(POSTGRES_TESTS) \
62  $(TESTING_TESTS)
63 endif
64
65 if ENABLE_TEST_RUN
66 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
67 TESTS = \
68   $(check_PROGRAMS) \
69   $(check_SCRIPTS)
70 endif
71
72 lib_LTLIBRARIES = \
73   libgnunetnamestore.la
74
75 libgnunetnamestore_la_SOURCES = \
76   namestore_api.c \
77   namestore_api_monitor.c \
78   namestore.h
79 libgnunetnamestore_la_LIBADD = \
80   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
81   $(top_builddir)/src/statistics/libgnunetstatistics.la \
82   $(top_builddir)/src/dns/libgnunetdnsparser.la \
83   $(top_builddir)/src/util/libgnunetutil.la \
84   $(GN_LIBINTL)
85 libgnunetnamestore_la_LDFLAGS = \
86   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
87   -version-info 0:1:0
88
89 libexec_PROGRAMS = \
90  gnunet-service-namestore
91
92 bin_PROGRAMS = \
93  gnunet-namestore
94
95 if HAVE_MHD
96 libexec_PROGRAMS += \
97  gnunet-namestore-fcfsd
98 endif
99
100 gnunet_namestore_SOURCES = \
101  gnunet-namestore.c
102 gnunet_namestore_LDADD = \
103   $(top_builddir)/src/identity/libgnunetidentity.la \
104   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
105   $(top_builddir)/src/util/libgnunetutil.la \
106   libgnunetnamestore.la \
107   $(GN_LIBINTL)
108 gnunet_namestore_DEPENDENCIES = \
109   $(top_builddir)/src/identity/libgnunetidentity.la \
110   $(top_builddir)/src/util/libgnunetutil.la \
111   libgnunetnamestore.la
112
113
114 gnunet_namestore_fcfsd_SOURCES = \
115  gnunet-namestore-fcfsd.c
116 gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
117   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
118   $(top_builddir)/src/identity/libgnunetidentity.la \
119   $(top_builddir)/src/namestore/libgnunetnamestore.la \
120   $(top_builddir)/src/util/libgnunetutil.la \
121   $(GN_LIBINTL)
122 gnunet_namestore_fcfsd_DEPENDENCIES = \
123   $(top_builddir)/src/util/libgnunetutil.la \
124   libgnunetnamestore.la
125
126
127
128 gnunet_service_namestore_SOURCES = \
129  gnunet-service-namestore.c
130
131 gnunet_service_namestore_LDADD = \
132   $(top_builddir)/src/namecache/libgnunetnamecache.la \
133   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
134   $(top_builddir)/src/statistics/libgnunetstatistics.la \
135   $(top_builddir)/src/util/libgnunetutil.la \
136   libgnunetnamestore.la \
137   $(GN_LIBINTL)
138 gnunet_service_namestore_DEPENDENCIES = \
139   $(top_builddir)/src/statistics/libgnunetstatistics.la \
140   $(top_builddir)/src/util/libgnunetutil.la \
141   libgnunetnamestore.la
142
143
144 plugin_LTLIBRARIES = \
145   $(SQLITE_PLUGIN) \
146   $(POSTGRES_PLUGIN)
147
148 libgnunet_plugin_namestore_sqlite_la_SOURCES = \
149   plugin_namestore_sqlite.c
150 libgnunet_plugin_namestore_sqlite_la_LIBADD = \
151   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
152   $(top_builddir)/src/statistics/libgnunetstatistics.la \
153   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
154   $(LTLIBINTL)
155 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
156  $(GN_PLUGIN_LDFLAGS)
157 libgnunet_plugin_namestore_sqlite_la_DEPENDENCIES = \
158   $(top_builddir)/src/statistics/libgnunetstatistics.la \
159   $(top_builddir)/src/util/libgnunetutil.la \
160   libgnunetnamestore.la
161
162
163 libgnunet_plugin_namestore_postgres_la_SOURCES = \
164   plugin_namestore_postgres.c
165 libgnunet_plugin_namestore_postgres_la_LIBADD = \
166   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
167   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
168   $(top_builddir)/src/statistics/libgnunetstatistics.la \
169   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
170   $(LTLIBINTL)
171 libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
172  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
173 libgnunet_plugin_namestore_postgres_la_DEPENDENCIES = \
174   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
175   $(top_builddir)/src/statistics/libgnunetstatistics.la \
176   $(top_builddir)/src/util/libgnunetutil.la \
177   libgnunetnamestore.la
178
179 test_namestore_api_store_SOURCES = \
180  test_namestore_api_store.c
181 test_namestore_api_store_LDADD = \
182   $(top_builddir)/src/testing/libgnunettesting.la \
183   $(top_builddir)/src/util/libgnunetutil.la \
184   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
185   $(top_builddir)/src/namestore/libgnunetnamestore.la
186
187 test_namestore_api_store_update_SOURCES = \
188  test_namestore_api_store_update.c
189 test_namestore_api_store_update_LDADD = \
190   $(top_builddir)/src/testing/libgnunettesting.la \
191   $(top_builddir)/src/util/libgnunetutil.la \
192   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
193   $(top_builddir)/src/namecache/libgnunetnamecache.la \
194   $(top_builddir)/src/namestore/libgnunetnamestore.la
195
196 test_namestore_api_lookup_public_SOURCES = \
197  test_namestore_api_lookup_public.c
198 test_namestore_api_lookup_public_LDADD = \
199   $(top_builddir)/src/testing/libgnunettesting.la \
200   $(top_builddir)/src/util/libgnunetutil.la \
201   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
202   $(top_builddir)/src/namecache/libgnunetnamecache.la \
203   $(top_builddir)/src/namestore/libgnunetnamestore.la
204
205 test_namestore_api_lookup_nick_SOURCES = \
206  test_namestore_api_lookup_nick.c
207 test_namestore_api_lookup_nick_LDADD = \
208   $(top_builddir)/src/testing/libgnunettesting.la \
209   $(top_builddir)/src/util/libgnunetutil.la \
210   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
211   $(top_builddir)/src/namecache/libgnunetnamecache.la \
212   $(top_builddir)/src/namestore/libgnunetnamestore.la
213
214 test_namestore_api_lookup_private_SOURCES = \
215  test_namestore_api_lookup_private.c
216 test_namestore_api_lookup_private_LDADD = \
217   $(top_builddir)/src/testing/libgnunettesting.la \
218   $(top_builddir)/src/util/libgnunetutil.la \
219   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
220   $(top_builddir)/src/namecache/libgnunetnamecache.la \
221   $(top_builddir)/src/namestore/libgnunetnamestore.la
222
223 test_namestore_api_lookup_shadow_SOURCES = \
224  test_namestore_api_lookup_shadow.c
225 test_namestore_api_lookup_shadow_LDADD = \
226   $(top_builddir)/src/testing/libgnunettesting.la \
227   $(top_builddir)/src/util/libgnunetutil.la \
228   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
229   $(top_builddir)/src/namecache/libgnunetnamecache.la \
230   $(top_builddir)/src/namestore/libgnunetnamestore.la
231
232 test_namestore_api_lookup_shadow_filter_SOURCES = \
233  test_namestore_api_lookup_shadow_filter.c
234 test_namestore_api_lookup_shadow_filter_LDADD = \
235   $(top_builddir)/src/testing/libgnunettesting.la \
236   $(top_builddir)/src/util/libgnunetutil.la \
237   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
238   $(top_builddir)/src/namecache/libgnunetnamecache.la \
239   $(top_builddir)/src/namestore/libgnunetnamestore.la
240
241 test_namestore_api_remove_SOURCES = \
242  test_namestore_api_remove.c
243 test_namestore_api_remove_LDADD = \
244   $(top_builddir)/src/testing/libgnunettesting.la \
245   $(top_builddir)/src/util/libgnunetutil.la \
246   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
247   $(top_builddir)/src/namestore/libgnunetnamestore.la
248
249 test_namestore_api_remove_not_existing_record_SOURCES = \
250  test_namestore_api_remove_not_existing_record.c
251 test_namestore_api_remove_not_existing_record_LDADD = \
252   $(top_builddir)/src/testing/libgnunettesting.la \
253   $(top_builddir)/src/util/libgnunetutil.la \
254   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
255   $(top_builddir)/src/namestore/libgnunetnamestore.la
256
257 #test_namestore_api_zone_to_name_SOURCES = \
258 # test_namestore_api_zone_to_name.c
259 #test_namestore_api_zone_to_name_LDADD = \
260 #  $(top_builddir)/src/testing/libgnunettesting.la \
261 #  $(top_builddir)/src/util/libgnunetutil.la \
262 #  $(top_builddir)/src/namestore/libgnunetnamestore.la
263
264 test_namestore_api_monitoring_SOURCES = \
265  test_namestore_api_monitoring.c
266 test_namestore_api_monitoring_LDADD = \
267   $(top_builddir)/src/testing/libgnunettesting.la \
268   $(top_builddir)/src/namestore/libgnunetnamestore.la \
269   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
270   $(top_builddir)/src/util/libgnunetutil.la
271
272 test_namestore_api_monitoring_existing_SOURCES = \
273  test_namestore_api_monitoring_existing.c
274 test_namestore_api_monitoring_existing_LDADD = \
275   $(top_builddir)/src/testing/libgnunettesting.la \
276   $(top_builddir)/src/namestore/libgnunetnamestore.la \
277   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
278   $(top_builddir)/src/util/libgnunetutil.la
279
280 test_namestore_api_zone_iteration_SOURCES = \
281  test_namestore_api_zone_iteration.c
282 test_namestore_api_zone_iteration_LDADD = \
283   $(top_builddir)/src/testing/libgnunettesting.la \
284   $(top_builddir)/src/util/libgnunetutil.la \
285   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
286   $(top_builddir)/src/namestore/libgnunetnamestore.la
287
288 test_namestore_api_zone_iteration_nick_SOURCES = \
289  test_namestore_api_zone_iteration_nick.c
290 test_namestore_api_zone_iteration_nick_LDADD = \
291   $(top_builddir)/src/testing/libgnunettesting.la \
292   $(top_builddir)/src/util/libgnunetutil.la \
293   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
294   $(top_builddir)/src/namestore/libgnunetnamestore.la
295
296
297 test_namestore_api_zone_iteration_specific_zone_SOURCES = \
298  test_namestore_api_zone_iteration_specific_zone.c
299 test_namestore_api_zone_iteration_specific_zone_LDADD = \
300   $(top_builddir)/src/testing/libgnunettesting.la \
301   $(top_builddir)/src/util/libgnunetutil.la \
302   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
303   $(top_builddir)/src/namestore/libgnunetnamestore.la
304
305 test_namestore_api_zone_iteration_stop_SOURCES = \
306  test_namestore_api_zone_iteration_stop.c
307 test_namestore_api_zone_iteration_stop_LDADD = \
308   $(top_builddir)/src/testing/libgnunettesting.la \
309   $(top_builddir)/src/util/libgnunetutil.la \
310   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
311   $(top_builddir)/src/namestore/libgnunetnamestore.la
312
313 test_plugin_namestore_sqlite_SOURCES = \
314  test_plugin_namestore.c
315 test_plugin_namestore_sqlite_LDADD = \
316  $(top_builddir)/src/testing/libgnunettesting.la \
317  $(top_builddir)/src/util/libgnunetutil.la
318
319 test_plugin_namestore_postgres_SOURCES = \
320  test_plugin_namestore.c
321 test_plugin_namestore_postgres_LDADD = \
322  $(top_builddir)/src/testing/libgnunettesting.la \
323  $(top_builddir)/src/util/libgnunetutil.la
324
325 check_SCRIPTS = \
326         test_namestore_put.sh \
327         test_namestore_lookup.sh \
328         test_namestore_delete.sh
329
330 EXTRA_DIST = \
331   test_namestore_api.conf \
332   test_plugin_namestore_sqlite.conf \
333   test_plugin_namestore_postgres.conf \
334   test_hostkey \
335   zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
336   zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
337   zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
338   zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
339   $(check_SCRIPTS)
340