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