Merge pull request #3310 from yousong/mem
[collectd.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2 AM_YFLAGS = -d
3
4 if BUILD_WIN32
5 cpkgdatadir=$(datadir)
6 cpkglibdir=$(libdir)/plugins
7 cpkglocalstatedir=${localstatedir}
8 else
9 cpkgdatadir=$(pkgdatadir)
10 cpkglibdir=$(pkglibdir)
11 cpkglocalstatedir=${localstatedir}/lib/${PACKAGE_NAME}
12 endif
13
14 BUILT_SOURCES = \
15         src/libcollectdclient/collectd/lcc_features.h \
16         src/liboconfig/parser.h \
17         $(dist_man_MANS)
18
19
20 CLEANFILES = \
21         .perl-directory-stamp \
22         bindings/buildperl/Collectd.pm \
23         bindings/buildperl/Collectd/Plugins/OpenVZ.pm \
24         bindings/buildperl/Collectd/Unixsock.pm \
25         bindings/buildperl/Makefile.PL \
26         collectd-api.jar \
27         collectd.grpc.pb.cc \
28         collectd.grpc.pb.h \
29         collectd.pb.cc \
30         collectd.pb.h \
31         generic-jmx.jar \
32         org/collectd/api/*.class \
33         org/collectd/java/*.class \
34         prometheus.pb-c.c \
35         prometheus.pb-c.h \
36         src/pinba.pb-c.c \
37         src/pinba.pb-c.h \
38         types.pb.cc \
39         types.pb.h
40
41
42 EXTRA_DIST = \
43         bindings/perl/Makefile.PL \
44         bindings/perl/lib/Collectd.pm \
45         bindings/perl/lib/Collectd/Plugins/Monitorus.pm \
46         bindings/perl/lib/Collectd/Plugins/OpenVZ.pm \
47         bindings/perl/lib/Collectd/Unixsock.pm \
48         bindings/perl/uninstall_mod.pl \
49         contrib \
50         proto/collectd.proto \
51         proto/prometheus.proto \
52         proto/types.proto \
53         src/collectd-email.pod \
54         src/collectd-exec.pod \
55         src/collectd-java.pod \
56         src/collectd-lua.pod \
57         src/collectd-nagios.pod \
58         src/collectd-perl.pod \
59         src/collectd-python.pod \
60         src/collectd-snmp.pod \
61         src/collectd-tg.pod \
62         src/collectd-threshold.pod \
63         src/collectd-unixsock.pod \
64         src/collectd.conf.pod \
65         src/collectd.pod \
66         src/collectdctl.pod \
67         src/collectdmon.pod \
68         src/pinba.proto \
69         src/postgresql_default.conf \
70         src/types.db \
71         src/types.db.pod \
72         src/valgrind.FreeBSD.suppress \
73         src/valgrind.suppress \
74         testwrapper.sh \
75         version-gen.sh
76
77
78 dist_man_MANS = \
79         src/collectd.1 \
80         src/collectd.conf.5 \
81         src/collectd-email.5 \
82         src/collectd-exec.5 \
83         src/collectdctl.1 \
84         src/collectd-java.5 \
85         src/collectd-lua.5 \
86         src/collectdmon.1 \
87         src/collectd-nagios.1 \
88         src/collectd-perl.5 \
89         src/collectd-python.5 \
90         src/collectd-snmp.5 \
91         src/collectd-tg.1 \
92         src/collectd-threshold.5 \
93         src/collectd-unixsock.5 \
94         src/types.db.5
95
96
97 nodist_pkgconfig_DATA = \
98         src/libcollectdclient/libcollectdclient.pc
99
100 pkginclude_HEADERS = \
101         src/libcollectdclient/collectd/client.h \
102         src/libcollectdclient/collectd/lcc_features.h \
103         src/libcollectdclient/collectd/network_buffer.h \
104         src/libcollectdclient/collectd/network.h \
105         src/libcollectdclient/collectd/network_parse.h \
106         src/libcollectdclient/collectd/server.h \
107         src/libcollectdclient/collectd/types.h
108
109 lib_LTLIBRARIES = libcollectdclient.la
110
111 if BUILD_WIN32
112 # TODO: Build all executables on Windows as well.
113 sbin_PROGRAMS = \
114         collectd
115
116 bin_PROGRAMS =
117 else
118 sbin_PROGRAMS = \
119         collectd \
120         collectdmon
121
122
123 bin_PROGRAMS = \
124         collectd-nagios \
125         collectd-tg \
126         collectdctl
127 endif # BUILD_WIN32
128
129
130 noinst_LTLIBRARIES = \
131         libavltree.la \
132         libcmds.la \
133         libcommon.la \
134         libformat_graphite.la \
135         libformat_json.la \
136         libheap.la \
137         libignorelist.la \
138         liblatency.la \
139         liblookup.la \
140         libmetadata.la \
141         libmount.la \
142         liboconfig.la
143
144
145 check_LTLIBRARIES = \
146         libplugin_mock.la
147
148
149 check_PROGRAMS = \
150         test_common \
151         test_format_graphite \
152         test_meta_data \
153         test_utils_avltree \
154         test_utils_cmds \
155         test_utils_heap \
156         test_utils_latency \
157         test_utils_mount \
158         test_utils_subst \
159         test_utils_time \
160         test_utils_vl_lookup \
161         test_libcollectd_network_parse \
162         test_utils_config_cores
163
164
165 TESTS = $(check_PROGRAMS)
166
167 LOG_COMPILER = env VALGRIND="@VALGRIND@" $(abs_srcdir)/testwrapper.sh
168
169
170 jardir = $(cpkgdatadir)/java
171
172 pkglib_LTLIBRARIES =
173
174
175 PLUGIN_LDFLAGS = \
176         -module \
177         -avoid-version \
178         -export-symbols-regex '\<module_register\>'
179 if BUILD_WIN32
180 PLUGIN_LDFLAGS += -shared -no-undefined -lcollectd -L.
181 endif
182
183
184 AM_CPPFLAGS = \
185         -I$(top_srcdir)/src -I$(top_srcdir)/src/daemon \
186         -DPREFIX='"${prefix}"' \
187         -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \
188         -DLOCALSTATEDIR='"${localstatedir}"' \
189         -DPKGLOCALSTATEDIR='"${cpkglocalstatedir}"' \
190         -DPLUGINDIR='"${cpkglibdir}"' \
191         -DPKGDATADIR='"${cpkgdatadir}"'
192 if BUILD_WIN32
193 AM_CPPFLAGS += -DNOGDI
194 endif
195
196 COMMON_DEPS =
197 if BUILD_WIN32
198 COMMON_DEPS += collectd.exe
199 endif
200
201 # Link to these libraries..
202 COMMON_LIBS = $(PTHREAD_LIBS)
203 if BUILD_WIN32
204 COMMON_LIBS += -lws2_32
205 endif
206 if BUILD_WITH_GNULIB
207 COMMON_LIBS += -lgnu
208 endif
209 if BUILD_WITH_CAPABILITY
210 COMMON_LIBS += -lcap
211 endif
212 if BUILD_WITH_LIBRT
213 COMMON_LIBS += -lrt
214 endif
215 if BUILD_WITH_LIBPOSIX4
216 COMMON_LIBS += -lposix4
217 endif
218 if BUILD_WITH_LIBSOCKET
219 COMMON_LIBS += -lsocket
220 endif
221 if BUILD_WITH_LIBKSTAT
222 COMMON_LIBS += -lkstat
223 endif
224 if BUILD_WITH_LIBDEVINFO
225 COMMON_LIBS += -ldevinfo
226 endif
227
228
229 collectd_SOURCES = \
230         src/daemon/cmd.h \
231         src/daemon/collectd.c \
232         src/daemon/collectd.h \
233         src/daemon/configfile.c \
234         src/daemon/configfile.h \
235         src/daemon/filter_chain.c \
236         src/daemon/filter_chain.h \
237         src/daemon/globals.c \
238         src/daemon/globals.h \
239         src/utils/metadata/meta_data.c \
240         src/utils/metadata/meta_data.h \
241         src/daemon/plugin.c \
242         src/daemon/plugin.h \
243         src/daemon/utils_cache.c \
244         src/daemon/utils_cache.h \
245         src/daemon/utils_complain.c \
246         src/daemon/utils_complain.h \
247         src/daemon/utils_llist.c \
248         src/daemon/utils_llist.h \
249         src/daemon/utils_random.c \
250         src/daemon/utils_random.h \
251         src/daemon/utils_subst.c \
252         src/daemon/utils_subst.h \
253         src/daemon/utils_time.c \
254         src/daemon/utils_time.h \
255         src/daemon/types_list.c \
256         src/daemon/types_list.h \
257         src/daemon/utils_threshold.c \
258         src/daemon/utils_threshold.h
259
260
261 collectd_CFLAGS = $(AM_CFLAGS)
262 collectd_CPPFLAGS = $(AM_CPPFLAGS)
263 collectd_LDFLAGS = -export-dynamic
264 collectd_LDADD = \
265         libavltree.la \
266         libcommon.la \
267         libheap.la \
268         liboconfig.la \
269         -lm \
270         $(COMMON_LIBS) \
271         $(DLOPEN_LIBS)
272
273 if BUILD_WIN32
274 collectd_SOURCES += src/daemon/cmd_windows.c
275 collectd_LDFLAGS += -ldl -Wl,--out-implib,libcollectd.a
276 else
277 collectd_SOURCES += src/daemon/cmd.c
278 endif
279
280 if BUILD_FEATURE_DAEMON
281 collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
282 endif
283
284 # The daemon needs to call sg_init, so we need to link it against libstatgrab,
285 # too. -octo
286 if BUILD_WITH_LIBSTATGRAB
287 collectd_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
288 collectd_LDADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
289 endif
290
291 if BUILD_WIN32
292 collectd_LDFLAGS += -Wl,--out-implib,libcollectd.a
293 endif
294
295 collectdmon_SOURCES = src/collectdmon.c
296
297
298 collectd_nagios_SOURCES = src/collectd-nagios.c
299 collectd_nagios_CPPFLAGS = $(AM_CPPFLAGS) \
300         -I$(srcdir)/src/libcollectdclient \
301         -I$(top_builddir)/src/libcollectdclient
302 collectd_nagios_LDADD = libcollectdclient.la
303 if BUILD_WITH_LIBSOCKET
304 collectd_nagios_LDADD += -lsocket
305 endif
306 if BUILD_AIX
307 collectd_nagios_LDADD += -lm
308 endif
309
310
311 collectdctl_SOURCES = src/collectdctl.c
312 collectdctl_CPPFLAGS = $(AM_CPPFLAGS) \
313         -I$(srcdir)/src/libcollectdclient \
314         -I$(top_builddir)/src/libcollectdclient
315 collectdctl_LDADD = libcollectdclient.la
316 if BUILD_WITH_LIBSOCKET
317 collectdctl_LDADD += -lsocket
318 endif
319 if BUILD_AIX
320 collectdctl_LDADD += -lm
321 endif
322
323
324 collectd_tg_SOURCES = src/collectd-tg.c
325 collectd_tg_CPPFLAGS = $(AM_CPPFLAGS) \
326         -I$(srcdir)/src/libcollectdclient \
327         -I$(top_builddir)/src/libcollectdclient
328 collectd_tg_LDADD = \
329         $(PTHREAD_LIBS) \
330         libheap.la \
331         libcollectdclient.la
332 if BUILD_WITH_LIBSOCKET
333 collectd_tg_LDADD += -lsocket
334 endif
335 if BUILD_WITH_LIBRT
336 collectd_tg_LDADD += -lrt
337 endif
338 if BUILD_AIX
339 collectd_tg_LDADD += -lm
340 endif
341
342
343 test_common_SOURCES = \
344         src/utils/common/common_test.c \
345         src/testing.h
346 test_common_LDADD = libplugin_mock.la
347
348 test_meta_data_SOURCES = \
349         src/utils/metadata/meta_data_test.c \
350         src/testing.h
351 test_meta_data_LDADD = libmetadata.la libplugin_mock.la
352
353 test_utils_avltree_SOURCES = \
354         src/utils/avltree/avltree_test.c \
355         src/testing.h
356 test_utils_avltree_LDADD = libavltree.la $(COMMON_LIBS)
357
358 test_utils_heap_SOURCES = \
359         src/utils/heap/heap_test.c \
360         src/testing.h
361 test_utils_heap_LDADD = libheap.la $(COMMON_LIBS)
362
363 test_utils_time_SOURCES = \
364         src/daemon/utils_time_test.c \
365         src/testing.h
366
367 test_utils_subst_SOURCES = \
368         src/daemon/utils_subst_test.c \
369         src/testing.h \
370         src/daemon/utils_subst.c \
371         src/daemon/utils_subst.h
372 test_utils_subst_LDADD = libplugin_mock.la
373
374 test_utils_config_cores_SOURCES = \
375         src/utils/config_cores/config_cores_test.c \
376         src/testing.h
377 test_utils_config_cores_LDADD = libplugin_mock.la
378
379 libavltree_la_SOURCES = \
380         src/utils/avltree/avltree.c \
381         src/utils/avltree/avltree.h
382
383 libcommon_la_SOURCES = \
384         src/utils/common/common.c \
385         src/utils/common/common.h
386 libcommon_la_LIBADD = $(COMMON_LIBS)
387
388 libheap_la_SOURCES = \
389         src/utils/heap/heap.c \
390         src/utils/heap/heap.h
391
392 libignorelist_la_SOURCES = \
393         src/utils/ignorelist/ignorelist.c \
394         src/utils/ignorelist/ignorelist.h
395
396 libmetadata_la_SOURCES = \
397         src/utils/metadata/meta_data.c \
398         src/utils/metadata/meta_data.h
399
400 libplugin_mock_la_SOURCES = \
401         src/daemon/plugin_mock.c \
402         src/daemon/utils_cache_mock.c \
403         src/daemon/utils_complain.c \
404         src/daemon/utils_complain.h \
405         src/daemon/utils_time.c \
406         src/daemon/utils_time.h
407
408 libplugin_mock_la_CPPFLAGS = $(AM_CPPFLAGS) -DMOCK_TIME
409 libplugin_mock_la_LIBADD = libcommon.la libignorelist.la $(COMMON_LIBS)
410
411 libformat_graphite_la_SOURCES = \
412         src/utils/format_graphite/format_graphite.c \
413         src/utils/format_graphite/format_graphite.h
414
415 test_format_graphite_SOURCES = \
416         src/utils/format_graphite/format_graphite_test.c \
417         src/testing.h
418 test_format_graphite_LDADD = \
419         libformat_graphite.la \
420         libmetadata.la \
421         libplugin_mock.la \
422         -lm
423
424 libformat_json_la_SOURCES = \
425         src/utils/format_json/format_json.c \
426         src/utils/format_json/format_json.h
427 libformat_json_la_CPPFLAGS  = $(AM_CPPFLAGS)
428 libformat_json_la_LDFLAGS   = $(AM_LDFLAGS)
429 libformat_json_la_LIBADD    =
430 if BUILD_WITH_LIBYAJL
431 libformat_json_la_CPPFLAGS += $(BUILD_WITH_LIBYAJL_CPPFLAGS)
432 libformat_json_la_LDFLAGS  += $(BUILD_WITH_LIBYAJL_LDFLAGS)
433 libformat_json_la_LIBADD   += $(BUILD_WITH_LIBYAJL_LIBS)
434
435 check_PROGRAMS += test_format_json
436
437 test_format_json_SOURCES = \
438         src/utils/format_json/format_json_test.c \
439         src/testing.h
440 test_format_json_LDADD = \
441         libformat_json.la \
442         libmetadata.la \
443         libplugin_mock.la \
444         -lm
445 endif
446
447 if BUILD_PLUGIN_CEPH
448 test_plugin_ceph_SOURCES = src/ceph_test.c
449 test_plugin_ceph_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
450 test_plugin_ceph_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
451 test_plugin_ceph_LDADD = libplugin_mock.la $(BUILD_WITH_LIBYAJL_LIBS)
452 check_PROGRAMS += test_plugin_ceph
453 endif
454
455 liblatency_la_SOURCES = \
456         src/utils/latency/latency.c \
457         src/utils/latency/latency.h \
458         src/utils/latency/latency_config.c \
459         src/utils/latency/latency_config.h
460 liblatency_la_LIBADD = \
461         libcommon.la \
462         -lm
463
464 test_utils_latency_SOURCES = \
465         src/utils/latency/latency_test.c \
466         src/testing.h
467 test_utils_latency_LDADD = \
468         liblatency.la \
469         libplugin_mock.la \
470         -lm
471
472 libcmds_la_SOURCES = \
473         src/utils/cmds/cmds.c \
474         src/utils/cmds/cmds.h \
475         src/utils/cmds/flush.c \
476         src/utils/cmds/flush.h \
477         src/utils/cmds/getthreshold.c \
478         src/utils/cmds/getthreshold.h \
479         src/utils/cmds/getval.c \
480         src/utils/cmds/getval.h \
481         src/utils/cmds/listval.c \
482         src/utils/cmds/listval.h \
483         src/utils/cmds/putnotif.c \
484         src/utils/cmds/putnotif.h \
485         src/utils/cmds/putval.c \
486         src/utils/cmds/putval.h \
487         src/utils/cmds/parse_option.c \
488         src/utils/cmds/parse_option.h
489 libcmds_la_LIBADD = \
490         libcommon.la \
491         libmetadata.la \
492         -lm
493
494 test_utils_cmds_SOURCES = \
495         src/utils/cmds/cmds_test.c \
496         src/testing.h
497 test_utils_cmds_LDADD = \
498         libcmds.la \
499         libplugin_mock.la
500
501 liblookup_la_SOURCES = \
502         src/utils/lookup/vl_lookup.c \
503         src/utils/lookup/vl_lookup.h
504 liblookup_la_LIBADD = libavltree.la
505
506 test_utils_vl_lookup_SOURCES = \
507         src/utils/lookup/vl_lookup_test.c \
508         src/testing.h
509 test_utils_vl_lookup_LDADD = \
510         liblookup.la \
511         libplugin_mock.la
512 if BUILD_WITH_LIBKSTAT
513 test_utils_vl_lookup_LDADD += -lkstat
514 endif
515
516 libmount_la_SOURCES = \
517         src/utils/mount/mount.c \
518         src/utils/mount/mount.h
519
520 test_utils_mount_SOURCES = \
521         src/utils/mount/mount_test.c \
522         src/testing.h
523 test_utils_mount_LDADD = \
524         libmount.la \
525         libplugin_mock.la
526 if BUILD_WITH_LIBKSTAT
527 test_utils_mount_LDADD += -lkstat
528 endif
529
530
531 libcollectdclient_la_SOURCES = \
532         src/libcollectdclient/client.c \
533         src/libcollectdclient/network.c \
534         src/libcollectdclient/network_buffer.c \
535         src/libcollectdclient/network_parse.c \
536         src/libcollectdclient/server.c \
537         src/libcollectdclient/collectd/stdendian.h
538 libcollectdclient_la_CPPFLAGS = \
539         $(AM_CPPFLAGS) \
540         -I$(srcdir)/src/libcollectdclient \
541         -I$(top_builddir)/src/libcollectdclient \
542         -I$(srcdir)/src/daemon
543 libcollectdclient_la_LDFLAGS = -version-info 2:0:1
544 libcollectdclient_la_LIBADD = -lm
545 if BUILD_WIN32
546 libcollectdclient_la_LDFLAGS += -shared -no-undefined
547 libcollectdclient_la_LIBADD += -lgnu -lws2_32 -liphlpapi
548 endif
549 if BUILD_WITH_LIBGCRYPT
550 libcollectdclient_la_CPPFLAGS += $(GCRYPT_CPPFLAGS)
551 libcollectdclient_la_LDFLAGS += $(GCRYPT_LDFLAGS)
552 libcollectdclient_la_LIBADD += $(GCRYPT_LIBS)
553 endif
554
555 # network_parse_test.c includes network_parse.c, so no need to link with
556 # libcollectdclient.so.
557 test_libcollectd_network_parse_SOURCES = src/libcollectdclient/network_parse_test.c
558 test_libcollectd_network_parse_CPPFLAGS = \
559         $(AM_CPPFLAGS) \
560         -I$(srcdir)/src/libcollectdclient \
561         -I$(top_builddir)/src/libcollectdclient
562 if BUILD_WITH_LIBGCRYPT
563 test_libcollectd_network_parse_CPPFLAGS += $(GCRYPT_CPPFLAGS)
564 test_libcollectd_network_parse_LDFLAGS = $(GCRYPT_LDFLAGS)
565 test_libcollectd_network_parse_LDADD = $(GCRYPT_LIBS)
566 endif
567
568 liboconfig_la_SOURCES = \
569         src/liboconfig/oconfig.c \
570         src/liboconfig/oconfig.h \
571         src/liboconfig/aux_types.h \
572         src/liboconfig/scanner.l \
573         src/liboconfig/parser.y
574 liboconfig_la_CPPFLAGS = -I$(srcdir)/src/liboconfig $(AM_CPPFLAGS)
575 liboconfig_la_LDFLAGS = -avoid-version $(LEXLIB)
576
577 if BUILD_WITH_LIBCURL
578 if BUILD_WITH_LIBSSL
579 if BUILD_WITH_LIBYAJL2
580 noinst_LTLIBRARIES += liboauth.la
581 liboauth_la_SOURCES = \
582         src/utils/oauth/oauth.c \
583         src/utils/oauth/oauth.h
584 liboauth_la_CPPFLAGS = \
585         $(AM_CPPFLAGS) \
586         $(BUILD_WITH_LIBCURL_CFLAGS) \
587         $(BUILD_WITH_LIBSSL_CFLAGS) \
588         $(BUILD_WITH_LIBYAJL_CPPFLAGS)
589 liboauth_la_LIBADD = \
590         $(BUILD_WITH_LIBCURL_LIBS) \
591         $(BUILD_WITH_LIBSSL_LIBS) \
592         $(BUILD_WITH_LIBYAJL_LIBS)
593
594 check_PROGRAMS += test_utils_oauth
595 TESTS += test_utils_oauth
596 test_utils_oauth_SOURCES = \
597         src/utils/oauth/oauth_test.c
598 test_utils_oauth_LDADD = \
599         liboauth.la \
600         libcommon.la \
601         libplugin_mock.la
602
603 noinst_LTLIBRARIES += libgce.la
604 libgce_la_SOURCES = \
605         src/utils/gce/gce.c \
606         src/utils/gce/gce.h
607 libgce_la_CPPFLAGS = \
608         $(AM_CPPFLAGS) \
609         $(BUILD_WITH_LIBCURL_CFLAGS)
610 libgce_la_LIBADD = \
611         $(BUILD_WITH_LIBCURL_LIBS)
612 endif
613 endif
614 endif
615
616 if BUILD_WITH_LIBYAJL2
617 noinst_LTLIBRARIES += libformat_stackdriver.la
618 libformat_stackdriver_la_SOURCES = \
619         src/utils/format_stackdriver/format_stackdriver.c \
620         src/utils/format_stackdriver/format_stackdriver.h
621 libformat_stackdriver_la_CPPFLAGS = \
622         $(AM_CPPFLAGS) \
623         $(BUILD_WITH_LIBYAJL_CPPFLAGS)
624 libformat_stackdriver_la_LIBADD = \
625         libavltree.la \
626         $(BUILD_WITH_LIBSSL_LIBS) \
627         $(BUILD_WITH_LIBYAJL_LIBS)
628
629 check_PROGRAMS += test_format_stackdriver
630 TESTS += test_format_stackdriver
631 test_format_stackdriver_SOURCES = \
632         src/utils/format_stackdriver/format_stackdriver_test.c \
633         src/testing.h
634 test_format_stackdriver_LDADD = \
635         libformat_stackdriver.la \
636         libplugin_mock.la \
637         -lm
638 endif
639
640 if BUILD_PLUGIN_AGGREGATION
641 pkglib_LTLIBRARIES += aggregation.la
642 aggregation_la_SOURCES = \
643         src/aggregation.c \
644         src/utils/lookup/vl_lookup.c \
645         src/utils/lookup/vl_lookup.h
646 aggregation_la_LDFLAGS = $(PLUGIN_LDFLAGS)
647 aggregation_la_LIBADD = -lm
648 endif
649
650 if BUILD_PLUGIN_AMQP
651 pkglib_LTLIBRARIES += amqp.la
652 amqp_la_SOURCES = src/amqp.c
653 amqp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
654 amqp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
655 amqp_la_LIBADD = \
656         $(BUILD_WITH_LIBRABBITMQ_LIBS) \
657         libcmds.la \
658         libformat_graphite.la \
659         libformat_json.la
660 endif
661
662 if BUILD_PLUGIN_AMQP1
663 pkglib_LTLIBRARIES += amqp1.la
664 amqp1_la_SOURCES = \
665         src/amqp1.c \
666         src/utils/deq/deq.h
667 amqp1_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBQPIDPROTON_CPPFLAGS)
668 amqp1_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBQPIDPROTON_LDFLAGS)
669 amqp1_la_LIBADD = \
670         $(BUILD_WITH_LIBQPIDPROTON_LIBS) \
671         libcmds.la \
672         libformat_graphite.la \
673         libformat_json.la
674 endif
675
676 if BUILD_PLUGIN_APACHE
677 pkglib_LTLIBRARIES += apache.la
678 apache_la_SOURCES = src/apache.c
679 apache_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
680 apache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
681 apache_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
682 endif
683
684
685 if BUILD_PLUGIN_APCUPS
686 pkglib_LTLIBRARIES += apcups.la
687 apcups_la_SOURCES = src/apcups.c
688 apcups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
689 apcups_la_LIBADD =
690 if BUILD_WITH_LIBSOCKET
691 apcups_la_LIBADD += -lsocket
692 endif
693 endif
694
695 if BUILD_PLUGIN_APPLE_SENSORS
696 pkglib_LTLIBRARIES += apple_sensors.la
697 apple_sensors_la_SOURCES = src/apple_sensors.c
698 apple_sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS) -framework IOKit
699 endif
700
701 if BUILD_PLUGIN_AQUAERO
702 pkglib_LTLIBRARIES += aquaero.la
703 aquaero_la_SOURCES = src/aquaero.c
704 aquaero_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBAQUAERO5_CFLAGS)
705 aquaero_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
706 aquaero_la_LIBADD = -laquaero5
707 endif
708
709 if BUILD_PLUGIN_ASCENT
710 pkglib_LTLIBRARIES += ascent.la
711 ascent_la_SOURCES = src/ascent.c
712 ascent_la_CFLAGS = \
713         $(AM_CFLAGS) \
714         $(BUILD_WITH_LIBCURL_CFLAGS) \
715         $(BUILD_WITH_LIBXML2_CFLAGS)
716 ascent_la_LDFLAGS = $(PLUGIN_LDFLAGS)
717 ascent_la_LIBADD = \
718         $(BUILD_WITH_LIBCURL_LIBS) \
719         $(BUILD_WITH_LIBXML2_LIBS)
720 endif
721
722 if BUILD_PLUGIN_BAROMETER
723 pkglib_LTLIBRARIES += barometer.la
724 barometer_la_SOURCES = src/barometer.c
725 barometer_la_LDFLAGS = $(PLUGIN_LDFLAGS)
726 barometer_la_LIBADD = -lm $(BUILD_WITH_LIBI2C_LIBS)
727 endif
728
729 if BUILD_PLUGIN_BATTERY
730 pkglib_LTLIBRARIES += battery.la
731 battery_la_SOURCES = \
732         src/battery.c \
733         src/battery_statefs.c
734 battery_la_LDFLAGS = $(PLUGIN_LDFLAGS)
735 if BUILD_WITH_LIBIOKIT
736 battery_la_LDFLAGS += -framework IOKit
737 endif
738 endif
739
740 if BUILD_PLUGIN_BIND
741 pkglib_LTLIBRARIES += bind.la
742 bind_la_SOURCES = src/bind.c
743 bind_la_CFLAGS = $(AM_CFLAGS) \
744         $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
745 bind_la_LDFLAGS = $(PLUGIN_LDFLAGS)
746 bind_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
747 endif
748
749 if BUILD_PLUGIN_CEPH
750 pkglib_LTLIBRARIES += ceph.la
751 ceph_la_SOURCES = src/ceph.c
752 ceph_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
753 ceph_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
754 ceph_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
755 endif
756
757 if BUILD_PLUGIN_CGROUPS
758 pkglib_LTLIBRARIES += cgroups.la
759 cgroups_la_SOURCES = src/cgroups.c
760 cgroups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
761 cgroups_la_LIBADD = libignorelist.la libmount.la
762 endif
763
764 if BUILD_PLUGIN_CHRONY
765 pkglib_LTLIBRARIES += chrony.la
766 chrony_la_SOURCES = src/chrony.c
767 chrony_la_LDFLAGS = $(PLUGIN_LDFLAGS)
768 chrony_la_LIBADD = -lm
769 endif
770
771 if BUILD_PLUGIN_CHECK_UPTIME
772 pkglib_LTLIBRARIES += check_uptime.la
773 check_uptime_la_SOURCES = src/check_uptime.c
774 check_uptime_la_LDFLAGS = $(PLUGIN_LDFLAGS)
775 endif
776
777 if BUILD_PLUGIN_CONNECTIVITY
778 pkglib_LTLIBRARIES += connectivity.la
779 connectivity_la_SOURCES = src/connectivity.c
780 connectivity_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMNL_CFLAGS)
781 connectivity_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
782 connectivity_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
783 connectivity_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS) $(BUILD_WITH_LIBMNL_LIBS) libignorelist.la
784 endif
785
786 if BUILD_PLUGIN_CONNTRACK
787 pkglib_LTLIBRARIES += conntrack.la
788 conntrack_la_SOURCES = src/conntrack.c
789 conntrack_la_LDFLAGS = $(PLUGIN_LDFLAGS)
790 endif
791
792 if BUILD_PLUGIN_CONTEXTSWITCH
793 pkglib_LTLIBRARIES += contextswitch.la
794 contextswitch_la_SOURCES = src/contextswitch.c
795 contextswitch_la_LDFLAGS = $(PLUGIN_LDFLAGS)
796 contextswitch_la_LIBADD =
797 if BUILD_WITH_PERFSTAT
798 contextswitch_la_LIBADD += -lperfstat
799 endif
800 endif
801
802 if BUILD_PLUGIN_CPU
803 pkglib_LTLIBRARIES += cpu.la
804 cpu_la_SOURCES = src/cpu.c
805 cpu_la_CFLAGS = $(AM_CFLAGS)
806 cpu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
807 cpu_la_LIBADD =
808 if BUILD_WITH_LIBKSTAT
809 cpu_la_LIBADD += -lkstat
810 endif
811 if BUILD_WITH_LIBDEVINFO
812 cpu_la_LIBADD += -ldevinfo
813 endif
814 if BUILD_WITH_LIBSTATGRAB
815 cpu_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
816 cpu_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
817 endif
818 if BUILD_WITH_PERFSTAT
819 cpu_la_LIBADD += -lperfstat
820 endif
821 endif
822
823 if BUILD_PLUGIN_CPUFREQ
824 pkglib_LTLIBRARIES += cpufreq.la
825 cpufreq_la_SOURCES = src/cpufreq.c
826 cpufreq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
827 endif
828
829 if BUILD_PLUGIN_CPUSLEEP
830 pkglib_LTLIBRARIES += cpusleep.la
831 cpusleep_la_SOURCES = src/cpusleep.c
832 cpusleep_la_LDFLAGS = $(PLUGIN_LDFLAGS)
833 endif
834
835 if BUILD_PLUGIN_CSV
836 pkglib_LTLIBRARIES += csv.la
837 csv_la_SOURCES = src/csv.c
838 csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
839 endif
840
841 if BUILD_PLUGIN_CURL
842 pkglib_LTLIBRARIES += curl.la
843 curl_la_SOURCES = \
844         src/curl.c \
845         src/utils/curl_stats/curl_stats.c \
846         src/utils/curl_stats/curl_stats.h \
847         src/utils/match/match.c \
848         src/utils/match/match.h
849 curl_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
850 curl_la_LDFLAGS = $(PLUGIN_LDFLAGS)
851 curl_la_LIBADD = liblatency.la $(BUILD_WITH_LIBCURL_LIBS)
852 endif
853
854 if BUILD_PLUGIN_CURL_JSON
855 pkglib_LTLIBRARIES += curl_json.la
856 curl_json_la_SOURCES = \
857         src/curl_json.c \
858         src/utils/curl_stats/curl_stats.c \
859         src/utils/curl_stats/curl_stats.h
860 curl_json_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
861 curl_json_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
862 curl_json_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
863 curl_json_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBYAJL_LIBS)
864
865 test_plugin_curl_json_SOURCES = src/curl_json_test.c \
866                                 src/utils/curl_stats/curl_stats.c \
867                                 src/daemon/configfile.c \
868                                 src/daemon/types_list.c
869 test_plugin_curl_json_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
870 test_plugin_curl_json_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
871 test_plugin_curl_json_LDADD = libavltree.la liboconfig.la libplugin_mock.la $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBYAJL_LIBS)
872 check_PROGRAMS += test_plugin_curl_json
873 endif
874
875 if BUILD_PLUGIN_CURL_XML
876 pkglib_LTLIBRARIES += curl_xml.la
877 curl_xml_la_SOURCES = \
878         src/curl_xml.c \
879         src/utils/curl_stats/curl_stats.c \
880         src/utils/curl_stats/curl_stats.h
881 curl_xml_la_CFLAGS = $(AM_CFLAGS) \
882                 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
883 curl_xml_la_LDFLAGS = $(PLUGIN_LDFLAGS)
884 curl_xml_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
885 endif
886
887 if BUILD_PLUGIN_DBI
888 pkglib_LTLIBRARIES += dbi.la
889 dbi_la_SOURCES = \
890         src/dbi.c \
891         src/utils/db_query/db_query.c \
892         src/utils/db_query/db_query.h
893 dbi_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBDBI_CPPFLAGS)
894 dbi_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBDBI_LDFLAGS)
895 dbi_la_LIBADD = $(BUILD_WITH_LIBDBI_LIBS)
896 endif
897
898 if BUILD_PLUGIN_DF
899 pkglib_LTLIBRARIES += df.la
900 df_la_SOURCES = src/df.c
901 df_la_LDFLAGS = $(PLUGIN_LDFLAGS)
902 df_la_LIBADD = libignorelist.la libmount.la
903 endif
904
905 if BUILD_PLUGIN_DISK
906 pkglib_LTLIBRARIES += disk.la
907 disk_la_SOURCES = src/disk.c
908 disk_la_CFLAGS = $(AM_CFLAGS)
909 disk_la_CPPFLAGS = $(AM_CPPFLAGS)
910 disk_la_LDFLAGS = $(PLUGIN_LDFLAGS)
911 disk_la_LIBADD = libignorelist.la
912 if BUILD_WITH_LIBKSTAT
913 disk_la_LIBADD += -lkstat
914 endif
915 if BUILD_WITH_LIBDEVINFO
916 disk_la_LIBADD += -ldevinfo
917 endif
918 if BUILD_WITH_LIBIOKIT
919 disk_la_LDFLAGS += -framework IOKit
920 endif
921 if BUILD_WITH_LIBSTATGRAB
922 disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
923 disk_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
924 endif
925 if BUILD_WITH_LIBUDEV
926 disk_la_CPPFLAGS += $(BUILD_WITH_LIBUDEV_CPPFLAGS)
927 disk_la_LDFLAGS += $(BUILD_WITH_LIBUDEV_LDFLAGS)
928 disk_la_LIBADD += $(BUILD_WITH_LIBUDEV_LIBS)
929 endif
930 if BUILD_FREEBSD
931 disk_la_LIBADD += -ldevstat -lgeom
932 endif
933 if BUILD_WITH_PERFSTAT
934 disk_la_LIBADD += -lperfstat
935 endif
936 endif
937
938 if BUILD_PLUGIN_DNS
939 pkglib_LTLIBRARIES += dns.la
940 dns_la_SOURCES = \
941         src/dns.c \
942         src/utils/dns/dns.c \
943         src/utils/dns/dns.h
944 dns_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPCAP_CPPFLAGS)
945 dns_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPCAP_LDFLAGS)
946 dns_la_LIBADD = $(BUILD_WITH_LIBPCAP_LIBS)
947 endif
948
949 if BUILD_PLUGIN_DPDKEVENTS
950 pkglib_LTLIBRARIES += dpdkevents.la
951 dpdkevents_la_SOURCES = src/dpdkevents.c src/utils/dpdk/dpdk.c src/utils/dpdk/dpdk.h
952 dpdkevents_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS)
953 dpdkevents_la_CFLAGS = $(AM_CFLAGS) $(LIBDPDK_CFLAGS)
954 dpdkevents_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS)
955 dpdkevents_la_LIBADD = $(LIBDPDK_LIBS)
956 endif
957
958 if BUILD_PLUGIN_DPDKSTAT
959 pkglib_LTLIBRARIES += dpdkstat.la
960 dpdkstat_la_SOURCES = src/dpdkstat.c src/utils/dpdk/dpdk.c src/utils/dpdk/dpdk.h
961 dpdkstat_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS)
962 dpdkstat_la_CFLAGS = $(AM_CFLAGS) $(LIBDPDK_CFLAGS)
963 dpdkstat_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS)
964 dpdkstat_la_LIBADD = $(LIBDPDK_LIBS)
965 endif
966
967 if BUILD_PLUGIN_DRBD
968 pkglib_LTLIBRARIES += drbd.la
969 drbd_la_SOURCES = src/drbd.c
970 drbd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
971 endif
972
973 if BUILD_PLUGIN_EMAIL
974 pkglib_LTLIBRARIES += email.la
975 email_la_SOURCES = src/email.c
976 email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
977 endif
978
979 if BUILD_PLUGIN_ENTROPY
980 pkglib_LTLIBRARIES += entropy.la
981 entropy_la_SOURCES = src/entropy.c
982 entropy_la_LDFLAGS = $(PLUGIN_LDFLAGS)
983 endif
984
985 if BUILD_PLUGIN_EXEC
986 pkglib_LTLIBRARIES += exec.la
987 exec_la_SOURCES = src/exec.c
988 exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
989 exec_la_LIBADD = libcmds.la
990 endif
991
992 if BUILD_PLUGIN_ETHSTAT
993 pkglib_LTLIBRARIES += ethstat.la
994 ethstat_la_SOURCES = src/ethstat.c
995 ethstat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
996 endif
997
998 if BUILD_PLUGIN_FHCOUNT
999 pkglib_LTLIBRARIES += fhcount.la
1000 fhcount_la_SOURCES = src/fhcount.c
1001 fhcount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1002 endif
1003
1004 if BUILD_PLUGIN_FILECOUNT
1005 pkglib_LTLIBRARIES += filecount.la
1006 filecount_la_SOURCES = src/filecount.c
1007 filecount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1008 endif
1009
1010 if BUILD_PLUGIN_FSCACHE
1011 pkglib_LTLIBRARIES += fscache.la
1012 fscache_la_SOURCES = src/fscache.c
1013 fscache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1014 endif
1015
1016 if BUILD_PLUGIN_GMOND
1017 pkglib_LTLIBRARIES += gmond.la
1018 gmond_la_SOURCES = src/gmond.c
1019 gmond_la_CPPFLAGS = $(AM_CPPFLAGS) $(GANGLIA_CPPFLAGS)
1020 gmond_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(GANGLIA_LDFLAGS)
1021 gmond_la_LIBADD = $(GANGLIA_LIBS)
1022 endif
1023
1024 if BUILD_PLUGIN_GPS
1025 pkglib_LTLIBRARIES += gps.la
1026 gps_la_SOURCES = src/gps.c
1027 gps_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBGPS_CFLAGS)
1028 gps_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBGPS_LDFLAGS)
1029 gps_la_LIBADD = -lpthread $(BUILD_WITH_LIBGPS_LIBS)
1030 endif
1031
1032 if BUILD_PLUGIN_GPU_NVIDIA
1033 pkglib_LTLIBRARIES += gpu_nvidia.la
1034 gpu_nvidia_la_SOURCES = src/gpu_nvidia.c
1035 gpu_nvidia_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) $(BUILD_WITH_GPU_CUDA_CPPFLAGS)
1036 gpu_nvidia_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_GPU_CUDA_LDFLAGS)
1037 gpu_nvidia_la_LIBADD = $(BUILD_WITH_CUDA_LIBS)
1038 endif
1039
1040 if BUILD_PLUGIN_GRPC
1041 pkglib_LTLIBRARIES += grpc.la
1042 grpc_la_SOURCES = src/grpc.cc
1043 nodist_grpc_la_SOURCES = \
1044         collectd.grpc.pb.cc \
1045         collectd.pb.cc \
1046         types.pb.cc
1047 grpc_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBGRPCPP_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_CPPFLAGS)
1048 grpc_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBGRPCPP_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_LDFLAGS)
1049 grpc_la_LIBADD = $(BUILD_WITH_LIBGRPCPP_LIBS) $(BUILD_WITH_LIBPROTOBUF_LIBS)
1050 endif
1051
1052 if BUILD_PLUGIN_HDDTEMP
1053 pkglib_LTLIBRARIES += hddtemp.la
1054 hddtemp_la_SOURCES = src/hddtemp.c
1055 hddtemp_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1056 hddtemp_la_LIBADD =
1057 if BUILD_WITH_LIBSOCKET
1058 hddtemp_la_LIBADD += -lsocket
1059 endif
1060 endif
1061
1062 if BUILD_PLUGIN_HUGEPAGES
1063 pkglib_LTLIBRARIES += hugepages.la
1064 hugepages_la_SOURCES = src/hugepages.c
1065 hugepages_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1066 endif
1067
1068 if BUILD_PLUGIN_INTEL_PMU
1069 pkglib_LTLIBRARIES += intel_pmu.la
1070 intel_pmu_la_SOURCES = \
1071         src/intel_pmu.c \
1072         src/utils/config_cores/config_cores.h \
1073         src/utils/config_cores/config_cores.c
1074 intel_pmu_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBJEVENTS_CPPFLAGS)
1075 intel_pmu_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBJEVENTS_LDFLAGS)
1076 intel_pmu_la_LIBADD = $(BUILD_WITH_LIBJEVENTS_LIBS)
1077 endif
1078
1079 if BUILD_PLUGIN_INTEL_RDT
1080 pkglib_LTLIBRARIES += intel_rdt.la
1081 intel_rdt_la_SOURCES = \
1082         src/intel_rdt.c \
1083         src/utils/proc_pids/proc_pids.c \
1084         src/utils/proc_pids/proc_pids.h \
1085         src/utils/config_cores/config_cores.h \
1086         src/utils/config_cores/config_cores.c
1087 intel_rdt_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBPQOS_CPPFLAGS)
1088 intel_rdt_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPQOS_LDFLAGS)
1089 intel_rdt_la_LIBADD = $(BUILD_WITH_LIBPQOS_LIBS)
1090
1091 test_plugin_intel_rdt_SOURCES = \
1092         src/intel_rdt_test.c \
1093         src/utils/config_cores/config_cores.c \
1094         src/utils/proc_pids/proc_pids.c \
1095         src/daemon/configfile.c \
1096         src/daemon/types_list.c
1097 test_plugin_intel_rdt_CPPFLAGS = $(AM_CPPFLAGS)
1098 test_plugin_intel_rdt_LDFLAGS = $(PLUGIN_LDFLAGS)
1099 test_plugin_intel_rdt_LDADD = liboconfig.la libplugin_mock.la
1100 check_PROGRAMS += test_plugin_intel_rdt
1101 TESTS += test_plugin_intel_rdt
1102
1103 test_utils_proc_pids_SOURCES = \
1104         src/utils/proc_pids/proc_pids_test.c \
1105         src/testing.h
1106 test_utils_proc_pids_LDADD = libplugin_mock.la
1107 check_PROGRAMS += test_utils_proc_pids
1108 TESTS += test_utils_proc_pids
1109 endif
1110
1111 if BUILD_PLUGIN_INTERFACE
1112 pkglib_LTLIBRARIES += interface.la
1113 interface_la_SOURCES = src/interface.c
1114 interface_la_CFLAGS = $(AM_CFLAGS)
1115 interface_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1116 interface_la_LIBADD = libignorelist.la
1117 if BUILD_WITH_LIBSTATGRAB
1118 interface_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1119 interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1120 else
1121 if BUILD_WITH_LIBKSTAT
1122 interface_la_LIBADD += -lkstat
1123 endif
1124 if BUILD_WITH_LIBDEVINFO
1125 interface_la_LIBADD += -ldevinfo
1126 endif # BUILD_WITH_LIBDEVINFO
1127 endif # !BUILD_WITH_LIBSTATGRAB
1128 if BUILD_WITH_PERFSTAT
1129 interface_la_LIBADD += -lperfstat
1130 endif
1131 endif # BUILD_PLUGIN_INTERFACE
1132
1133 if BUILD_PLUGIN_IPC
1134 pkglib_LTLIBRARIES += ipc.la
1135 ipc_la_SOURCES = src/ipc.c
1136 ipc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1137 endif
1138
1139 if BUILD_PLUGIN_IPTABLES
1140 pkglib_LTLIBRARIES += iptables.la
1141 iptables_la_SOURCES = src/iptables.c
1142 iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS)
1143 iptables_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1144 iptables_la_LIBADD = $(BUILD_WITH_LIBIPTC_LDFLAGS)
1145 endif
1146
1147 if BUILD_PLUGIN_IPMI
1148 pkglib_LTLIBRARIES += ipmi.la
1149 ipmi_la_SOURCES = src/ipmi.c
1150 ipmi_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_OPENIPMI_CFLAGS)
1151 ipmi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1152 ipmi_la_LIBADD = libignorelist.la $(BUILD_WITH_OPENIPMI_LIBS)
1153 endif
1154
1155 if BUILD_PLUGIN_IPVS
1156 pkglib_LTLIBRARIES += ipvs.la
1157 ipvs_la_SOURCES = src/ipvs.c
1158 ipvs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1159 endif
1160
1161 if BUILD_PLUGIN_IRQ
1162 pkglib_LTLIBRARIES += irq.la
1163 irq_la_SOURCES = src/irq.c
1164 irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1165 irq_la_LIBADD = libignorelist.la
1166 endif
1167
1168 if BUILD_PLUGIN_JAVA
1169 pkglib_LTLIBRARIES += java.la
1170 java_la_SOURCES = src/java.c
1171 java_la_CPPFLAGS = $(AM_CPPFLAGS) $(JAVA_CPPFLAGS)
1172 java_la_CFLAGS = $(AM_CFLAGS) $(JAVA_CFLAGS)
1173 java_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(JAVA_LDFLAGS)
1174 java_la_LIBADD = $(JAVA_LIBS)
1175 endif
1176
1177 if BUILD_PLUGIN_LOAD
1178 pkglib_LTLIBRARIES += load.la
1179 load_la_SOURCES = src/load.c
1180 load_la_CFLAGS = $(AM_CFLAGS)
1181 load_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1182 load_la_LIBADD =
1183 if BUILD_WITH_LIBSTATGRAB
1184 load_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1185 load_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1186 endif # BUILD_WITH_LIBSTATGRAB
1187 if BUILD_WITH_PERFSTAT
1188 load_la_LIBADD += -lperfstat
1189 endif
1190 endif # BUILD_PLUGIN_LOAD
1191
1192 if BUILD_PLUGIN_LOGFILE
1193 pkglib_LTLIBRARIES += logfile.la
1194 logfile_la_SOURCES = src/logfile.c
1195 logfile_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1196 logfile_la_DEPENDENCIES = $(COMMON_DEPS)
1197 endif
1198
1199 if BUILD_PLUGIN_LOG_LOGSTASH
1200 pkglib_LTLIBRARIES += log_logstash.la
1201 log_logstash_la_SOURCES = src/log_logstash.c
1202 log_logstash_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
1203 log_logstash_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
1204 log_logstash_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
1205 endif
1206
1207 if BUILD_PLUGIN_LPAR
1208 pkglib_LTLIBRARIES += lpar.la
1209 lpar_la_SOURCES = src/lpar.c
1210 lpar_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1211 lpar_la_LIBADD = -lperfstat
1212 endif
1213
1214 if BUILD_PLUGIN_LUA
1215 pkglib_LTLIBRARIES += lua.la
1216 lua_la_SOURCES = \
1217         src/lua.c \
1218         src/utils_lua.c \
1219         src/utils_lua.h
1220 lua_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBLUA_CFLAGS)
1221 lua_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1222 lua_la_LIBADD = $(BUILD_WITH_LIBLUA_LIBS)
1223 endif
1224
1225 if BUILD_PLUGIN_MADWIFI
1226 pkglib_LTLIBRARIES += madwifi.la
1227 madwifi_la_SOURCES = \
1228         src/madwifi.c \
1229         src/madwifi.h
1230 madwifi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1231 madwifi_la_LIBADD = libignorelist.la
1232 endif
1233
1234 if BUILD_PLUGIN_MATCH_EMPTY_COUNTER
1235 pkglib_LTLIBRARIES += match_empty_counter.la
1236 match_empty_counter_la_SOURCES = src/match_empty_counter.c
1237 match_empty_counter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1238 endif
1239
1240 if BUILD_PLUGIN_MATCH_HASHED
1241 pkglib_LTLIBRARIES += match_hashed.la
1242 match_hashed_la_SOURCES = src/match_hashed.c
1243 match_hashed_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1244 endif
1245
1246 if BUILD_PLUGIN_MATCH_REGEX
1247 pkglib_LTLIBRARIES += match_regex.la
1248 match_regex_la_SOURCES = src/match_regex.c
1249 match_regex_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1250 endif
1251
1252 if BUILD_PLUGIN_MATCH_TIMEDIFF
1253 pkglib_LTLIBRARIES += match_timediff.la
1254 match_timediff_la_SOURCES = src/match_timediff.c
1255 match_timediff_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1256 endif
1257
1258 if BUILD_PLUGIN_MATCH_VALUE
1259 pkglib_LTLIBRARIES += match_value.la
1260 match_value_la_SOURCES = src/match_value.c
1261 match_value_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1262 endif
1263
1264 if BUILD_PLUGIN_MBMON
1265 pkglib_LTLIBRARIES += mbmon.la
1266 mbmon_la_SOURCES = src/mbmon.c
1267 mbmon_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1268 mbmon_la_LIBADD =
1269 if BUILD_WITH_LIBSOCKET
1270 mbmon_la_LIBADD += -lsocket
1271 endif
1272 endif
1273
1274 if BUILD_PLUGIN_MCELOG
1275 pkglib_LTLIBRARIES += mcelog.la
1276 mcelog_la_SOURCES = src/mcelog.c
1277 mcelog_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1278 endif
1279
1280 if BUILD_PLUGIN_MD
1281 pkglib_LTLIBRARIES += md.la
1282 md_la_SOURCES = src/md.c
1283 md_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1284 md_la_LIBADD = libignorelist.la
1285 endif
1286
1287 if BUILD_PLUGIN_MEMCACHEC
1288 pkglib_LTLIBRARIES += memcachec.la
1289 memcachec_la_SOURCES = \
1290         src/memcachec.c \
1291         src/utils/match/match.c \
1292         src/utils/match/match.h
1293 memcachec_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
1294 memcachec_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
1295 memcachec_la_LIBADD = liblatency.la $(BUILD_WITH_LIBMEMCACHED_LIBS)
1296 endif
1297
1298 if BUILD_PLUGIN_MEMCACHED
1299 pkglib_LTLIBRARIES += memcached.la
1300 memcached_la_SOURCES = src/memcached.c
1301 memcached_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1302 memcached_la_LIBADD =
1303 if BUILD_WITH_LIBSOCKET
1304 memcached_la_LIBADD += -lsocket
1305 endif
1306 endif
1307
1308 if BUILD_PLUGIN_MEMORY
1309 pkglib_LTLIBRARIES += memory.la
1310 memory_la_SOURCES = src/memory.c
1311 memory_la_CFLAGS = $(AM_CFLAGS)
1312 memory_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1313 memory_la_LIBADD =
1314 if BUILD_WITH_LIBKSTAT
1315 memory_la_LIBADD += -lkstat
1316 endif
1317 if BUILD_WITH_LIBDEVINFO
1318 memory_la_LIBADD += -ldevinfo
1319 endif
1320 if BUILD_WITH_LIBSTATGRAB
1321 memory_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1322 memory_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1323 endif
1324 if BUILD_WITH_PERFSTAT
1325 memory_la_LIBADD += -lperfstat
1326 endif
1327 endif
1328
1329 if BUILD_PLUGIN_MIC
1330 pkglib_LTLIBRARIES += mic.la
1331 mic_la_SOURCES = src/mic.c
1332 mic_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_MIC_CPPFLAGS)
1333 mic_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_MIC_LDFLAGS)
1334 mic_la_LIBADD = libignorelist.la $(BUILD_WITH_MIC_LIBS)
1335 endif
1336
1337 if BUILD_PLUGIN_MODBUS
1338 pkglib_LTLIBRARIES += modbus.la
1339 modbus_la_SOURCES = src/modbus.c
1340 modbus_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMODBUS_CFLAGS)
1341 modbus_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1342 modbus_la_LIBADD = $(BUILD_WITH_LIBMODBUS_LIBS)
1343 endif
1344
1345 if BUILD_PLUGIN_MQTT
1346 pkglib_LTLIBRARIES += mqtt.la
1347 mqtt_la_SOURCES = src/mqtt.c
1348 mqtt_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
1349 mqtt_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
1350 mqtt_la_LIBADD = $(BUILD_WITH_LIBMOSQUITTO_LIBS)
1351 endif
1352
1353 if BUILD_PLUGIN_MULTIMETER
1354 pkglib_LTLIBRARIES += multimeter.la
1355 multimeter_la_SOURCES = src/multimeter.c
1356 multimeter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1357 endif
1358
1359 if BUILD_PLUGIN_MYSQL
1360 pkglib_LTLIBRARIES += mysql.la
1361 mysql_la_SOURCES = src/mysql.c
1362 mysql_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMYSQL_CFLAGS)
1363 mysql_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1364 mysql_la_LIBADD = $(BUILD_WITH_LIBMYSQL_LIBS)
1365 endif
1366
1367 if BUILD_PLUGIN_NETAPP
1368 pkglib_LTLIBRARIES += netapp.la
1369 netapp_la_SOURCES = src/netapp.c
1370 netapp_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBNETAPP_CPPFLAGS)
1371 netapp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBNETAPP_LDFLAGS)
1372 netapp_la_LIBADD = libignorelist.la $(LIBNETAPP_LIBS)
1373 endif
1374
1375 if BUILD_PLUGIN_NETLINK
1376 pkglib_LTLIBRARIES += netlink.la
1377 netlink_la_SOURCES = src/netlink.c
1378 netlink_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMNL_CFLAGS)
1379 netlink_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1380 netlink_la_LIBADD = $(BUILD_WITH_LIBMNL_LIBS)
1381 endif
1382
1383 if BUILD_PLUGIN_NETWORK
1384 pkglib_LTLIBRARIES += network.la
1385 network_la_SOURCES = \
1386         src/network.c \
1387         src/network.h \
1388         src/utils_fbhash.c \
1389         src/utils_fbhash.h
1390 network_la_CPPFLAGS = $(AM_CPPFLAGS)
1391 network_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1392 network_la_LIBADD =
1393 if BUILD_WITH_LIBSOCKET
1394 network_la_LIBADD += -lsocket
1395 endif
1396 if BUILD_WITH_LIBGCRYPT
1397 network_la_CPPFLAGS += $(GCRYPT_CPPFLAGS)
1398 network_la_LDFLAGS += $(GCRYPT_LDFLAGS)
1399 network_la_LIBADD += $(GCRYPT_LIBS)
1400 endif
1401
1402 test_plugin_network_SOURCES = \
1403         src/network_test.c \
1404         src/utils_fbhash.c \
1405         src/daemon/configfile.c \
1406         src/daemon/types_list.c
1407 test_plugin_network_CPPFLAGS = $(AM_CPPFLAGS) $(GCRYPT_CPPFLAGS)
1408 test_plugin_network_LDFLAGS = $(PLUGIN_LDFLAGS) $(GCRYPT_LDFLAGS)
1409 test_plugin_network_LDADD = \
1410         libavltree.la \
1411         liboconfig.la \
1412         libplugin_mock.la \
1413         libmetadata.la \
1414         $(GCRYPT_LIBS)
1415 if BUILD_WITH_LIBSOCKET
1416 test_plugin_network_LDADD += -lsocket
1417 endif
1418 if BUILD_WITH_LIBNSL
1419 test_plugin_network_LDADD += -lnsl
1420 endif
1421 check_PROGRAMS += test_plugin_network
1422 endif
1423
1424 if BUILD_PLUGIN_NFS
1425 pkglib_LTLIBRARIES += nfs.la
1426 nfs_la_SOURCES = src/nfs.c
1427 nfs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1428 endif
1429
1430 if BUILD_PLUGIN_NGINX
1431 pkglib_LTLIBRARIES += nginx.la
1432 nginx_la_SOURCES = src/nginx.c
1433 nginx_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
1434 nginx_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1435 nginx_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
1436 endif
1437
1438 if BUILD_PLUGIN_NOTIFY_DESKTOP
1439 pkglib_LTLIBRARIES += notify_desktop.la
1440 notify_desktop_la_SOURCES = src/notify_desktop.c
1441 notify_desktop_la_CFLAGS = $(AM_CFLAGS) $(LIBNOTIFY_CFLAGS)
1442 notify_desktop_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1443 notify_desktop_la_LIBADD = $(LIBNOTIFY_LIBS)
1444 endif
1445
1446 if BUILD_PLUGIN_NOTIFY_EMAIL
1447 pkglib_LTLIBRARIES += notify_email.la
1448 notify_email_la_SOURCES = src/notify_email.c
1449 notify_email_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBESMTP_CPPFLAGS)
1450 notify_email_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBESMTP_LDFLAGS)
1451 notify_email_la_LIBADD = $(BUILD_WITH_LIBESMTP_LIBS)
1452 endif
1453
1454 if BUILD_PLUGIN_NOTIFY_NAGIOS
1455 pkglib_LTLIBRARIES += notify_nagios.la
1456 notify_nagios_la_SOURCES = src/notify_nagios.c
1457 notify_nagios_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1458 endif
1459
1460 if BUILD_PLUGIN_NTPD
1461 pkglib_LTLIBRARIES += ntpd.la
1462 ntpd_la_SOURCES = src/ntpd.c
1463 ntpd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1464 ntpd_la_LIBADD =
1465 if BUILD_WITH_LIBSOCKET
1466 ntpd_la_LIBADD += -lsocket
1467 endif
1468 endif
1469
1470 if BUILD_PLUGIN_NUMA
1471 pkglib_LTLIBRARIES += numa.la
1472 numa_la_SOURCES = src/numa.c
1473 numa_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1474 endif
1475
1476 if BUILD_PLUGIN_NUT
1477 pkglib_LTLIBRARIES += nut.la
1478 nut_la_SOURCES = src/nut.c
1479 nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1480 nut_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1481 nut_la_LIBADD = $(BUILD_WITH_LIBUPSCLIENT_LIBS)
1482 endif
1483
1484 if BUILD_PLUGIN_OLSRD
1485 pkglib_LTLIBRARIES += olsrd.la
1486 olsrd_la_SOURCES = src/olsrd.c
1487 olsrd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1488 olsrd_la_LIBADD =
1489 if BUILD_WITH_LIBSOCKET
1490 olsrd_la_LIBADD += -lsocket
1491 endif
1492 endif
1493
1494 if BUILD_PLUGIN_ONEWIRE
1495 pkglib_LTLIBRARIES += onewire.la
1496 onewire_la_SOURCES = src/onewire.c
1497 onewire_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
1498 onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOWCAPI_LDFLAGS)
1499 onewire_la_LIBADD = libignorelist.la $(BUILD_WITH_LIBOWCAPI_LIBS)
1500 endif
1501
1502 if BUILD_PLUGIN_OPENLDAP
1503 pkglib_LTLIBRARIES += openldap.la
1504 openldap_la_SOURCES = src/openldap.c
1505 openldap_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBLDAP_CPPFLAGS)
1506 openldap_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBLDAP_LDFLAGS)
1507 openldap_la_LIBADD = -lldap
1508 endif
1509
1510 if BUILD_PLUGIN_OPENVPN
1511 pkglib_LTLIBRARIES += openvpn.la
1512 openvpn_la_SOURCES = src/openvpn.c
1513 openvpn_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1514 endif
1515
1516 if BUILD_PLUGIN_ORACLE
1517 pkglib_LTLIBRARIES += oracle.la
1518 oracle_la_SOURCES = \
1519         src/oracle.c \
1520         src/utils/db_query/db_query.c \
1521         src/utils/db_query/db_query.h
1522 oracle_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_ORACLE_CPPFLAGS)
1523 oracle_la_LIBADD = $(BUILD_WITH_ORACLE_LIBS)
1524 oracle_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1525 endif
1526
1527 if BUILD_PLUGIN_OVS_EVENTS
1528 pkglib_LTLIBRARIES += ovs_events.la
1529 ovs_events_la_SOURCES = \
1530         src/ovs_events.c \
1531         src/utils/ovs/ovs.c \
1532         src/utils/ovs/ovs.h
1533 ovs_events_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
1534 ovs_events_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
1535 ovs_events_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
1536 endif
1537
1538 if BUILD_PLUGIN_OVS_STATS
1539 pkglib_LTLIBRARIES += ovs_stats.la
1540 ovs_stats_la_SOURCES = \
1541         src/ovs_stats.c \
1542         src/utils/ovs/ovs.c \
1543         src/utils/ovs/ovs.h
1544 ovs_stats_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
1545 ovs_stats_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
1546 ovs_stats_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
1547 endif
1548
1549 if BUILD_PLUGIN_PCIE_ERRORS
1550 pkglib_LTLIBRARIES += pcie_errors.la
1551 pcie_errors_la_SOURCES = src/pcie_errors.c
1552 pcie_errors_la_CPPFLAGS = $(AM_CPPFLAGS)
1553 pcie_errors_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1554
1555 test_plugin_pcie_errors_SOURCES = \
1556         src/pcie_errors_test.c \
1557         src/daemon/utils_llist.c \
1558         src/daemon/configfile.c \
1559         src/daemon/types_list.c
1560 test_plugin_pcie_errors_CPPFLAGS = $(AM_CPPFLAGS)
1561 test_plugin_pcie_errors_LDFLAGS = $(PLUGIN_LDFLAGS)
1562 test_plugin_pcie_errors_LDADD = liboconfig.la libplugin_mock.la
1563 check_PROGRAMS += test_plugin_pcie_errors
1564 TESTS += test_plugin_pcie_errors
1565 endif
1566
1567 if BUILD_PLUGIN_PERL
1568 pkglib_LTLIBRARIES += perl.la
1569 perl_la_SOURCES = src/perl.c
1570 # Despite C99 providing the "bool" type thru stdbool.h, Perl defines its own
1571 # version of that type if HAS_BOOL is not defined... *sigh*
1572 perl_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAS_BOOL=1
1573 # Despite off_t being 64 bit wide on 64 bit platforms, Perl insist on using
1574 # off64_t which is only exposed when _LARGEFILE64_SOURCE is defined... *sigh*
1575 # On older platforms we also need _REENTRANT. _GNU_SOURCE sets both of these.
1576 perl_la_CPPFLAGS += -D_GNU_SOURCE
1577 perl_la_CFLAGS = $(AM_CFLAGS) \
1578         $(PERL_CFLAGS) \
1579         -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
1580 perl_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(PERL_LDFLAGS)
1581 perl_la_LIBADD = $(PERL_LIBS)
1582 endif
1583
1584 if BUILD_PLUGIN_PF
1585 pkglib_LTLIBRARIES += pf.la
1586 pf_la_SOURCES = src/pf.c
1587 pf_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1588 endif
1589
1590 if BUILD_PLUGIN_PINBA
1591 pkglib_LTLIBRARIES += pinba.la
1592 pinba_la_SOURCES = src/pinba.c
1593 nodist_pinba_la_SOURCES = \
1594         src/pinba.pb-c.c \
1595         src/pinba.pb-c.h
1596 pinba_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS)
1597 pinba_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_LDFLAGS)
1598 pinba_la_LIBADD = $(BUILD_WITH_LIBPROTOBUF_C_LIBS)
1599 endif
1600
1601 if BUILD_PLUGIN_PING
1602 pkglib_LTLIBRARIES += ping.la
1603 ping_la_SOURCES = src/ping.c
1604 ping_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOPING_CPPFLAGS)
1605 ping_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOPING_LDFLAGS)
1606 ping_la_LIBADD = -loping -lm
1607 endif
1608
1609 if BUILD_PLUGIN_POSTGRESQL
1610 pkglib_LTLIBRARIES += postgresql.la
1611 postgresql_la_SOURCES = \
1612         src/postgresql.c \
1613         src/utils/db_query/db_query.c \
1614         src/utils/db_query/db_query.h
1615 postgresql_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPQ_CPPFLAGS)
1616 postgresql_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
1617         $(BUILD_WITH_LIBPQ_LDFLAGS)
1618 postgresql_la_LIBADD = $(BUILD_WITH_LIBPQ_LIBS)
1619 endif
1620
1621 if BUILD_PLUGIN_POWERDNS
1622 pkglib_LTLIBRARIES += powerdns.la
1623 powerdns_la_SOURCES = src/powerdns.c
1624 powerdns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1625 endif
1626
1627 if BUILD_PLUGIN_PYTHON
1628 pkglib_LTLIBRARIES += python.la
1629 python_la_SOURCES = \
1630         src/python.c \
1631         src/pyconfig.c \
1632         src/pyvalues.c \
1633         src/cpython.h
1634 python_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBPYTHON_CPPFLAGS)
1635 python_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBPYTHON_LDFLAGS)
1636 endif
1637
1638 if HAVE_LIBMNL
1639 noinst_LTLIBRARIES += libtaskstats.la
1640 libtaskstats_la_SOURCES = \
1641         src/utils/taskstats/taskstats.c \
1642         src/utils/taskstats/taskstats.h
1643 libtaskstats_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMNL_CFLAGS)
1644 libtaskstats_la_LIBADD = $(BUILD_WITH_LIBMNL_LIBS)
1645 endif
1646
1647 if BUILD_PLUGIN_PROCESSES
1648 pkglib_LTLIBRARIES += processes.la
1649 processes_la_SOURCES = src/processes.c
1650 processes_la_CPPFLAGS = $(AM_CPPFLAGS)
1651 processes_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1652 processes_la_LIBADD =
1653 if BUILD_WITH_LIBKVM_GETPROCS
1654 processes_la_LIBADD += -lkvm
1655 endif
1656 if HAVE_LIBMNL
1657 processes_la_CPPFLAGS += -DHAVE_LIBTASKSTATS=1
1658 processes_la_LIBADD += libtaskstats.la
1659 endif
1660 endif
1661
1662 if BUILD_PLUGIN_PROCEVENT
1663 pkglib_LTLIBRARIES += procevent.la
1664 procevent_la_SOURCES = src/procevent.c
1665 procevent_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
1666 procevent_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
1667 procevent_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS) libignorelist.la
1668 endif
1669
1670 if BUILD_PLUGIN_PROTOCOLS
1671 pkglib_LTLIBRARIES += protocols.la
1672 protocols_la_SOURCES = src/protocols.c
1673 protocols_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1674 protocols_la_LIBADD = libignorelist.la
1675 endif
1676
1677 if BUILD_PLUGIN_REDIS
1678 pkglib_LTLIBRARIES += redis.la
1679 redis_la_SOURCES = src/redis.c
1680 redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
1681 redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
1682 redis_la_LIBADD = -lhiredis
1683 endif
1684
1685 if BUILD_PLUGIN_ROUTEROS
1686 pkglib_LTLIBRARIES += routeros.la
1687 routeros_la_SOURCES = src/routeros.c
1688 routeros_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
1689 routeros_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBROUTEROS_LDFLAGS)
1690 routeros_la_LIBADD = -lrouteros
1691 endif
1692
1693 if BUILD_PLUGIN_RRDCACHED
1694 pkglib_LTLIBRARIES += rrdcached.la
1695 rrdcached_la_SOURCES = \
1696         src/rrdcached.c \
1697         src/utils/rrdcreate/rrdcreate.c \
1698         src/utils/rrdcreate/rrdcreate.h
1699 rrdcached_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
1700 rrdcached_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRRD_LDFLAGS)
1701 rrdcached_la_LIBADD = $(BUILD_WITH_LIBRRD_LIBS)
1702 endif
1703
1704 if BUILD_PLUGIN_RRDTOOL
1705 pkglib_LTLIBRARIES += rrdtool.la
1706 rrdtool_la_SOURCES = \
1707         src/rrdtool.c \
1708         src/utils/rrdcreate/rrdcreate.c \
1709         src/utils/rrdcreate/rrdcreate.h
1710 rrdtool_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
1711 rrdtool_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRRD_LDFLAGS)
1712 rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LIBS)
1713 endif
1714
1715 if BUILD_PLUGIN_SENSORS
1716 pkglib_LTLIBRARIES += sensors.la
1717 sensors_la_SOURCES = src/sensors.c
1718 sensors_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBSENSORS_CPPFLAGS)
1719 sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBSENSORS_LDFLAGS)
1720 sensors_la_LIBADD = libignorelist.la $(BUILD_WITH_LIBSENSORS_LIBS)
1721 endif
1722
1723 if BUILD_PLUGIN_SERIAL
1724 pkglib_LTLIBRARIES += serial.la
1725 serial_la_SOURCES = src/serial.c
1726 serial_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1727 endif
1728
1729 if BUILD_PLUGIN_SIGROK
1730 pkglib_LTLIBRARIES += sigrok.la
1731 sigrok_la_SOURCES = src/sigrok.c
1732 sigrok_la_CFLAGS = $(AM_CFLAGS) $(LIBSIGROK_CFLAGS)
1733 sigrok_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1734 sigrok_la_LIBADD = $(LIBSIGROK_LIBS)
1735 endif
1736
1737 if BUILD_PLUGIN_SMART
1738 if BUILD_WITH_LIBUDEV
1739 pkglib_LTLIBRARIES += smart.la
1740 smart_la_SOURCES = src/smart.c
1741 smart_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBATASMART_CPPFLAGS) $(BUILD_WITH_LIBUDEV_CPPFLAGS)
1742 smart_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBATASMART_LDFLAGS) $(BUILD_WITH_LIBUDEV_LDFLAGS)
1743 smart_la_LIBADD = libignorelist.la $(BUILD_WITH_LIBATASMART_LIBS) $(BUILD_WITH_LIBUDEV_LIBS)
1744 endif
1745 endif
1746
1747 if BUILD_PLUGIN_SNMP
1748 pkglib_LTLIBRARIES += snmp.la
1749 snmp_la_SOURCES = src/snmp.c
1750 snmp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
1751 snmp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBNETSNMP_LDFLAGS)
1752 snmp_la_LIBADD = libignorelist.la $(BUILD_WITH_LIBNETSNMP_LIBS)
1753 endif
1754
1755 if BUILD_PLUGIN_SNMP_AGENT
1756 pkglib_LTLIBRARIES += snmp_agent.la
1757 snmp_agent_la_SOURCES = src/snmp_agent.c
1758 snmp_agent_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS)
1759 snmp_agent_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS)
1760 snmp_agent_la_LIBADD = $(BUILD_WITH_LIBNETSNMPAGENT_LIBS)
1761
1762 test_plugin_snmp_agent_SOURCES = src/snmp_agent_test.c \
1763                                  src/utils/avltree/avltree.c \
1764                                  src/daemon/utils_llist.c \
1765                                  src/daemon/configfile.c \
1766                                  src/daemon/types_list.c
1767 test_plugin_snmp_agent_CPPFLAGS = $(AM_CPPFLAGS) \
1768         $(BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS)
1769 test_plugin_snmp_agent_LDFLAGS = $(PLUGIN_LDFLAGS) \
1770         $(BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS)
1771 test_plugin_snmp_agent_LDADD = liboconfig.la libplugin_mock.la \
1772         $(BUILD_WITH_LIBNETSNMPAGENT_LIBS) $(BUILD_WITH_LIBNETSNMP_LIBS)
1773
1774 check_PROGRAMS += test_plugin_snmp_agent
1775 TESTS += test_plugin_snmp_agent
1776
1777
1778 endif
1779
1780 if BUILD_PLUGIN_STATSD
1781 pkglib_LTLIBRARIES += statsd.la
1782 statsd_la_SOURCES = src/statsd.c
1783 statsd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1784 statsd_la_LIBADD = liblatency.la
1785 endif
1786
1787 if BUILD_PLUGIN_SWAP
1788 pkglib_LTLIBRARIES += swap.la
1789 swap_la_SOURCES = src/swap.c
1790 swap_la_CFLAGS = $(AM_CFLAGS)
1791 swap_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1792 swap_la_LIBADD =
1793 if BUILD_WITH_LIBKSTAT
1794 swap_la_LIBADD += -lkstat
1795 endif
1796 if BUILD_WITH_LIBDEVINFO
1797 swap_la_LIBADD += -ldevinfo
1798 endif
1799 if BUILD_WITH_LIBKVM_GETSWAPINFO
1800 swap_la_LIBADD += -lkvm
1801 endif
1802 if BUILD_WITH_LIBSTATGRAB
1803 swap_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1804 swap_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1805 endif
1806 if BUILD_WITH_PERFSTAT
1807 swap_la_LIBADD += -lperfstat
1808 endif
1809
1810 endif
1811
1812 if BUILD_PLUGIN_SYNPROXY
1813 pkglib_LTLIBRARIES += synproxy.la
1814 synproxy_la_SOURCES = src/synproxy.c
1815 synproxy_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1816 endif
1817
1818 if BUILD_PLUGIN_SYSEVENT
1819 pkglib_LTLIBRARIES += sysevent.la
1820 sysevent_la_SOURCES = src/sysevent.c
1821 sysevent_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
1822 sysevent_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
1823 sysevent_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS) libignorelist.la
1824 endif
1825
1826 if BUILD_PLUGIN_SYSLOG
1827 pkglib_LTLIBRARIES += syslog.la
1828 syslog_la_SOURCES = src/syslog.c
1829 syslog_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1830 endif
1831
1832 if BUILD_PLUGIN_TABLE
1833 pkglib_LTLIBRARIES += table.la
1834 table_la_SOURCES = src/table.c
1835 table_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1836 endif
1837
1838 if BUILD_PLUGIN_TAIL
1839 pkglib_LTLIBRARIES += tail.la
1840 tail_la_SOURCES = \
1841         src/tail.c \
1842         src/utils/match/match.c \
1843         src/utils/match/match.h \
1844         src/utils/tail/tail.c \
1845         src/utils/tail/tail.h \
1846         src/utils_tail_match.c \
1847         src/utils_tail_match.h
1848 tail_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1849 tail_la_LIBADD = liblatency.la
1850 endif
1851
1852 if BUILD_PLUGIN_TAIL_CSV
1853 pkglib_LTLIBRARIES += tail_csv.la
1854 tail_csv_la_SOURCES = \
1855         src/tail_csv.c \
1856         src/utils/tail/tail.c \
1857         src/utils/tail/tail.h
1858 tail_csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1859 endif
1860
1861 if BUILD_PLUGIN_TAPE
1862 pkglib_LTLIBRARIES += tape.la
1863 tape_la_SOURCES = src/tape.c
1864 tape_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1865 tape_la_LIBADD = -lkstat -ldevinfo
1866 endif
1867
1868 if BUILD_PLUGIN_TARGET_NOTIFICATION
1869 pkglib_LTLIBRARIES += target_notification.la
1870 target_notification_la_SOURCES = src/target_notification.c
1871 target_notification_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1872 endif
1873
1874 if BUILD_PLUGIN_TARGET_REPLACE
1875 pkglib_LTLIBRARIES += target_replace.la
1876 target_replace_la_SOURCES = src/target_replace.c
1877 target_replace_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1878 endif
1879
1880 if BUILD_PLUGIN_TARGET_SCALE
1881 pkglib_LTLIBRARIES += target_scale.la
1882 target_scale_la_SOURCES = src/target_scale.c
1883 target_scale_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1884 endif
1885
1886 if BUILD_PLUGIN_TARGET_SET
1887 pkglib_LTLIBRARIES += target_set.la
1888 target_set_la_SOURCES = src/target_set.c
1889 target_set_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1890 endif
1891
1892 if BUILD_PLUGIN_TARGET_V5UPGRADE
1893 pkglib_LTLIBRARIES += target_v5upgrade.la
1894 target_v5upgrade_la_SOURCES = src/target_v5upgrade.c
1895 target_v5upgrade_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1896 endif
1897
1898 if BUILD_PLUGIN_TCPCONNS
1899 pkglib_LTLIBRARIES += tcpconns.la
1900 tcpconns_la_SOURCES = src/tcpconns.c
1901 tcpconns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1902 tcpconns_la_LIBADD =
1903 if BUILD_WITH_LIBKVM_NLIST
1904 tcpconns_la_LIBADD += -lkvm
1905 endif
1906 endif
1907
1908 if BUILD_PLUGIN_TEAMSPEAK2
1909 pkglib_LTLIBRARIES += teamspeak2.la
1910 teamspeak2_la_SOURCES = src/teamspeak2.c
1911 teamspeak2_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1912 endif
1913
1914 if BUILD_PLUGIN_TED
1915 pkglib_LTLIBRARIES += ted.la
1916 ted_la_SOURCES = src/ted.c
1917 ted_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1918 endif
1919
1920 if BUILD_PLUGIN_THERMAL
1921 pkglib_LTLIBRARIES += thermal.la
1922 thermal_la_SOURCES = src/thermal.c
1923 thermal_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1924 thermal_la_LIBADD = libignorelist.la
1925 endif
1926
1927 if BUILD_PLUGIN_THRESHOLD
1928 pkglib_LTLIBRARIES += threshold.la
1929 threshold_la_SOURCES = src/threshold.c
1930 threshold_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1931 endif
1932
1933 if BUILD_PLUGIN_TOKYOTYRANT
1934 pkglib_LTLIBRARIES += tokyotyrant.la
1935 tokyotyrant_la_SOURCES = src/tokyotyrant.c
1936 tokyotyrant_la_CPPFLAGS  = $(AM_CPPFLAGS) $(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
1937 tokyotyrant_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
1938 tokyotyrant_la_LIBADD  = $(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
1939 if BUILD_WITH_LIBSOCKET
1940 tokyotyrant_la_LIBADD += -lsocket
1941 endif
1942 endif
1943
1944 if BUILD_PLUGIN_TURBOSTAT
1945 pkglib_LTLIBRARIES += turbostat.la
1946 turbostat_la_SOURCES = \
1947         src/turbostat.c \
1948         src/msr-index.h
1949 turbostat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1950 endif
1951
1952 if BUILD_PLUGIN_UNIXSOCK
1953 pkglib_LTLIBRARIES += unixsock.la
1954 unixsock_la_SOURCES = src/unixsock.c
1955 unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1956 unixsock_la_LIBADD = libcmds.la
1957 endif
1958
1959 if BUILD_PLUGIN_UPTIME
1960 pkglib_LTLIBRARIES += uptime.la
1961 uptime_la_SOURCES = src/uptime.c
1962 uptime_la_CFLAGS = $(AM_CFLAGS)
1963 uptime_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1964 uptime_la_LIBADD =
1965 if BUILD_WITH_LIBKSTAT
1966 uptime_la_LIBADD += -lkstat
1967 endif
1968 if BUILD_WITH_PERFSTAT
1969 uptime_la_LIBADD += -lperfstat
1970 endif
1971 endif
1972
1973 if BUILD_PLUGIN_USERS
1974 pkglib_LTLIBRARIES += users.la
1975 users_la_SOURCES = src/users.c
1976 users_la_CFLAGS = $(AM_CFLAGS)
1977 users_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1978 users_la_LIBADD =
1979 if BUILD_WITH_LIBSTATGRAB
1980 users_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1981 users_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1982 endif
1983 endif
1984
1985 if BUILD_PLUGIN_UUID
1986 pkglib_LTLIBRARIES += uuid.la
1987 uuid_la_SOURCES = src/uuid.c
1988 uuid_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1989 endif
1990
1991 if BUILD_PLUGIN_VARNISH
1992 pkglib_LTLIBRARIES += varnish.la
1993 varnish_la_SOURCES = src/varnish.c
1994 varnish_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBVARNISH_CFLAGS)
1995 varnish_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1996 varnish_la_LIBADD = $(BUILD_WITH_LIBVARNISH_LIBS)
1997 endif
1998
1999 if BUILD_PLUGIN_VIRT
2000 pkglib_LTLIBRARIES += virt.la
2001 virt_la_SOURCES = src/virt.c
2002 virt_la_CFLAGS = $(AM_CFLAGS) \
2003         $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
2004 virt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2005 virt_la_LIBADD = libignorelist.la $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
2006
2007 test_plugin_virt_SOURCES = src/virt_test.c src/daemon/configfile.c \
2008         src/daemon/types_list.c
2009 test_plugin_virt_CPPFLAGS = $(AM_CPPFLAGS) \
2010         $(BUILD_WITH_LIBVIRT_CPPFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
2011 test_plugin_virt_LDFLAGS = $(PLUGIN_LDFLAGS) \
2012         $(BUILD_WITH_LIBVIRT_LDFLAGS) $(BUILD_WITH_LIBXML2_LDFLAGS)
2013 test_plugin_virt_LDADD = liboconfig.la libplugin_mock.la \
2014         $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
2015 check_PROGRAMS += test_plugin_virt
2016 TESTS += test_plugin_virt
2017 endif
2018
2019 if BUILD_PLUGIN_VMEM
2020 pkglib_LTLIBRARIES += vmem.la
2021 vmem_la_SOURCES = src/vmem.c
2022 vmem_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2023 endif
2024
2025 if BUILD_PLUGIN_VSERVER
2026 pkglib_LTLIBRARIES += vserver.la
2027 vserver_la_SOURCES = src/vserver.c
2028 vserver_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2029 endif
2030
2031 if BUILD_PLUGIN_WIRELESS
2032 pkglib_LTLIBRARIES += wireless.la
2033 wireless_la_SOURCES = src/wireless.c
2034 wireless_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2035 endif
2036
2037 if BUILD_PLUGIN_WRITE_GRAPHITE
2038 pkglib_LTLIBRARIES += write_graphite.la
2039 write_graphite_la_SOURCES = src/write_graphite.c
2040 write_graphite_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2041 write_graphite_la_LIBADD = libformat_graphite.la
2042 endif
2043
2044 if BUILD_PLUGIN_WRITE_HTTP
2045 pkglib_LTLIBRARIES += write_http.la
2046 write_http_la_SOURCES = \
2047         src/write_http.c \
2048         src/utils/format_kairosdb/format_kairosdb.c \
2049         src/utils/format_kairosdb/format_kairosdb.h
2050 write_http_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
2051 write_http_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2052 write_http_la_LIBADD = libformat_json.la $(BUILD_WITH_LIBCURL_LIBS)
2053 endif
2054
2055 if BUILD_PLUGIN_WRITE_KAFKA
2056 pkglib_LTLIBRARIES += write_kafka.la
2057 write_kafka_la_SOURCES = src/write_kafka.c
2058 write_kafka_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
2059 write_kafka_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
2060 write_kafka_la_LIBADD = \
2061         libcmds.la \
2062         libformat_graphite.la \
2063         libformat_json.la \
2064         $(BUILD_WITH_LIBRDKAFKA_LIBS)
2065 endif
2066
2067 if BUILD_PLUGIN_WRITE_LOG
2068 pkglib_LTLIBRARIES += write_log.la
2069 write_log_la_SOURCES = src/write_log.c
2070 write_log_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2071 write_log_la_LIBADD = libformat_graphite.la libformat_json.la
2072 endif
2073
2074 if BUILD_PLUGIN_WRITE_MONGODB
2075 pkglib_LTLIBRARIES += write_mongodb.la
2076 write_mongodb_la_SOURCES = src/write_mongodb.c
2077 write_mongodb_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMONGOC_CFLAGS)
2078 write_mongodb_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMONGOC_LDFLAGS)
2079 write_mongodb_la_LIBADD = $(BUILD_WITH_LIBMONGOC_LIBS)
2080 endif
2081
2082 if BUILD_PLUGIN_WRITE_PROMETHEUS
2083 pkglib_LTLIBRARIES += write_prometheus.la
2084 write_prometheus_la_SOURCES = src/write_prometheus.c
2085 nodist_write_prometheus_la_SOURCES = \
2086         prometheus.pb-c.c \
2087         prometheus.pb-c.h
2088 write_prometheus_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS) $(BUILD_WITH_LIBMICROHTTPD_CPPFLAGS)
2089 write_prometheus_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_LDFLAGS) $(BUILD_WITH_LIBMICROHTTPD_LDFLAGS)
2090 write_prometheus_la_LIBADD = $(BUILD_WITH_LIBPROTOBUF_C_LIBS) $(BUILD_WITH_LIBMICROHTTPD_LIBS)
2091 endif
2092
2093 if BUILD_PLUGIN_WRITE_REDIS
2094 pkglib_LTLIBRARIES += write_redis.la
2095 write_redis_la_SOURCES = src/write_redis.c
2096 write_redis_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
2097 write_redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
2098 write_redis_la_LIBADD = -lhiredis
2099 endif
2100
2101 if BUILD_PLUGIN_WRITE_RIEMANN
2102 pkglib_LTLIBRARIES += write_riemann.la
2103 write_riemann_la_SOURCES = \
2104         src/write_riemann.c \
2105         src/write_riemann_threshold.c \
2106         src/write_riemann_threshold.h
2107 write_riemann_la_CFLAGS = $(AM_CFLAGS) $(LIBRIEMANN_CLIENT_CFLAGS)
2108 write_riemann_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBRIEMANN_CLIENT_LIBS)
2109 endif
2110
2111 if BUILD_PLUGIN_WRITE_SENSU
2112 pkglib_LTLIBRARIES += write_sensu.la
2113 write_sensu_la_SOURCES = src/write_sensu.c
2114 write_sensu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2115 endif
2116
2117 if BUILD_PLUGIN_WRITE_STACKDRIVER
2118 pkglib_LTLIBRARIES += write_stackdriver.la
2119 write_stackdriver_la_SOURCES = src/write_stackdriver.c
2120 write_stackdriver_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2121 write_stackdriver_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
2122 write_stackdriver_la_LIBADD = libformat_stackdriver.la libgce.la liboauth.la \
2123                      $(BUILD_WITH_LIBCURL_LIBS)
2124 endif
2125
2126 if BUILD_PLUGIN_WRITE_SYSLOG
2127 pkglib_LTLIBRARIES += write_syslog.la
2128 write_syslog_la_SOURCES = src/write_syslog.c
2129 write_syslog_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2130 endif
2131
2132 if BUILD_PLUGIN_WRITE_TSDB
2133 pkglib_LTLIBRARIES += write_tsdb.la
2134 write_tsdb_la_SOURCES = src/write_tsdb.c
2135 write_tsdb_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2136 endif
2137
2138 if BUILD_PLUGIN_XENCPU
2139 pkglib_LTLIBRARIES += xencpu.la
2140 xencpu_la_SOURCES = src/xencpu.c
2141 xencpu_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBXENCTL_CPPFLAGS)
2142 xencpu_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBXENCTL_LDFLAGS)
2143 xencpu_la_LIBADD = -lxenctrl
2144 endif
2145
2146 if BUILD_PLUGIN_XMMS
2147 pkglib_LTLIBRARIES += xmms.la
2148 xmms_la_SOURCES = src/xmms.c
2149 xmms_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBXMMS_CFLAGS)
2150 xmms_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2151 xmms_la_LIBADD = $(BUILD_WITH_LIBXMMS_LIBS)
2152 endif
2153
2154 if BUILD_PLUGIN_ZFS_ARC
2155 pkglib_LTLIBRARIES += zfs_arc.la
2156 zfs_arc_la_SOURCES = src/zfs_arc.c
2157 zfs_arc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2158 if BUILD_FREEBSD
2159 zfs_arc_la_LIBADD = -lm
2160 endif
2161 if BUILD_SOLARIS
2162 zfs_arc_la_LIBADD = -lkstat
2163 endif
2164 endif
2165
2166 if BUILD_PLUGIN_ZOOKEEPER
2167 pkglib_LTLIBRARIES += zookeeper.la
2168 zookeeper_la_SOURCES = src/zookeeper.c
2169 zookeeper_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2170 endif
2171
2172 if BUILD_PLUGIN_ZONE
2173 pkglib_LTLIBRARIES += zone.la
2174 zone_la_SOURCES = src/zone.c
2175 zone_la_LDFLAGS = $(PLUGIN_LDFLAGS)
2176 endif
2177
2178 AM_V_POD2MAN_C = $(am__v_POD2MAN_C_@AM_V@)
2179 am__v_POD2MAN_C_ = $(am__v_POD2MAN_C_@AM_DEFAULT_V@)
2180 am__v_POD2MAN_C_0 = @echo "  POD2MAN " $@;
2181 am__v_POD2MAN_C_1 =
2182
2183 .pod.1:
2184         $(AM_V_POD2MAN_C)pod2man --release=$(VERSION) --center=$(PACKAGE) $< $@
2185
2186 .pod.5:
2187         $(AM_V_POD2MAN_C)pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< $@
2188
2189 V_PROTOC = $(v_protoc_@AM_V@)
2190 v_protoc_ = $(v_protoc_@AM_DEFAULT_V@)
2191 v_protoc_0 = @echo "  PROTOC  " $@;
2192
2193 AM_V_PROTOC_C = $(am__v_PROTOC_C_@AM_V@)
2194 am__v_PROTOC_C_ = $(am__v_PROTOC_C_@AM_DEFAULT_V@)
2195 am__v_PROTOC_C_0 = @echo "  PROTOC-C" $@;
2196 am__v_PROTOC_C_1 =
2197
2198 # Protocol buffer for the "pinba" plugin.
2199 if BUILD_PLUGIN_PINBA
2200 BUILT_SOURCES += src/pinba.pb-c.c src/pinba.pb-c.h
2201
2202 src/pinba.pb-c.c src/pinba.pb-c.h: $(srcdir)/src/pinba.proto
2203         $(AM_V_PROTOC_C)$(PROTOC_C) -I$(srcdir) --c_out . $(srcdir)/src/pinba.proto
2204 endif
2205
2206 # Protocol buffer for the "write_prometheus" plugin.
2207 if BUILD_PLUGIN_WRITE_PROMETHEUS
2208 BUILT_SOURCES += prometheus.pb-c.c prometheus.pb-c.h
2209
2210 prometheus.pb-c.c prometheus.pb-c.h: $(srcdir)/proto/prometheus.proto
2211         $(AM_V_PROTOC_C)$(PROTOC_C) -I$(srcdir)/proto --c_out=$(builddir) $(srcdir)/proto/prometheus.proto
2212 endif
2213
2214 if HAVE_PROTOC3
2215 if HAVE_GRPC_CPP
2216 BUILT_SOURCES += collectd.grpc.pb.cc collectd.pb.cc types.pb.cc
2217
2218 collectd.grpc.pb.cc: $(srcdir)/proto/collectd.proto $(srcdir)/proto/types.proto
2219         $(V_PROTOC)$(PROTOC) -I$(srcdir)/proto \
2220                 --grpc_out=$(builddir) --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN) $<
2221
2222 collectd.pb.cc: $(srcdir)/proto/collectd.proto $(srcdir)/proto/types.proto
2223         $(V_PROTOC)$(PROTOC) -I$(srcdir)/proto --cpp_out=$(builddir) $<
2224
2225 types.pb.cc: $(srcdir)/proto/types.proto
2226         $(V_PROTOC)$(PROTOC) -I$(srcdir)/proto --cpp_out=$(builddir) $<
2227 endif
2228 endif
2229
2230 install-exec-hook:
2231         $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run
2232         $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)
2233         $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log
2234         $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
2235         if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
2236         then \
2237                 $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
2238         else \
2239                 $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
2240         fi; \
2241         $(mkinstalldirs) $(DESTDIR)$(cpkgdatadir)
2242         $(INSTALL) -m 0644 $(srcdir)/src/types.db $(DESTDIR)$(cpkgdatadir)/types.db;
2243         $(INSTALL) -m 0644 $(srcdir)/src/postgresql_default.conf \
2244                 $(DESTDIR)$(cpkgdatadir)/postgresql_default.conf;
2245
2246 uninstall-hook:
2247         rm -f $(DESTDIR)$(cpkgdatadir)/types.db;
2248         rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
2249         rm -f $(DESTDIR)$(cpkgdatadir)/postgresql_default.conf;
2250
2251 all-local: @PERL_BINDINGS@
2252
2253 install-exec-local:
2254         [ ! -f buildperl/Makefile ] || ( cd buildperl && $(MAKE) install )
2255
2256 # Perl 'make uninstall' does not work as well as wanted.
2257 # So we do the work here.
2258 uninstall-local:
2259         @PERL@ -I$(DESTDIR)$(prefix) $(srcdir)/bindings/perl/uninstall_mod.pl Collectd
2260         find $(DESTDIR)$(prefix) -name "perllocal.pod" -exec rm {} \;
2261
2262 clean-local:
2263         rm -rf buildperl
2264
2265 perl: buildperl/Makefile
2266         cd buildperl && $(MAKE)
2267
2268 buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \
2269         $(top_builddir)/config.status
2270         @# beautify the output a bit
2271         @echo 'cd buildperl && @PERL@ Makefile.PL @PERL_BINDINGS_OPTIONS@'
2272         @cd buildperl && ( if ! @PERL@ Makefile.PL @PERL_BINDINGS_OPTIONS@; then \
2273                         echo ""; \
2274                         echo 'Check whether you have set $$PERL_MM_OPT in your environment and try using ./configure --with-perl-bindings=""'; \
2275                         echo ""; \
2276                 fi )
2277
2278 buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status
2279
2280 .perl-directory-stamp:
2281         if test ! -d buildperl; then \
2282           mkdir -p buildperl/Collectd/Plugins; \
2283           cp $(srcdir)/bindings/perl/lib/Collectd.pm buildperl/; \
2284           cp $(srcdir)/bindings/perl/Makefile.PL buildperl/; \
2285           cp $(srcdir)/bindings/perl/lib/Collectd/Unixsock.pm buildperl/Collectd/; \
2286           cp $(srcdir)/bindings/perl/lib/Collectd/Plugins/OpenVZ.pm buildperl/Collectd/Plugins/; \
2287         fi
2288         touch $@
2289
2290 .PHONY: perl
2291
2292
2293 if BUILD_WITH_JAVA
2294 dist_noinst_JAVA = \
2295         bindings/java/org/collectd/api/Collectd.java \
2296         bindings/java/org/collectd/api/CollectdConfigInterface.java \
2297         bindings/java/org/collectd/api/CollectdFlushInterface.java \
2298         bindings/java/org/collectd/api/CollectdInitInterface.java \
2299         bindings/java/org/collectd/api/CollectdLogInterface.java \
2300         bindings/java/org/collectd/api/CollectdMatchFactoryInterface.java \
2301         bindings/java/org/collectd/api/CollectdMatchInterface.java \
2302         bindings/java/org/collectd/api/CollectdNotificationInterface.java \
2303         bindings/java/org/collectd/api/CollectdReadInterface.java \
2304         bindings/java/org/collectd/api/CollectdShutdownInterface.java \
2305         bindings/java/org/collectd/api/CollectdTargetFactoryInterface.java \
2306         bindings/java/org/collectd/api/CollectdTargetInterface.java \
2307         bindings/java/org/collectd/api/CollectdWriteInterface.java \
2308         bindings/java/org/collectd/api/DataSet.java \
2309         bindings/java/org/collectd/api/DataSource.java \
2310         bindings/java/org/collectd/api/Notification.java \
2311         bindings/java/org/collectd/api/OConfigItem.java \
2312         bindings/java/org/collectd/api/OConfigValue.java \
2313         bindings/java/org/collectd/api/PluginData.java \
2314         bindings/java/org/collectd/api/ValueList.java \
2315         bindings/java/org/collectd/java/GenericJMX.java \
2316         bindings/java/org/collectd/java/GenericJMXConfConnection.java \
2317         bindings/java/org/collectd/java/GenericJMXConfMBean.java \
2318         bindings/java/org/collectd/java/GenericJMXConfValue.java \
2319         bindings/java/org/collectd/java/JMXMemory.java
2320
2321 collectd-api.jar: $(JAVA_TIMESTAMP_FILE)
2322         $(JAR) cf $(JARFLAGS) $@ org/collectd/api/*.class
2323
2324 generic-jmx.jar: $(JAVA_TIMESTAMP_FILE)
2325         $(JAR) cf $(JARFLAGS) $@ org/collectd/java/*.class
2326
2327 jar_DATA = collectd-api.jar generic-jmx.jar
2328 endif
2329