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