Code

connection: Renamed sdb_connection_read to sdb_connection_handle.
[sysdb.git] / src / Makefile.am
1 SUBDIRS = liboconfig
3 # coverage related flags are only set when gcov is enabled
4 AM_CFLAGS = @STRICT_CFLAGS@ @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@
5 AM_CXXFLAGS = @STRICT_CXXFLAGS@ @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@
6 AM_LDFLAGS = @COVERAGE_LDFLAGS@ @PROFILING_LDFLAGS@
7 AM_CPPFLAGS  = -I"${top_srcdir}/src/include"
8 AM_CPPFLAGS += -DSYSCONFDIR='"${sysconfdir}"'
9 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
10 AM_CPPFLAGS += -DPKGLIBDIR='"${pkglibdir}"'
12 AM_YFLAGS = -d
14 BUILT_SOURCES = include/client/sysdb.h include/sysdb.h \
15                 frontend/grammar.h
16 EXTRA_DIST = include/client/sysdb.h.in include/sysdb.h.in
18 pkginclude_HEADERS = include/sysdb.h
19 pkgcoreincludedir = $(pkgincludedir)/core
20 pkgcoreinclude_HEADERS = \
21                 include/core/data.h \
22                 include/core/object.h \
23                 include/core/plugin.h \
24                 include/core/store.h \
25                 include/core/time.h \
26                 include/core/timeseries.h
27 pkgfeincludedir = $(pkgincludedir)/frontend
28 pkgfeinclude_HEADERS = \
29                 include/frontend/connection.h \
30                 include/frontend/parser.h \
31                 include/frontend/proto.h \
32                 include/frontend/sock.h
33 pkgutilsincludedir = $(pkgincludedir)/utils
34 pkgutilsinclude_HEADERS = \
35                 include/utils/avltree.h \
36                 include/utils/channel.h \
37                 include/utils/dbi.h \
38                 include/utils/error.h \
39                 include/utils/llist.h \
40                 include/utils/os.h \
41                 include/utils/proto.h \
42                 include/utils/strbuf.h \
43                 include/utils/unixsock.h
45 pkgclientincludedir = $(pkgincludedir)/client
46 pkgclientinclude_HEADERS = \
47                 include/client/sock.h \
48                 include/client/sysdb.h
50 noinst_LTLIBRARIES = libsysdbclient.la libsysdb.la
52 libsysdbclient_la_SOURCES = \
53                 client/client.c include/client/sysdb.h \
54                 client/sock.c include/client/sock.h \
55                 utils/error.c include/utils/error.h \
56                 utils/proto.c include/utils/proto.h \
57                 utils/strbuf.c include/utils/strbuf.h
58 libsysdbclient_la_CFLAGS = $(AM_CFLAGS)
59 libsysdbclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
60 libsysdbclient_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 -pthread
61 libsysdbclient_la_LIBADD = $(LIBLTDL)
63 # don't use strict CFLAGS for flex code
64 noinst_LTLIBRARIES += libsysdb_fe_parser.la
65 libsysdb_fe_parser_la_SOURCES = \
66                 frontend/grammar.y frontend/scanner.l
67 libsysdb_fe_parser_la_CFLAGS = @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@ \
68                 -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
69 libsysdb_la_SOURCES = \
70                 sysdb.c include/sysdb.h \
71                 core/object.c include/core/object.h \
72                 core/plugin.c include/core/plugin.h \
73                 core/store.c include/core/store.h \
74                 core/store-private.h \
75                 core/store_expr.c \
76                 core/store_json.c \
77                 core/store_lookup.c \
78                 core/data.c include/core/data.h \
79                 core/timeseries.c include/core/timeseries.h \
80                 frontend/analyzer.c \
81                 frontend/connection.c include/frontend/connection.h \
82                 frontend/connection-private.h \
83                 frontend/parser.c include/frontend/parser.h \
84                 frontend/sock.c include/frontend/sock.h \
85                 frontend/session.c \
86                 frontend/query.c \
87                 utils/avltree.c include/utils/avltree.h \
88                 utils/channel.c include/utils/channel.h \
89                 utils/error.c include/utils/error.h \
90                 utils/llist.c include/utils/llist.h \
91                 utils/os.c include/utils/os.h \
92                 utils/proto.c include/utils/proto.h \
93                 utils/strbuf.c include/utils/strbuf.h \
94                 core/time.c include/core/time.h \
95                 utils/unixsock.c include/utils/unixsock.h
96 libsysdb_la_CFLAGS = $(AM_CFLAGS)
97 libsysdb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
98 libsysdb_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 -pthread -lm
99 libsysdb_la_LIBADD = libsysdb_fe_parser.la \
100                 $(LIBLTDL) -lrt liboconfig/liboconfig.la
101 libsysdb_la_DEPENDENCIES = libsysdb_fe_parser.la liboconfig/liboconfig.la
103 if BUILD_WITH_LIBDBI
104 libsysdb_la_SOURCES += \
105                 utils/dbi.c include/utils/dbi.h
106 libsysdb_la_LIBADD += -ldbi
107 endif
109 bin_PROGRAMS = sysdbd
110 if BUILD_CLIENT
111 bin_PROGRAMS += sysdb
113 # don't use strict CFLAGS for flex code
114 noinst_LTLIBRARIES += libsysdb_scanner.la
115 libsysdb_scanner_la_SOURCES = tools/sysdb/scanner.l
116 libsysdb_scanner_la_CFLAGS = @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@ \
117                 -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
118 sysdb_SOURCES = tools/sysdb/main.c include/client/sysdb.h \
119                 tools/sysdb/command.c tools/sysdb/command.h \
120                 tools/sysdb/input.c tools/sysdb/input.h \
121                 core/object.c include/core/object.h \
122                 utils/llist.c include/utils/llist.h \
123                 utils/os.c include/utils/os.h
124 sysdb_CFLAGS = -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\"" \
125                 $(AM_CFLAGS) @READLINE_CFLAGS@
126 sysdb_LDADD = libsysdb_scanner.la libsysdbclient.la @READLINE_LIBS@
127 endif
129 sysdbd_SOURCES = tools/sysdbd/main.c include/sysdb.h \
130                 tools/sysdbd/configfile.c tools/sysdbd/configfile.h \
131                 $(libsysdb_la_SOURCES)
132 sysdbd_CFLAGS = $(AM_CFLAGS) -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
133 sysdbd_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
134 sysdbd_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -pthread -lm
135 sysdbd_LDADD = libsysdb_fe_parser.la liboconfig/liboconfig.la \
136                 $(LIBLTDL) -lrt
137 sysdbd_DEPENDENCIES = libsysdb_fe_parser.la liboconfig/liboconfig.la
139 if BUILD_WITH_LIBDBI
140 sysdbd_LDADD += -ldbi
141 endif
143 sdbconfdir = $(sysconfdir)/sysdb
144 dist_sdbconf_DATA = tools/sysdbd/sysdbd.conf.sample
146 pkgbackendlibdir = $(pkglibdir)/backend
147 pkgbackendcollectdlibdir = $(pkgbackendlibdir)/collectd
148 pkgbackendpuppetlibdir = $(pkgbackendlibdir)/puppet
149 pkgcnamelibdir = $(pkglibdir)/cname
150 pkgtimeserieslibdir = $(pkglibdir)/timeseries
152 pkglib_LTLIBRARIES =
153 pkgbackendlib_LTLIBRARIES =
154 pkgbackendcollectdlib_LTLIBRARIES =
155 pkgbackendpuppetlib_LTLIBRARIES =
156 pkgcnamelib_LTLIBRARIES =
157 pkgtimeserieslib_LTLIBRARIES =
159 if BUILD_PLUGIN_CNAMEDNS
160 pkgcnamelib_LTLIBRARIES += plugins/cname/dns.la
161 plugins_cname_dns_la_SOURCE = plugins/cname/dns.c
162 plugins_cname_dns_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
163 sysdbd_LDADD += -dlopen plugins/cname/dns.la
164 sysdbd_DEPENDENCIES += plugins/cname/dns.la
165 endif
167 if BUILD_PLUGIN_COLLECTDUNIXSOCK
168 pkgbackendcollectdlib_LTLIBRARIES += plugins/backend/collectd/unixsock.la
169 plugins_backend_collectd_unixsock_la_SOURCES = plugins/backend/collectd/unixsock.c
170 plugins_backend_collectd_unixsock_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
171 sysdbd_LDADD += -dlopen plugins/backend/collectd/unixsock.la
172 sysdbd_DEPENDENCIES += plugins/backend/collectd/unixsock.la
173 endif
175 if BUILD_PLUGIN_FACTER
176 pkgbackendlib_LTLIBRARIES += plugins/backend/facter.la
177 plugins_backend_facter_la_SOURCES = plugins/backend/facter.cc
178 plugins_backend_facter_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -lfacter
179 sysdbd_LDADD += -dlopen plugins/backend/facter.la
180 sysdbd_DEPENDENCIES += plugins/backend/facter.la
181 endif
183 if BUILD_PLUGIN_MKLIVESTATUS
184 pkgbackendlib_LTLIBRARIES += plugins/backend/mk-livestatus.la
185 plugins_backend_mk_livestatus_la_SOURCES = plugins/backend/mk-livestatus.c
186 plugins_backend_mk_livestatus_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
187 sysdbd_LDADD += -dlopen plugins/backend/mk-livestatus.la
188 sysdbd_DEPENDENCIES += plugins/backend/mk-livestatus.la
189 endif
191 if BUILD_PLUGIN_PUPPETSTORECONFIGS
192 pkgbackendpuppetlib_LTLIBRARIES += plugins/backend/puppet/store-configs.la
193 plugins_backend_puppet_store_configs_la_SOURCES = plugins/backend/puppet/store-configs.c
194 plugins_backend_puppet_store_configs_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
195 sysdbd_LDADD += -dlopen plugins/backend/puppet/store-configs.la
196 sysdbd_DEPENDENCIES += plugins/backend/puppet/store-configs.la
197 endif
199 if BUILD_PLUGIN_SYSLOG
200 pkglib_LTLIBRARIES += plugins/syslog.la
201 plugins_syslog_la_SOURCE = plugins/syslog.c
202 plugins_syslog_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
203 sysdbd_LDADD += -dlopen plugins/syslog.la
204 sysdbd_DEPENDENCIES += plugins/syslog.la
205 endif
207 if BUILD_PLUGIN_TIMESERIESRRDTOOL
208 pkgtimeserieslib_LTLIBRARIES += plugins/timeseries/rrdtool.la
209 plugins_timeseries_rrdtool_la_SOURCES = plugins/timeseries/rrdtool.c
210 plugins_timeseries_rrdtool_la_CFLAGS = $(AM_CFLAGS) @RRD_CFLAGS@
211 plugins_timeseries_rrdtool_la_LDFLAGS = $(AM_LDFLAGS) @RRD_LIBS@ -module -avoid-version
212 sysdbd_LDADD += -dlopen plugins/timeseries/rrdtool.la
213 sysdbd_DEPENDENCIES += plugins/timeseries/rrdtool.la
214 endif
216 include/client/sysdb.h: include/client/sysdb.h.in ../version
217         source ../version; sed \
218             -e "s/@SDB_VERSION_MAJOR@/$$VERSION_MAJOR/g" \
219             -e "s/@SDB_VERSION_MINOR@/$$VERSION_MINOR/g" \
220             -e "s/@SDB_VERSION_PATCH@/$$VERSION_PATCH/g" \
221             -e "s/@SDB_VERSION_EXTRA@/$$VERSION_EXTRA/g" \
222             -e "s/@SDB_VERSION_STRING@/$$VERSION_STRING/g" \
223             include/client/sysdb.h.in > include/client/sysdb.h
225 include/sysdb.h: include/sysdb.h.in ../version
226         source ../version; sed \
227             -e "s/@SDB_VERSION_MAJOR@/$$VERSION_MAJOR/g" \
228             -e "s/@SDB_VERSION_MINOR@/$$VERSION_MINOR/g" \
229             -e "s/@SDB_VERSION_PATCH@/$$VERSION_PATCH/g" \
230             -e "s/@SDB_VERSION_EXTRA@/$$VERSION_EXTRA/g" \
231             -e "s/@SDB_VERSION_STRING@/$$VERSION_STRING/g" \
232             include/sysdb.h.in > include/sysdb.h
234 ../version:
235         cd .. && make version