1 AM_CPPFLAGS = -I$(top_srcdir)/src
2 AM_CPPFLAGS += -DPREFIX='"${prefix}"'
3 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
4 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
5 AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
6 if BUILD_FEATURE_DAEMON
7 AM_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
9 AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
10 AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
12 # Link to these libraries..
17 if BUILD_WITH_LIBPOSIX4
18 COMMON_LIBS += -lposix4
20 if BUILD_WITH_LIBSOCKET
21 COMMON_LIBS += -lsocket
23 if BUILD_WITH_LIBRESOLV
24 COMMON_LIBS += -lresolv
26 if BUILD_WITH_LIBPTHREAD
27 COMMON_LIBS += -lpthread
29 if BUILD_WITH_LIBKSTAT
30 COMMON_LIBS += -lkstat
32 if BUILD_WITH_LIBDEVINFO
33 COMMON_LIBS += -ldevinfo
36 AUTOMAKE_OPTIONS = subdir-objects
38 sbin_PROGRAMS = collectd
40 noinst_LTLIBRARIES = libavltree.la libcommon.la libheap.la libmetadata.la libplugin_mock.la
42 libavltree_la_SOURCES = utils_avltree.c utils_avltree.h
44 libcommon_la_SOURCES = common.c common.h
45 libcommon_la_LIBADD = $(COMMON_LIBS)
47 libheap_la_SOURCES = utils_heap.c utils_heap.h
49 libmetadata_la_SOURCES = meta_data.c meta_data.h
51 libplugin_mock_la_SOURCES = plugin_mock.c utils_cache_mock.c utils_time_mock.c
52 libplugin_mock_la_LIBADD = $(COMMON_LIBS)
54 collectd_SOURCES = collectd.c collectd.h \
55 configfile.c configfile.h \
56 filter_chain.c filter_chain.h \
57 meta_data.c meta_data.h \
59 utils_cache.c utils_cache.h \
60 utils_complain.c utils_complain.h \
61 utils_ignorelist.c utils_ignorelist.h \
62 utils_llist.c utils_llist.h \
63 utils_random.c utils_random.h \
64 utils_tail_match.c utils_tail_match.h \
65 utils_match.c utils_match.h \
66 utils_subst.c utils_subst.h \
67 utils_tail.c utils_tail.h \
68 utils_time.c utils_time.h \
69 types_list.c types_list.h \
70 utils_threshold.c utils_threshold.h
73 collectd_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
74 collectd_CFLAGS = $(AM_CFLAGS)
75 collectd_LDFLAGS = -export-dynamic
76 collectd_LDADD = libavltree.la libcommon.la libheap.la -lm $(COMMON_LIBS)
77 collectd_DEPENDENCIES = libavltree.la libcommon.la libheap.la libmetadata.la
79 # The daemon needs to call sg_init, so we need to link it against libstatgrab,
81 if BUILD_WITH_LIBSTATGRAB
82 collectd_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
83 collectd_LDADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
86 if BUILD_WITH_OWN_LIBOCONFIG
87 collectd_LDADD += $(LIBLTDL) $(top_builddir)/src/liboconfig/liboconfig.la
88 collectd_DEPENDENCIES += $(top_builddir)/src/liboconfig/liboconfig.la
90 collectd_LDADD += -loconfig
93 check_PROGRAMS = test_common test_meta_data test_utils_avltree test_utils_heap test_utils_time test_utils_subst
94 TESTS = test_common test_meta_data test_utils_avltree test_utils_heap test_utils_time test_utils_subst
96 test_common_SOURCES = common_test.c ../testing.h
97 test_common_LDADD = libcommon.la libplugin_mock.la
99 test_meta_data_SOURCES = meta_data_test.c ../testing.h
100 test_meta_data_LDADD = libmetadata.la libplugin_mock.la
102 test_utils_avltree_SOURCES = utils_avltree_test.c ../testing.h
103 test_utils_avltree_LDADD = libavltree.la $(COMMON_LIBS)
105 test_utils_heap_SOURCES = utils_heap_test.c ../testing.h
106 test_utils_heap_LDADD = libheap.la $(COMMON_LIBS)
108 test_utils_time_SOURCES = utils_time_test.c ../testing.h
110 test_utils_subst_SOURCES = utils_subst_test.c ../testing.h \
111 utils_subst.c utils_subst.h
112 test_utils_subst_LDADD = libcommon.la libplugin_mock.la