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