getting mysql to work
[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
55 plugin_LTLIBRARIES = \
56   $(SQLITE_PLUGIN) \
57   $(MYSQL_PLUGIN) \
58   libgnunet_plugin_datastore_template.la 
59
60
61 libgnunet_plugin_datastore_sqlite_la_SOURCES = \
62   plugin_datastore_sqlite.c
63 libgnunet_plugin_datastore_sqlite_la_LIBADD = \
64   $(top_builddir)/src/statistics/libgnunetstatistics.la \
65   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3
66 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
67  $(GN_PLUGIN_LDFLAGS)
68
69
70 libgnunet_plugin_datastore_mysql_la_SOURCES = \
71   plugin_datastore_mysql.c
72 libgnunet_plugin_datastore_mysql_la_LIBADD = \
73   $(top_builddir)/src/statistics/libgnunetstatistics.la \
74   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lsqlite3
75 libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
76  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
77 libgnunet_plugin_datastore_sqlite_la_CPFLAGS = \
78  $(MYSQL_CPPFLAGS)
79
80
81 libgnunet_plugin_datastore_template_la_SOURCES = \
82   plugin_datastore_template.c
83 libgnunet_plugin_datastore_template_la_LIBADD = \
84   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS)
85 libgnunet_plugin_datastore_template_la_LDFLAGS = \
86  $(GN_PLUGIN_LDFLAGS)
87
88 check_PROGRAMS = \
89   $(SQLITE_TESTS) \
90   $(MYSQL_TESTS)
91
92 if !DISABLE_TEST_RUN
93 TESTS = $(check_PROGRAMS)
94 endif
95
96 test_datastore_api_sqlite_SOURCES = \
97  test_datastore_api.c
98 test_datastore_api_sqlite_LDADD = \
99  $(top_builddir)/src/datastore/libgnunetdatastore.la \
100  $(top_builddir)/src/util/libgnunetutil.la  
101
102 test_datastore_api_management_sqlite_SOURCES = \
103  test_datastore_api_management.c
104 test_datastore_api_management_sqlite_LDADD = \
105  $(top_builddir)/src/datastore/libgnunetdatastore.la \
106  $(top_builddir)/src/util/libgnunetutil.la  
107
108 perf_datastore_api_sqlite_SOURCES = \
109  perf_datastore_api.c
110 perf_datastore_api_sqlite_LDADD = \
111  $(top_builddir)/src/datastore/libgnunetdatastore.la \
112  $(top_builddir)/src/util/libgnunetutil.la  
113
114 perf_plugin_datastore_sqlite_SOURCES = \
115  perf_plugin_datastore.c
116 perf_plugin_datastore_sqlite_LDADD = \
117  $(top_builddir)/src/util/libgnunetutil.la  
118
119
120 test_datastore_api_mysql_SOURCES = \
121  test_datastore_api.c
122 test_datastore_api_mysql_LDADD = \
123  $(top_builddir)/src/datastore/libgnunetdatastore.la \
124  $(top_builddir)/src/util/libgnunetutil.la  
125
126 test_datastore_api_management_mysql_SOURCES = \
127  test_datastore_api_management.c
128 test_datastore_api_management_mysql_LDADD = \
129  $(top_builddir)/src/datastore/libgnunetdatastore.la \
130  $(top_builddir)/src/util/libgnunetutil.la  
131
132 perf_datastore_api_mysql_SOURCES = \
133  perf_datastore_api.c
134 perf_datastore_api_mysql_LDADD = \
135  $(top_builddir)/src/datastore/libgnunetdatastore.la \
136  $(top_builddir)/src/util/libgnunetutil.la  
137
138 perf_plugin_datastore_mysql_SOURCES = \
139  perf_plugin_datastore.c
140 perf_plugin_datastore_mysql_LDADD = \
141  $(top_builddir)/src/util/libgnunetutil.la  
142
143
144 EXTRA_DIST = \
145  test_datastore_api_data_sqlite.conf \
146  perf_plugin_datastore_data_sqlite.conf \
147  test_datastore_api_data_mysql.conf \
148  perf_plugin_datastore_data_mysql.conf