Include libpq-fe.h instead of postgres/libpq-fe.h.
[oweals/gnunet.git] / src / namecache / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 pkgcfgdir= $(pkgdatadir)/config.d/
6
7 libexecdir= $(pkglibdir)/libexec/
8
9 pkgcfg_DATA = \
10    namecache.conf
11
12
13 if MINGW
14   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = --coverage -O0
19   XLIBS = -lgcov
20 endif
21
22 if HAVE_SQLITE
23 SQLITE_PLUGIN = libgnunet_plugin_namecache_sqlite.la
24 if HAVE_TESTING
25 SQLITE_TESTS = test_plugin_namecache_sqlite
26 endif
27 endif
28
29 if HAVE_POSTGRESQL
30 POSTGRES_PLUGIN = libgnunet_plugin_namecache_postgres.la
31 if HAVE_TESTING
32 POSTGRES_TESTS = test_plugin_namecache_postgres
33 endif
34 endif
35
36 # testcases do not even build yet; thus: experimental!
37 if HAVE_TESTING
38 TESTING_TESTS = \
39  test_namecache_api_cache_block
40 endif
41
42 if HAVE_SQLITE
43 check_PROGRAMS = \
44  $(SQLITE_TESTS) \
45  $(POSTGRES_TESTS) \
46  $(TESTING_TESTS)
47 endif
48
49 if ENABLE_TEST_RUN
50 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
51 TESTS = \
52   $(check_PROGRAMS)
53 endif
54
55 lib_LTLIBRARIES = \
56   libgnunetnamecache.la
57
58
59 libgnunetnamecache_la_SOURCES = \
60   namecache_api.c \
61   namecache.h
62 libgnunetnamecache_la_LIBADD = \
63   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
64   $(top_builddir)/src/util/libgnunetutil.la \
65   $(GN_LIBINTL)
66 libgnunetnamecache_la_LDFLAGS = \
67   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
68   -version-info 0:0:0
69
70
71 libexec_PROGRAMS = \
72  gnunet-service-namecache
73
74 bin_PROGRAMS = \
75  gnunet-namecache
76
77 gnunet_namecache_SOURCES = \
78  gnunet-namecache.c
79 gnunet_namecache_LDADD = \
80   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
81   $(top_builddir)/src/util/libgnunetutil.la \
82   libgnunetnamecache.la \
83   $(GN_LIBINTL)
84 gnunet_namecache_DEPENDENCIES = \
85   $(top_builddir)/src/identity/libgnunetidentity.la \
86   $(top_builddir)/src/util/libgnunetutil.la \
87   libgnunetnamecache.la
88
89
90 gnunet_service_namecache_SOURCES = \
91  gnunet-service-namecache.c
92
93 gnunet_service_namecache_LDADD = \
94   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
95   $(top_builddir)/src/statistics/libgnunetstatistics.la \
96   $(top_builddir)/src/util/libgnunetutil.la \
97   libgnunetnamecache.la \
98   $(GN_LIBINTL)
99 gnunet_service_namecache_DEPENDENCIES = \
100   $(top_builddir)/src/statistics/libgnunetstatistics.la \
101   $(top_builddir)/src/util/libgnunetutil.la \
102   libgnunetnamecache.la
103
104
105 plugin_LTLIBRARIES = \
106   $(SQLITE_PLUGIN) \
107   $(POSTGRES_PLUGIN)
108
109 libgnunet_plugin_namecache_sqlite_la_SOURCES = \
110   plugin_namecache_sqlite.c
111 libgnunet_plugin_namecache_sqlite_la_LIBADD = \
112   $(top_builddir)/src/namecache/libgnunetnamecache.la  \
113   $(top_builddir)/src/statistics/libgnunetstatistics.la \
114   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
115   $(LTLIBINTL)
116 libgnunet_plugin_namecache_sqlite_la_LDFLAGS = \
117  $(GN_PLUGIN_LDFLAGS)
118 libgnunet_plugin_namecache_sqlite_la_DEPENDENCIES = \
119   $(top_builddir)/src/statistics/libgnunetstatistics.la \
120   $(top_builddir)/src/util/libgnunetutil.la \
121   libgnunetnamecache.la
122
123
124 libgnunet_plugin_namecache_postgres_la_SOURCES = \
125   plugin_namecache_postgres.c
126 libgnunet_plugin_namecache_postgres_la_LIBADD = \
127   $(top_builddir)/src/namecache/libgnunetnamecache.la  \
128   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
129   $(top_builddir)/src/statistics/libgnunetstatistics.la \
130   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
131   $(LTLIBINTL)
132 libgnunet_plugin_namecache_postgres_la_LDFLAGS = \
133  $(GN_PLUGIN_LDFLAGS)
134 libgnunet_plugin_namecache_postgres_la_DEPENDENCIES = \
135   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
136   $(top_builddir)/src/statistics/libgnunetstatistics.la \
137   $(top_builddir)/src/util/libgnunetutil.la \
138   libgnunetnamecache.la
139
140 test_namecache_api_cache_block_SOURCES = \
141  test_namecache_api_cache_block.c
142 test_namecache_api_cache_block_LDADD = \
143   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
144   $(top_builddir)/src/namecache/libgnunetnamecache.la \
145   $(top_builddir)/src/testing/libgnunettesting.la \
146   $(top_builddir)/src/util/libgnunetutil.la
147
148 test_plugin_namecache_sqlite_SOURCES = \
149  test_plugin_namecache.c
150 test_plugin_namecache_sqlite_LDADD = \
151  $(top_builddir)/src/testing/libgnunettesting.la \
152  $(top_builddir)/src/util/libgnunetutil.la
153
154 test_plugin_namecache_postgres_SOURCES = \
155  test_plugin_namecache.c
156 test_plugin_namecache_postgres_LDADD = \
157  $(top_builddir)/src/testing/libgnunettesting.la \
158  $(top_builddir)/src/util/libgnunetutil.la
159
160 EXTRA_DIST = \
161   test_namecache_api.conf \
162   test_plugin_namecache_sqlite.conf \
163   test_plugin_namecache_postgres.conf 
164