avoid disconnect on cancel
[oweals/gnunet.git] / src / datastore / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 if MINGW
6   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
7 endif
8
9 if USE_COVERAGE
10   AM_CFLAGS = --coverage -O0
11   XLIBS = -lgcov
12 endif
13
14
15 lib_LTLIBRARIES = \
16   libgnunetdatastore.la
17
18 libgnunetdatastore_la_SOURCES = \
19   datastore_api.c datastore.h plugin_datastore.h
20 libgnunetdatastore_la_LIBADD = \
21   $(top_builddir)/src/util/libgnunetutil.la \
22   $(GN_LIBINTL) 
23 libgnunetdatastore_la_LDFLAGS = \
24   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
25   -version-info 0:0:0
26
27
28 bin_PROGRAMS = \
29  gnunet-service-datastore
30
31 gnunet_service_datastore_SOURCES = \
32  gnunet-service-datastore.c plugin_datastore.h
33 gnunet_service_datastore_LDADD = \
34   $(top_builddir)/src/statistics/libgnunetstatistics.la \
35   $(top_builddir)/src/util/libgnunetutil.la \
36   $(GN_LIBINTL)
37
38 if HAVE_MYSQL
39  MYSQL_PLUGIN = libgnunet_plugin_datastore_mysql.la
40  MYSQL_TESTS = \
41   test_datastore_api_mysql \
42   test_datastore_api_management_mysql \
43   perf_datastore_api_mysql \
44   perf_plugin_datastore_mysql
45 endif
46 if HAVE_SQLITE
47  SQLITE_PLUGIN = libgnunet_plugin_datastore_sqlite.la
48  SQLITE_TESTS = \
49   test_datastore_api_sqlite \
50   test_datastore_api_management_sqlite \
51   perf_datastore_api_sqlite \
52   perf_plugin_datastore_sqlite
53 endif
54 if HAVE_POSTGRES
55  POSTGRES_PLUGIN = libgnunet_plugin_datastore_postgres.la
56  POSTGRES_TESTS = \
57   test_datastore_api_postgres \
58   test_datastore_api_management_postgres \
59   perf_datastore_api_postgres \
60   perf_plugin_datastore_postgres
61 endif
62
63 plugin_LTLIBRARIES = \
64   $(SQLITE_PLUGIN) \
65   $(MYSQL_PLUGIN) \
66   $(POSTGRES_PLUGIN) \
67   libgnunet_plugin_datastore_template.la 
68
69
70 libgnunet_plugin_datastore_sqlite_la_SOURCES = \
71   plugin_datastore_sqlite.c
72 libgnunet_plugin_datastore_sqlite_la_LIBADD = \
73   $(top_builddir)/src/statistics/libgnunetstatistics.la \
74   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3
75 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
76  $(GN_PLUGIN_LDFLAGS)
77
78
79 libgnunet_plugin_datastore_mysql_la_SOURCES = \
80   plugin_datastore_mysql.c
81 libgnunet_plugin_datastore_mysql_la_LIBADD = \
82   $(top_builddir)/src/statistics/libgnunetstatistics.la \
83   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lmysqlclient
84 libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
85  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
86 libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
87  $(MYSQL_CPPFLAGS)
88
89 libgnunet_plugin_datastore_postgres_la_SOURCES = \
90   plugin_datastore_postgres.c
91 libgnunet_plugin_datastore_postgres_la_LIBADD = \
92   $(top_builddir)/src/statistics/libgnunetstatistics.la \
93   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
94 libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
95  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
96 libgnunet_plugin_datastore_postgres_la_CPPFLAGS = \
97  $(POSTGRES_CPPFLAGS)
98
99
100 libgnunet_plugin_datastore_template_la_SOURCES = \
101   plugin_datastore_template.c
102 libgnunet_plugin_datastore_template_la_LIBADD = \
103   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS)
104 libgnunet_plugin_datastore_template_la_LDFLAGS = \
105  $(GN_PLUGIN_LDFLAGS)
106
107 check_PROGRAMS = \
108   $(SQLITE_TESTS) \
109   $(MYSQL_TESTS) \
110   $(POSTGRES_TESTS)
111
112 if !DISABLE_TEST_RUN
113 TESTS = $(check_PROGRAMS)
114 endif
115
116 test_datastore_api_sqlite_SOURCES = \
117  test_datastore_api.c
118 test_datastore_api_sqlite_LDADD = \
119  $(top_builddir)/src/datastore/libgnunetdatastore.la \
120  $(top_builddir)/src/util/libgnunetutil.la  
121
122 test_datastore_api_management_sqlite_SOURCES = \
123  test_datastore_api_management.c
124 test_datastore_api_management_sqlite_LDADD = \
125  $(top_builddir)/src/datastore/libgnunetdatastore.la \
126  $(top_builddir)/src/util/libgnunetutil.la  
127
128 perf_datastore_api_sqlite_SOURCES = \
129  perf_datastore_api.c
130 perf_datastore_api_sqlite_LDADD = \
131  $(top_builddir)/src/datastore/libgnunetdatastore.la \
132  $(top_builddir)/src/util/libgnunetutil.la  
133
134 perf_plugin_datastore_sqlite_SOURCES = \
135  perf_plugin_datastore.c
136 perf_plugin_datastore_sqlite_LDADD = \
137  $(top_builddir)/src/util/libgnunetutil.la  
138
139
140 test_datastore_api_mysql_SOURCES = \
141  test_datastore_api.c
142 test_datastore_api_mysql_LDADD = \
143  $(top_builddir)/src/datastore/libgnunetdatastore.la \
144  $(top_builddir)/src/util/libgnunetutil.la  
145
146 test_datastore_api_management_mysql_SOURCES = \
147  test_datastore_api_management.c
148 test_datastore_api_management_mysql_LDADD = \
149  $(top_builddir)/src/datastore/libgnunetdatastore.la \
150  $(top_builddir)/src/util/libgnunetutil.la  
151
152 perf_datastore_api_mysql_SOURCES = \
153  perf_datastore_api.c
154 perf_datastore_api_mysql_LDADD = \
155  $(top_builddir)/src/datastore/libgnunetdatastore.la \
156  $(top_builddir)/src/util/libgnunetutil.la  
157
158 perf_plugin_datastore_mysql_SOURCES = \
159  perf_plugin_datastore.c
160 perf_plugin_datastore_mysql_LDADD = \
161  $(top_builddir)/src/util/libgnunetutil.la  
162
163
164 test_datastore_api_postgres_SOURCES = \
165  test_datastore_api.c
166 test_datastore_api_postgres_LDADD = \
167  $(top_builddir)/src/datastore/libgnunetdatastore.la \
168  $(top_builddir)/src/util/libgnunetutil.la  
169
170 test_datastore_api_management_postgres_SOURCES = \
171  test_datastore_api_management.c
172 test_datastore_api_management_postgres_LDADD = \
173  $(top_builddir)/src/datastore/libgnunetdatastore.la \
174  $(top_builddir)/src/util/libgnunetutil.la  
175
176 perf_datastore_api_postgres_SOURCES = \
177  perf_datastore_api.c
178 perf_datastore_api_postgres_LDADD = \
179  $(top_builddir)/src/datastore/libgnunetdatastore.la \
180  $(top_builddir)/src/util/libgnunetutil.la  
181
182 perf_plugin_datastore_postgres_SOURCES = \
183  perf_plugin_datastore.c
184 perf_plugin_datastore_postgres_LDADD = \
185  $(top_builddir)/src/util/libgnunetutil.la  
186
187
188 EXTRA_DIST = \
189  test_datastore_api_data_sqlite.conf \
190  perf_plugin_datastore_data_sqlite.conf \
191  test_datastore_api_data_mysql.conf \
192  perf_plugin_datastore_data_mysql.conf \
193  test_datastore_api_data_postgres.conf \
194  perf_plugin_datastore_data_postgres.conf