Code

Added initial client library implementation.
[sysdb.git] / src / Makefile.am
1 SUBDIRS = liboconfig
3 AM_CFLAGS = @STRICT_CFLAGS@
4 AM_CPPFLAGS  = -Iinclude
5 AM_CPPFLAGS += -DSYSCONFDIR='"${sysconfdir}"'
6 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
7 AM_CPPFLAGS += -DPKGLIBDIR='"${pkglibdir}"'
9 BUILT_SOURCES = include/sysdb.h
11 pkginclude_HEADERS = include/sysdb.h
12 pkgcoreincludedir = $(pkgincludedir)/core
13 pkgcoreinclude_HEADERS = \
14                 include/core/data.h \
15                 include/core/error.h \
16                 include/core/object.h \
17                 include/core/plugin.h \
18                 include/core/store.h \
19                 include/core/time.h
20 pkgfeincludedir = $(pkgincludedir)/frontend
21 pkgfeinclude_HEADERS = \
22                 include/frontend/connection.h \
23                 include/frontend/sock.h
24 pkgutilsincludedir = $(pkgincludedir)/utils
25 pkgutilsinclude_HEADERS = \
26                 include/utils/channel.h \
27                 include/utils/dbi.h \
28                 include/utils/llist.h \
29                 include/utils/proto.h \
30                 include/utils/strbuf.h \
31                 include/utils/unixsock.h
33 pkgclientincludedir = $(pkgincludedir)/client
34 pkgclientinclude_HEADERS = \
35                 include/client/sock.h
37 lib_LTLIBRARIES = libsysdbclient.la libsysdb.la
39 libsysdbclient_la_SOURCES = \
40                 client/sock.c include/client/sock.h
41 libsysdbclient_la_CFLAGS = $(AM_CFLAGS)
42 libsysdbclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
43 libsysdbclient_la_LDFLAGS = -version-info 0:0:0 -pthread
44 libsysdbclient_la_LIBADD = $(LIBLTDL)
46 libsysdb_la_SOURCES = \
47                 sysdb.c include/sysdb.h \
48                 core/object.c include/core/object.h \
49                 core/plugin.c include/core/plugin.h \
50                 core/store.c include/core/store.h \
51                 include/core/data.h \
52                 core/error.c include/core/error.h \
53                 frontend/connection.c include/frontend/connection.h \
54                 include/frontend/connection-private.h \
55                 frontend/sock.c include/frontend/sock.h \
56                 frontend/session.c \
57                 frontend/query.c \
58                 utils/channel.c include/utils/channel.h \
59                 utils/llist.c include/utils/llist.h \
60                 utils/proto.c include/utils/proto.h \
61                 utils/strbuf.c include/utils/strbuf.h \
62                 core/time.c include/core/time.h \
63                 utils/unixsock.c include/utils/unixsock.h
64 libsysdb_la_CFLAGS = $(AM_CFLAGS)
65 libsysdb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
66 libsysdb_la_LDFLAGS = -version-info 0:0:0 -pthread
67 libsysdb_la_LIBADD = $(LIBLTDL) -lrt liboconfig/liboconfig.la
68 libsysdb_la_DEPENDENCIES = liboconfig/liboconfig.la
70 if BUILD_WITH_LIBDBI
71 libsysdb_la_SOURCES += \
72                 utils/dbi.c include/utils/dbi.h
73 libsysdb_la_LIBADD += -ldbi
74 endif
76 bin_PROGRAMS = sysdbd
78 sysdbd_SOURCES = daemon/sysdbd.c include/sysdb.h \
79                 daemon/config.c include/daemon/config.h
80 sysdbd_CFLAGS = $(AM_CFLAGS) -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
81 sysdbd_LDADD = libsysdb.la liboconfig/liboconfig.la
82 sysdbd_DEPENDENCIES = liboconfig/liboconfig.la
84 sdbconfdir = $(sysconfdir)/sysdb
85 dist_sdbconf_DATA = daemon/sysdbd.conf.sample
87 pkgbackendlibdir = $(pkglibdir)/backend
88 pkgbackendcollectdlibdir = $(pkgbackendlibdir)/collectd
89 pkgbackendpuppetlibdir = $(pkgbackendlibdir)/puppet
90 pkgcnamelibdir = $(pkglibdir)/cname
92 pkglib_LTLIBRARIES =
93 pkgbackendlib_LTLIBRARIES =
94 pkgbackendcollectdlib_LTLIBRARIES =
95 pkgbackendpuppetlib_LTLIBRARIES =
96 pkgcnamelib_LTLIBRARIES =
98 if BUILD_PLUGIN_COLLECTD
99 pkgbackendcollectdlib_LTLIBRARIES += backend/collectd/unixsock.la
100 backend_collectd_unixsock_la_SOURCES = backend/collectd/unixsock.c
101 backend_collectd_unixsock_la_LDFLAGS = -module -avoid-version
102 libsysdb_la_LIBADD += -dlopen backend/collectd/unixsock.la
103 libsysdb_la_DEPENDENCIES += backend/collectd/unixsock.la
104 endif
106 if BUILD_PLUGIN_MKLIVESTATUS
107 pkgbackendlib_LTLIBRARIES += backend/mk-livestatus.la
108 backend_mk_livestatus_la_SOURCES = backend/mk-livestatus.c
109 backend_mk_livestatus_la_LDFLAGS = -module -avoid-version
110 libsysdb_la_LIBADD += -dlopen backend/mk-livestatus.la
111 libsysdb_la_DEPENDENCIES += backend/mk-livestatus.la
112 endif
114 if BUILD_PLUGIN_PUPPETSTORECONFIGS
115 pkgbackendpuppetlib_LTLIBRARIES += backend/puppet/store-configs.la
116 backend_puppet_store_configs_la_SOURCES = backend/puppet/store-configs.c
117 backend_puppet_store_configs_la_LDFLAGS = -module -avoid-version
118 libsysdb_la_LIBADD += -dlopen backend/puppet/store-configs.la
119 libsysdb_la_DEPENDENCIES += backend/puppet/store-configs.la
120 endif
122 if BUILD_PLUGIN_SYSLOG
123 pkglib_LTLIBRARIES += plugins/syslog.la
124 plugins_syslog_la_SOURCE = plugins/syslog.c
125 plugins_syslog_la_LDFLAGS = -module -avoid-version
126 libsysdb_la_LIBADD += -dlopen plugins/syslog.la
127 libsysdb_la_DEPENDENCIES += plugins/syslog.la
128 endif
130 if BUILD_PLUGIN_CNAMEDNS
131 pkgcnamelib_LTLIBRARIES += plugins/cname/dns.la
132 plugins_cname_dns_la_SOURCE = plugins/cname/dns.c
133 plugins_cname_dns_la_LDFLAGS = -module -avoid-version
134 libsysdb_la_LIBADD += -dlopen plugins/cname/dns.la
135 libsysdb_la_DEPENDENCIES += plugins/cname/dns.la
136 endif
138 include/sysdb.h: include/sysdb.h.in ../version
139         source ../version; sed \
140             -e "s/@SDB_VERSION_MAJOR@/$$VERSION_MAJOR/g" \
141             -e "s/@SDB_VERSION_MINOR@/$$VERSION_MINOR/g" \
142             -e "s/@SDB_VERSION_PATCH@/$$VERSION_PATCH/g" \
143             -e "s/@SDB_VERSION_EXTRA@/$$VERSION_EXTRA/g" \
144             -e "s/@SDB_VERSION_STRING@/$$VERSION_STRING/g" \
145             include/sysdb.h.in > include/sysdb.h