make some more use of libgnunetpq
[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 HAVE_REST
75 REST_PLUGIN=libgnunet_plugin_rest_namestore.la
76 endif
77
78 if ENABLE_TEST_RUN
79 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
80 TESTS = \
81   $(check_PROGRAMS) \
82   $(check_SCRIPTS)
83 endif
84
85 lib_LTLIBRARIES = \
86   libgnunetnamestore.la
87
88
89 libgnunetnamestore_la_SOURCES = \
90   namestore_api.c \
91   namestore_api_monitor.c \
92   namestore.h
93 libgnunetnamestore_la_LIBADD = \
94   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
95   $(top_builddir)/src/statistics/libgnunetstatistics.la \
96   $(top_builddir)/src/dns/libgnunetdnsparser.la \
97   $(top_builddir)/src/util/libgnunetutil.la \
98   $(GN_LIBINTL)
99 libgnunetnamestore_la_LDFLAGS = \
100   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
101   -version-info 0:1:0
102
103 libexec_PROGRAMS = \
104  gnunet-service-namestore
105
106 bin_PROGRAMS = \
107  gnunet-namestore
108
109 if HAVE_MHD
110 libexec_PROGRAMS += \
111  gnunet-namestore-fcfsd
112 endif
113
114
115 gnunet_namestore_SOURCES = \
116  gnunet-namestore.c
117 gnunet_namestore_LDADD = \
118   $(top_builddir)/src/identity/libgnunetidentity.la \
119   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
120   $(top_builddir)/src/util/libgnunetutil.la \
121   libgnunetnamestore.la \
122   $(GN_LIBINTL)
123
124
125 gnunet_namestore_fcfsd_SOURCES = \
126  gnunet-namestore-fcfsd.c
127 gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
128   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
129   $(top_builddir)/src/identity/libgnunetidentity.la \
130   libgnunetnamestore.la \
131   $(top_builddir)/src/util/libgnunetutil.la \
132   $(GN_LIBINTL)
133
134
135
136 gnunet_service_namestore_SOURCES = \
137  gnunet-service-namestore.c
138
139 gnunet_service_namestore_LDADD = \
140   $(top_builddir)/src/namecache/libgnunetnamecache.la \
141   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
142   $(top_builddir)/src/statistics/libgnunetstatistics.la \
143   $(top_builddir)/src/util/libgnunetutil.la \
144   libgnunetnamestore.la \
145   $(GN_LIBINTL)
146
147
148 plugin_LTLIBRARIES = \
149   $(SQLITE_PLUGIN) \
150   $(POSTGRES_PLUGIN) \
151         $(FLAT_PLUGIN) \
152         $(REST_PLUGIN)
153
154
155
156 libgnunet_plugin_namestore_flat_la_SOURCES = \
157   plugin_namestore_flat.c
158 libgnunet_plugin_namestore_flat_la_LIBADD = \
159   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
160   $(top_builddir)/src/statistics/libgnunetstatistics.la \
161   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
162   $(LTLIBINTL)
163 libgnunet_plugin_namestore_flat_la_LDFLAGS = \
164  $(GN_PLUGIN_LDFLAGS)
165
166
167 libgnunet_plugin_namestore_sqlite_la_SOURCES = \
168   plugin_namestore_sqlite.c
169 libgnunet_plugin_namestore_sqlite_la_LIBADD = \
170   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
171   $(top_builddir)/src/statistics/libgnunetstatistics.la \
172   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
173   $(LTLIBINTL)
174 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
175  $(GN_PLUGIN_LDFLAGS)
176
177 libgnunet_plugin_namestore_postgres_la_SOURCES = \
178   plugin_namestore_postgres.c
179 libgnunet_plugin_namestore_postgres_la_LIBADD = \
180   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
181   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
182   $(top_builddir)/src/pq/libgnunetpq.la  \
183   $(top_builddir)/src/statistics/libgnunetstatistics.la \
184   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
185   $(LTLIBINTL)
186 libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
187  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
188
189 libgnunet_plugin_rest_namestore_la_SOURCES = \
190   plugin_rest_namestore.c
191 libgnunet_plugin_rest_namestore_la_LIBADD = \
192   libgnunetnamestore.la \
193   $(top_builddir)/src/rest/libgnunetrest.la \
194   $(top_builddir)/src/identity/libgnunetidentity.la \
195   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
196   $(LTLIBINTL) -ljansson -lmicrohttpd
197 libgnunet_plugin_rest_namestore_la_LDFLAGS = \
198  $(GN_PLUGIN_LDFLAGS)
199
200
201 test_namestore_api_store_SOURCES = \
202  test_namestore_api_store.c
203 test_namestore_api_store_LDADD = \
204   $(top_builddir)/src/testing/libgnunettesting.la \
205   $(top_builddir)/src/util/libgnunetutil.la \
206   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
207   libgnunetnamestore.la
208
209 test_namestore_api_store_update_SOURCES = \
210  test_namestore_api_store_update.c
211 test_namestore_api_store_update_LDADD = \
212   $(top_builddir)/src/testing/libgnunettesting.la \
213   $(top_builddir)/src/util/libgnunetutil.la \
214   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
215   $(top_builddir)/src/namecache/libgnunetnamecache.la \
216   libgnunetnamestore.la
217
218 test_namestore_api_lookup_public_SOURCES = \
219  test_namestore_api_lookup_public.c
220 test_namestore_api_lookup_public_LDADD = \
221   $(top_builddir)/src/testing/libgnunettesting.la \
222   $(top_builddir)/src/util/libgnunetutil.la \
223   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
224   $(top_builddir)/src/namecache/libgnunetnamecache.la \
225   libgnunetnamestore.la
226
227 test_namestore_api_lookup_nick_SOURCES = \
228  test_namestore_api_lookup_nick.c
229 test_namestore_api_lookup_nick_LDADD = \
230   $(top_builddir)/src/testing/libgnunettesting.la \
231   $(top_builddir)/src/util/libgnunetutil.la \
232   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
233   $(top_builddir)/src/namecache/libgnunetnamecache.la \
234   libgnunetnamestore.la
235
236 test_namestore_api_lookup_private_SOURCES = \
237  test_namestore_api_lookup_private.c
238 test_namestore_api_lookup_private_LDADD = \
239   $(top_builddir)/src/testing/libgnunettesting.la \
240   $(top_builddir)/src/util/libgnunetutil.la \
241   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
242   $(top_builddir)/src/namecache/libgnunetnamecache.la \
243   libgnunetnamestore.la
244
245 test_namestore_api_lookup_shadow_SOURCES = \
246  test_namestore_api_lookup_shadow.c
247 test_namestore_api_lookup_shadow_LDADD = \
248   $(top_builddir)/src/testing/libgnunettesting.la \
249   $(top_builddir)/src/util/libgnunetutil.la \
250   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
251   $(top_builddir)/src/namecache/libgnunetnamecache.la \
252   libgnunetnamestore.la
253
254 test_namestore_api_lookup_shadow_filter_SOURCES = \
255  test_namestore_api_lookup_shadow_filter.c
256 test_namestore_api_lookup_shadow_filter_LDADD = \
257   $(top_builddir)/src/testing/libgnunettesting.la \
258   $(top_builddir)/src/util/libgnunetutil.la \
259   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
260   $(top_builddir)/src/namecache/libgnunetnamecache.la \
261   libgnunetnamestore.la
262
263 test_namestore_api_remove_SOURCES = \
264  test_namestore_api_remove.c
265 test_namestore_api_remove_LDADD = \
266   $(top_builddir)/src/testing/libgnunettesting.la \
267   $(top_builddir)/src/util/libgnunetutil.la \
268   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
269   libgnunetnamestore.la
270
271 test_namestore_api_remove_not_existing_record_SOURCES = \
272  test_namestore_api_remove_not_existing_record.c
273 test_namestore_api_remove_not_existing_record_LDADD = \
274   $(top_builddir)/src/testing/libgnunettesting.la \
275   $(top_builddir)/src/util/libgnunetutil.la \
276   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
277   libgnunetnamestore.la
278
279 #test_namestore_api_zone_to_name_SOURCES = \
280 # test_namestore_api_zone_to_name.c
281 #test_namestore_api_zone_to_name_LDADD = \
282 #  $(top_builddir)/src/testing/libgnunettesting.la \
283 #  $(top_builddir)/src/util/libgnunetutil.la \
284 #  libgnunetnamestore.la
285
286 test_namestore_api_monitoring_SOURCES = \
287  test_namestore_api_monitoring.c
288 test_namestore_api_monitoring_LDADD = \
289   $(top_builddir)/src/testing/libgnunettesting.la \
290   libgnunetnamestore.la \
291   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
292   $(top_builddir)/src/util/libgnunetutil.la
293
294 test_namestore_api_monitoring_existing_SOURCES = \
295  test_namestore_api_monitoring_existing.c
296 test_namestore_api_monitoring_existing_LDADD = \
297   $(top_builddir)/src/testing/libgnunettesting.la \
298   libgnunetnamestore.la \
299   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
300   $(top_builddir)/src/util/libgnunetutil.la
301
302 test_namestore_api_zone_iteration_SOURCES = \
303  test_namestore_api_zone_iteration.c
304 test_namestore_api_zone_iteration_LDADD = \
305   $(top_builddir)/src/testing/libgnunettesting.la \
306   $(top_builddir)/src/util/libgnunetutil.la \
307   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
308   libgnunetnamestore.la
309
310 test_namestore_api_zone_iteration_nick_SOURCES = \
311  test_namestore_api_zone_iteration_nick.c
312 test_namestore_api_zone_iteration_nick_LDADD = \
313   $(top_builddir)/src/testing/libgnunettesting.la \
314   $(top_builddir)/src/util/libgnunetutil.la \
315   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
316   libgnunetnamestore.la
317
318
319 test_namestore_api_zone_iteration_specific_zone_SOURCES = \
320  test_namestore_api_zone_iteration_specific_zone.c
321 test_namestore_api_zone_iteration_specific_zone_LDADD = \
322   $(top_builddir)/src/testing/libgnunettesting.la \
323   $(top_builddir)/src/util/libgnunetutil.la \
324   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
325   libgnunetnamestore.la
326
327 test_namestore_api_zone_iteration_stop_SOURCES = \
328  test_namestore_api_zone_iteration_stop.c
329 test_namestore_api_zone_iteration_stop_LDADD = \
330   $(top_builddir)/src/testing/libgnunettesting.la \
331   $(top_builddir)/src/util/libgnunetutil.la \
332   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
333   libgnunetnamestore.la
334
335 test_plugin_namestore_flat_SOURCES = \
336  test_plugin_namestore.c
337 test_plugin_namestore_flat_LDADD = \
338  $(top_builddir)/src/testing/libgnunettesting.la \
339  $(top_builddir)/src/util/libgnunetutil.la
340
341 test_plugin_namestore_sqlite_SOURCES = \
342  test_plugin_namestore.c
343 test_plugin_namestore_sqlite_LDADD = \
344  $(top_builddir)/src/testing/libgnunettesting.la \
345  $(top_builddir)/src/util/libgnunetutil.la
346
347 test_plugin_namestore_postgres_SOURCES = \
348  test_plugin_namestore.c
349 test_plugin_namestore_postgres_LDADD = \
350  $(top_builddir)/src/testing/libgnunettesting.la \
351  $(top_builddir)/src/util/libgnunetutil.la
352
353 check_SCRIPTS = \
354         test_namestore_put.sh \
355         test_namestore_lookup.sh \
356         test_namestore_delete.sh
357
358 EXTRA_DIST = \
359   test_namestore_api.conf \
360   test_plugin_namestore_sqlite.conf \
361   test_plugin_namestore_postgres.conf \
362         test_plugin_namestore_flat.conf \
363   test_hostkey \
364   zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
365   zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
366   zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
367   zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
368   $(check_SCRIPTS)
369