add integer overflow guards and avoid (unlimited) stack allocation
[oweals/gnunet.git] / src / peerstore / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 plugindir = $(libdir)/gnunet
5
6 pkgcfgdir= $(pkgdatadir)/config.d/
7
8 libexecdir= $(pkglibdir)/libexec/
9
10 dist_pkgcfg_DATA = \
11   peerstore.conf
12
13 if USE_COVERAGE
14   AM_CFLAGS = -fprofile-arcs -ftest-coverage
15 endif
16
17 bin_PROGRAMS = \
18  gnunet-peerstore
19
20 libexec_PROGRAMS = \
21  gnunet-service-peerstore
22
23 lib_LTLIBRARIES = \
24  libgnunetpeerstore.la
25
26 gnunet_peerstore_SOURCES = \
27  gnunet-peerstore.c
28 gnunet_peerstore_LDADD = \
29   $(top_builddir)/src/util/libgnunetutil.la \
30   libgnunetpeerstore.la \
31   $(GN_LIBINTL)
32
33 gnunet_service_peerstore_SOURCES = \
34  gnunet-service-peerstore.c \
35  peerstore_common.c peerstore_common.h \
36  peerstore.h
37 gnunet_service_peerstore_CFLAGS = $(AM_CFLAGS)
38 gnunet_service_peerstore_LDADD = \
39   $(top_builddir)/src/util/libgnunetutil.la \
40   $(GN_LIBINTL)
41
42 libgnunetpeerstore_la_SOURCES = \
43   peerstore_api.c \
44   peerstore_common.c
45 libgnunetpeerstore_la_LIBADD = \
46   $(top_builddir)/src/util/libgnunetutil.la
47 libgnunetpeerstore_la_LDFLAGS = \
48   $(GN_LIBINTL) \
49   $(GN_LIB_LDFLAGS)
50
51 if HAVE_EXPERIMENTAL
52 FLAT_PLUGIN = libgnunet_plugin_peerstore_flat.la
53 FLAT_TESTS = test_plugin_peerstore_flat
54 libgnunet_plugin_peerstore_flat_la_SOURCES = \
55   plugin_peerstore_flat.c
56 libgnunet_plugin_peerstore_flat_la_LIBADD = \
57   libgnunetpeerstore.la  \
58   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
59   $(LTLIBINTL)
60 libgnunet_plugin_peerstore_flat_la_LDFLAGS = \
61  $(GN_PLUGIN_LDFLAGS)
62 endif
63
64 if HAVE_SQLITE
65 SQLITE_PLUGIN = libgnunet_plugin_peerstore_sqlite.la
66 if HAVE_TESTING
67 SQLITE_TESTS = test_plugin_peerstore_sqlite
68 endif
69 libgnunet_plugin_peerstore_sqlite_la_SOURCES = \
70   plugin_peerstore_sqlite.c
71 libgnunet_plugin_peerstore_sqlite_la_LIBADD = \
72   libgnunetpeerstore.la  \
73   $(top_builddir)/src/sq/libgnunetsq.la \
74   $(top_builddir)/src/util/libgnunetutil.la \
75   $(XLIBS) -lsqlite3 \
76   $(LTLIBINTL)
77 libgnunet_plugin_peerstore_sqlite_la_LDFLAGS = \
78  $(GN_PLUGIN_LDFLAGS)
79 endif
80
81 plugin_LTLIBRARIES = \
82   $(SQLITE_PLUGIN) \
83         $(FLAT_PLUGIN)
84
85 test_plugin_peerstore_sqlite_SOURCES = \
86   test_plugin_peerstore.c
87 test_plugin_peerstore_sqlite_LDADD = \
88         $(top_builddir)/src/testing/libgnunettesting.la \
89         $(top_builddir)/src/util/libgnunetutil.la
90
91 test_plugin_peerstore_flat_SOURCES = \
92   test_plugin_peerstore.c
93 test_plugin_peerstore_flat_LDADD = \
94         $(top_builddir)/src/testing/libgnunettesting.la \
95         $(top_builddir)/src/util/libgnunetutil.la
96
97 check_PROGRAMS = \
98  test_peerstore_api_store \
99  test_peerstore_api_iterate \
100  test_peerstore_api_watch \
101  test_peerstore_api_sync \
102  perf_peerstore_store \
103  $(SQLITE_TESTS) \
104  $(FLAT_TESTS)
105
106 EXTRA_DIST = \
107  test_peerstore_api_data.conf \
108  test_plugin_peerstore_flat.conf \
109  test_plugin_peerstore_sqlite.conf
110
111 if ENABLE_TEST_RUN
112 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
113 TESTS = $(check_PROGRAMS)
114 endif
115
116 test_peerstore_api_store_SOURCES = \
117  test_peerstore_api_store.c
118 test_peerstore_api_store_LDADD = \
119   libgnunetpeerstore.la  \
120   $(top_builddir)/src/testing/libgnunettesting.la \
121   $(top_builddir)/src/util/libgnunetutil.la
122
123 test_peerstore_api_iterate_SOURCES = \
124  test_peerstore_api_iterate.c
125 test_peerstore_api_iterate_LDADD = \
126   libgnunetpeerstore.la  \
127   $(top_builddir)/src/testing/libgnunettesting.la \
128   $(top_builddir)/src/util/libgnunetutil.la
129
130 test_peerstore_api_watch_SOURCES = \
131  test_peerstore_api_watch.c
132 test_peerstore_api_watch_LDADD = \
133   libgnunetpeerstore.la  \
134   $(top_builddir)/src/testing/libgnunettesting.la \
135   $(top_builddir)/src/util/libgnunetutil.la
136
137 test_peerstore_api_sync_SOURCES = \
138  test_peerstore_api_sync.c
139 test_peerstore_api_sync_LDADD = \
140   libgnunetpeerstore.la  \
141   $(top_builddir)/src/testing/libgnunettesting.la \
142   $(top_builddir)/src/util/libgnunetutil.la
143
144 perf_peerstore_store_SOURCES = \
145  perf_peerstore_store.c
146 perf_peerstore_store_LDADD = \
147   libgnunetpeerstore.la  \
148   $(top_builddir)/src/testing/libgnunettesting.la \
149   $(top_builddir)/src/util/libgnunetutil.la