aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore/Makefile.am
blob: f3b4545f10a42b4705f1bbb24388afd79cd15d2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# This Makefile.am is in the public domain
AM_CPPFLAGS = -I$(top_srcdir)/src/include \
  $(GNUNET_CPPFLAGS)

plugindir = $(libdir)/gnunet

pkgcfgdir= $(pkgdatadir)/config.d/

libexecdir= $(pkglibdir)/libexec/

pkgcfg_DATA = \
  psycstore.conf


if MINGW
 WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
endif

if USE_COVERAGE
  AM_CFLAGS = --coverage -O0
  XLIB = -lgcov
endif

if HAVE_MYSQL
MYSQL_PLUGIN = libgnunet_plugin_psycstore_mysql.la
if HAVE_TESTING
MYSQL_TESTS = test_plugin_psycstore_mysql
endif
endif

if HAVE_POSTGRESQL
POSTGRES_PLUGIN = libgnunet_plugin_psycstore_postgres.la
if HAVE_TESTING
POSTGRES_TESTS = test_plugin_psycstore_postgres
endif
endif

if HAVE_SQLITE
SQLITE_PLUGIN = libgnunet_plugin_psycstore_sqlite.la
if HAVE_TESTING
SQLITE_TESTS = test_plugin_psycstore_sqlite
endif
endif

lib_LTLIBRARIES = libgnunetpsycstore.la

libgnunetpsycstore_la_SOURCES = \
  psycstore_api.c \
  psycstore.h
libgnunetpsycstore_la_LIBADD = \
  -lgnunetutil \
  $(GN_LIBINTL) $(XLIB)
libgnunetpsycstore_la_LDFLAGS = \
  $(GN_LIB_LDFLAGS)  $(WINFLAGS) \
  -version-info 0:0:0

bin_PROGRAMS =

libexec_PROGRAMS = \
 gnunet-service-psycstore

gnunet_service_psycstore_SOURCES = \
 gnunet-service-psycstore.c
gnunet_service_psycstore_LDADD = \
  $(top_builddir)/src/psycutil/libgnunetpsycutil.la \
  -lgnunetstatistics \
  -lgnunetutil \
  $(GN_LIBINTL)

plugin_LTLIBRARIES = \
  $(SQLITE_PLUGIN) \
  $(MYSQL_PLUGIN) \
  $(POSTGRES_PLUGIN)


libgnunet_plugin_psycstore_mysql_la_SOURCES = \
  plugin_psycstore_mysql.c
libgnunet_plugin_psycstore_mysql_la_LIBADD = \
  libgnunetpsycstore.la  \
  -lgnunetmy \
  -lgnunetmysql \
  -lgnunetstatistics \
  -lgnunetutil \
  $(XLIBS) \
  $(LTLIBINTL)
libgnunet_plugin_psycstore_mysql_la_LDFLAGS = \
 $(GN_PLUGIN_LDFLAGS)

libgnunet_plugin_psycstore_postgres_la_SOURCES = \
  plugin_psycstore_postgres.c
libgnunet_plugin_psycstore_postgres_la_LIBADD = \
  libgnunetpsycstore.la  \
  -lgnunetpq \
  -lgnunetstatistics \
  -lgnunetutil \
  $(XLIBS) -lpq \
  $(LTLIBINTL)
libgnunet_plugin_psycstore_postgres_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
libgnunet_plugin_psycstore_postgres_la_CPPFLAGS = \
  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)


libgnunet_plugin_psycstore_sqlite_la_SOURCES = \
  plugin_psycstore_sqlite.c
libgnunet_plugin_psycstore_sqlite_la_LIBADD = \
  libgnunetpsycstore.la  \
  -lgnunetstatistics \
  -lgnunetutil \
  $(XLIBS) -lsqlite3 \
  $(LTLIBINTL)
libgnunet_plugin_psycstore_sqlite_la_LDFLAGS = \
 $(GN_PLUGIN_LDFLAGS)


if HAVE_SQLITE
if HAVE_TESTING
check_PROGRAMS = \
 $(SQLITE_TESTS) \
 $(MYSQL_TESTS) \
 $(POSTGRES_TESTS) \
 test_psycstore
endif
endif

if ENABLE_TEST_RUN
AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
TESTS = $(check_PROGRAMS)
endif

test_psycstore_SOURCES = \
 test_psycstore.c
test_psycstore_LDADD = \
  libgnunetpsycstore.la \
  -lgnunettesting \
  -lgnunetutil

EXTRA_DIST = \
  test_psycstore.conf


test_plugin_psycstore_sqlite_SOURCES = \
 test_plugin_psycstore.c
test_plugin_psycstore_sqlite_LDADD = \
  -lgnunettesting \
  -lgnunetutil

test_plugin_psycstore_mysql_SOURCES = \
 test_plugin_psycstore.c
test_plugin_psycstore_mysql_LDADD = \
  -lgnunettesting \
  -lgnunetutil

test_plugin_psycstore_postgres_SOURCES = \
 test_plugin_psycstore.c
test_plugin_psycstore_postgres_LDADD = \
 -lgnunettesting \
 -lgnunetutil