Merge branch 'collectd-5.6' into collectd-5.7
[collectd.git] / src / Makefile.am
1 SUBDIRS = libcollectdclient
2 if BUILD_WITH_OWN_LIBOCONFIG
3 SUBDIRS += liboconfig
4 endif
5 SUBDIRS += daemon
6
7 PLUGIN_LDFLAGS = -module -avoid-version -export-symbols-regex '\<module_register\>'
8
9 AM_CPPFLAGS = -I$(srcdir)/daemon
10 AM_CPPFLAGS += -DPREFIX='"${prefix}"'
11 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
12 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
13 AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
14 if BUILD_FEATURE_DAEMON
15 AM_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
16 endif
17 AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
18 AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
19
20 LOG_COMPILER = env VALGRIND="@VALGRIND@" $(abs_top_srcdir)/testwrapper.sh
21
22 V_PROTOC = $(v_protoc_@AM_V@)
23 v_protoc_ = $(v_protoc_@AM_DEFAULT_V@)
24 v_protoc_0 = @echo "  PROTOC  " $@;
25
26 noinst_LTLIBRARIES =
27 check_PROGRAMS =
28 TESTS =
29
30 noinst_LTLIBRARIES += libformat_graphite.la
31 libformat_graphite_la_SOURCES  = utils_format_graphite.c utils_format_graphite.h
32 libformat_graphite_la_CPPFLAGS = $(AM_CPPFLAGS)
33 libformat_graphite_la_LDFLAGS  = $(AM_LDFLAGS)
34 check_PROGRAMS += test_format_graphite
35 TESTS += test_format_graphite
36 test_format_graphite_SOURCES = utils_format_graphite_test.c testing.h
37 test_format_graphite_LDADD = libformat_graphite.la daemon/libmetadata.la daemon/libplugin_mock.la -lm
38
39 noinst_LTLIBRARIES += libformat_json.la
40 libformat_json_la_SOURCES   = utils_format_json.c utils_format_json.h
41 libformat_json_la_CPPFLAGS  = $(AM_CPPFLAGS)
42 libformat_json_la_LDFLAGS   = $(AM_LDFLAGS)
43 libformat_json_la_LIBADD    =
44 if BUILD_WITH_LIBYAJL
45 libformat_json_la_CPPFLAGS += $(BUILD_WITH_LIBYAJL_CPPFLAGS)
46 libformat_json_la_LDFLAGS  += $(BUILD_WITH_LIBYAJL_LDFLAGS)
47 libformat_json_la_LIBADD   += $(BUILD_WITH_LIBYAJL_LIBS)
48 check_PROGRAMS += test_format_json
49 TESTS += test_format_json
50 test_format_json_SOURCES = utils_format_json_test.c testing.h
51 test_format_json_LDADD = libformat_json.la daemon/libmetadata.la daemon/libplugin_mock.la -lm
52 endif
53
54 noinst_LTLIBRARIES += liblatency.la
55 liblatency_la_SOURCES = utils_latency.c utils_latency.h utils_latency_config.c utils_latency_config.h
56 liblatency_la_LIBADD = daemon/libcommon.la -lm
57 check_PROGRAMS += test_utils_latency
58 TESTS += test_utils_latency
59 test_utils_latency_SOURCES = utils_latency_test.c testing.h
60 test_utils_latency_LDADD = liblatency.la daemon/libplugin_mock.la -lm
61
62 noinst_LTLIBRARIES += libcmds.la
63 libcmds_la_SOURCES = utils_cmds.c utils_cmds.h \
64                      utils_cmd_flush.c utils_cmd_flush.h \
65                      utils_cmd_getthreshold.c utils_cmd_getthreshold.h \
66                      utils_cmd_getval.c utils_cmd_getval.h \
67                      utils_cmd_listval.c utils_cmd_listval.h \
68                      utils_cmd_putnotif.c utils_cmd_putnotif.h \
69                      utils_cmd_putval.c utils_cmd_putval.h \
70                      utils_parse_option.c utils_parse_option.h
71 libcmds_la_LIBADD = daemon/libcommon.la daemon/libmetadata.la -lm
72 check_PROGRAMS += test_utils_cmds
73 TESTS += test_utils_cmds
74 test_utils_cmds_SOURCES = utils_cmds_test.c testing.h
75 test_utils_cmds_LDADD = libcmds.la \
76                         daemon/libplugin_mock.la
77
78 noinst_LTLIBRARIES += liblookup.la
79 liblookup_la_SOURCES = utils_vl_lookup.c utils_vl_lookup.h
80 liblookup_la_LIBADD = daemon/libavltree.la
81 check_PROGRAMS += test_utils_vl_lookup
82 TESTS += test_utils_vl_lookup
83 test_utils_vl_lookup_SOURCES = utils_vl_lookup_test.c testing.h
84 test_utils_vl_lookup_LDADD = liblookup.la daemon/libplugin_mock.la
85 if BUILD_WITH_LIBKSTAT
86 test_utils_vl_lookup_LDADD += -lkstat
87 endif
88
89 noinst_LTLIBRARIES += libmount.la
90 libmount_la_SOURCES = utils_mount.c utils_mount.h
91 check_PROGRAMS += test_utils_mount
92 TESTS += test_utils_mount
93 test_utils_mount_SOURCES = utils_mount_test.c testing.h
94 test_utils_mount_LDADD = libmount.la daemon/libplugin_mock.la
95 if BUILD_WITH_LIBKSTAT
96 test_utils_mount_LDADD += -lkstat
97 endif
98
99 sbin_PROGRAMS = collectdmon
100 bin_PROGRAMS = collectd-nagios collectdctl collectd-tg
101
102 collectdmon_SOURCES = collectdmon.c
103
104 collectd_nagios_SOURCES = collectd-nagios.c
105 collectd_nagios_CPPFLAGS = $(AM_CPPFLAGS) \
106         -I$(top_srcdir)/src/libcollectdclient/collectd \
107         -I$(top_builddir)/src/libcollectdclient/collectd
108 collectd_nagios_LDADD = libcollectdclient/libcollectdclient.la
109 if BUILD_WITH_LIBSOCKET
110 collectd_nagios_LDADD += -lsocket
111 endif
112 if BUILD_AIX
113 collectd_nagios_LDADD += -lm
114 endif
115
116
117 collectdctl_SOURCES = collectdctl.c
118 collectdctl_CPPFLAGS = $(AM_CPPFLAGS) \
119         -I$(top_srcdir)/src/libcollectdclient/collectd \
120         -I$(top_builddir)/src/libcollectdclient/collectd
121 collectdctl_LDADD = libcollectdclient/libcollectdclient.la
122 if BUILD_WITH_LIBSOCKET
123 collectdctl_LDADD += -lsocket
124 endif
125 if BUILD_AIX
126 collectdctl_LDADD += -lm
127 endif
128
129
130 collectd_tg_SOURCES = collectd-tg.c
131 collectd_tg_CPPFLAGS = $(AM_CPPFLAGS) \
132         -I$(top_srcdir)/src/libcollectdclient/collectd \
133         -I$(top_builddir)/src/libcollectdclient/collectd
134 collectd_tg_LDADD = \
135         $(PTHREAD_LIBS) \
136         daemon/libheap.la \
137         libcollectdclient/libcollectdclient.la
138 if BUILD_WITH_LIBSOCKET
139 collectd_tg_LDADD += -lsocket
140 endif
141 if BUILD_WITH_LIBRT
142 collectd_tg_LDADD += -lrt
143 endif
144 if BUILD_AIX
145 collectd_tg_LDADD += -lm
146 endif
147
148
149 pkglib_LTLIBRARIES =
150
151 BUILT_SOURCES =
152 CLEANFILES =
153
154 if HAVE_PROTOC3
155 if HAVE_GRPC_CPP
156 BUILT_SOURCES += collectd.grpc.pb.cc collectd.pb.cc types.pb.cc
157 CLEANFILES += collectd.grpc.pb.cc collectd.pb.cc types.pb.cc \
158                 collectd.grpc.pb.h collectd.pb.h types.pb.h
159
160 collectd.grpc.pb.cc: $(top_srcdir)/proto/collectd.proto $(top_srcdir)/proto/types.proto
161         $(V_PROTOC)@PROTOC@ -I$(top_srcdir)/proto \
162                 --grpc_out=$(builddir) --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN) $<
163
164 collectd.pb.cc: $(top_srcdir)/proto/collectd.proto $(top_srcdir)/proto/types.proto
165         $(V_PROTOC)@PROTOC@ -I$(top_srcdir)/proto --cpp_out=$(builddir) $<
166
167 types.pb.cc: $(top_srcdir)/proto/types.proto
168         $(V_PROTOC)@PROTOC@ -I$(top_srcdir)/proto --cpp_out=$(builddir) $<
169 endif
170 endif
171
172 if BUILD_PLUGIN_AGGREGATION
173 pkglib_LTLIBRARIES += aggregation.la
174 aggregation_la_SOURCES = aggregation.c \
175                          utils_vl_lookup.c utils_vl_lookup.h
176 aggregation_la_LDFLAGS = $(PLUGIN_LDFLAGS)
177 aggregation_la_LIBADD = -lm
178 endif
179
180 if BUILD_PLUGIN_AMQP
181 pkglib_LTLIBRARIES += amqp.la
182 amqp_la_SOURCES = amqp.c
183 amqp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
184 amqp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
185 amqp_la_LIBADD = $(BUILD_WITH_LIBRABBITMQ_LIBS) \
186                  libcmds.la libformat_graphite.la libformat_json.la
187 endif
188
189 if BUILD_PLUGIN_APACHE
190 pkglib_LTLIBRARIES += apache.la
191 apache_la_SOURCES = apache.c
192 apache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
193 apache_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
194 apache_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
195 endif
196
197
198 if BUILD_PLUGIN_APCUPS
199 pkglib_LTLIBRARIES += apcups.la
200 apcups_la_SOURCES = apcups.c
201 apcups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
202 apcups_la_LIBADD =
203 if BUILD_WITH_LIBSOCKET
204 apcups_la_LIBADD += -lsocket
205 endif
206 endif
207
208 if BUILD_PLUGIN_APPLE_SENSORS
209 pkglib_LTLIBRARIES += apple_sensors.la
210 apple_sensors_la_SOURCES = apple_sensors.c
211 apple_sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS) -framework IOKit
212 endif
213
214 if BUILD_PLUGIN_AQUAERO
215 pkglib_LTLIBRARIES += aquaero.la
216 aquaero_la_SOURCES = aquaero.c
217 aquaero_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBAQUAERO5_CFLAGS)
218 aquaero_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
219 aquaero_la_LIBADD = -laquaero5
220 endif
221
222 if BUILD_PLUGIN_ASCENT
223 pkglib_LTLIBRARIES += ascent.la
224 ascent_la_SOURCES = ascent.c
225 ascent_la_LDFLAGS = $(PLUGIN_LDFLAGS)
226 ascent_la_CFLAGS = $(AM_CFLAGS) \
227                 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
228 ascent_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
229 endif
230
231 if BUILD_PLUGIN_BAROMETER
232 pkglib_LTLIBRARIES += barometer.la
233 barometer_la_SOURCES = barometer.c
234 barometer_la_LDFLAGS = $(PLUGIN_LDFLAGS)
235 barometer_la_LIBADD = -lm
236 endif
237
238 if BUILD_PLUGIN_BATTERY
239 pkglib_LTLIBRARIES += battery.la
240 battery_la_SOURCES = battery.c battery_statefs.c
241 battery_la_LDFLAGS = $(PLUGIN_LDFLAGS)
242 if BUILD_WITH_LIBIOKIT
243 battery_la_LDFLAGS += -framework IOKit
244 endif
245 endif
246
247 if BUILD_PLUGIN_BIND
248 pkglib_LTLIBRARIES += bind.la
249 bind_la_SOURCES = bind.c
250 bind_la_LDFLAGS = $(PLUGIN_LDFLAGS)
251 bind_la_CFLAGS = $(AM_CFLAGS) \
252                  $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
253 bind_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
254 endif
255
256 if BUILD_PLUGIN_CEPH
257 pkglib_LTLIBRARIES += ceph.la
258 ceph_la_SOURCES = ceph.c
259 ceph_la_CFLAGS = $(AM_CFLAGS)
260 ceph_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
261 ceph_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
262 ceph_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
263 endif
264
265 if BUILD_PLUGIN_CGROUPS
266 pkglib_LTLIBRARIES += cgroups.la
267 cgroups_la_SOURCES = cgroups.c
268 cgroups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
269 cgroups_la_LIBADD = libmount.la
270 endif
271
272 if BUILD_PLUGIN_CHRONY
273 pkglib_LTLIBRARIES += chrony.la
274 chrony_la_SOURCES = chrony.c
275 chrony_la_LDFLAGS = $(PLUGIN_LDFLAGS)
276 chrony_la_LIBADD = -lm
277 endif
278
279 if BUILD_PLUGIN_CONNTRACK
280 pkglib_LTLIBRARIES += conntrack.la
281 conntrack_la_SOURCES = conntrack.c
282 conntrack_la_LDFLAGS = $(PLUGIN_LDFLAGS)
283 endif
284
285 if BUILD_PLUGIN_CONTEXTSWITCH
286 pkglib_LTLIBRARIES += contextswitch.la
287 contextswitch_la_SOURCES = contextswitch.c
288 contextswitch_la_LDFLAGS = $(PLUGIN_LDFLAGS)
289 contextswitch_la_LIBADD =
290 if BUILD_WITH_PERFSTAT
291 contextswitch_la_LIBADD += -lperfstat
292 endif
293 endif
294
295 if BUILD_PLUGIN_CPU
296 pkglib_LTLIBRARIES += cpu.la
297 cpu_la_SOURCES = cpu.c
298 cpu_la_CFLAGS = $(AM_CFLAGS)
299 cpu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
300 cpu_la_LIBADD =
301 if BUILD_WITH_LIBKSTAT
302 cpu_la_LIBADD += -lkstat
303 endif
304 if BUILD_WITH_LIBDEVINFO
305 cpu_la_LIBADD += -ldevinfo
306 endif
307 if BUILD_WITH_LIBSTATGRAB
308 cpu_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
309 cpu_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
310 endif
311 if BUILD_WITH_PERFSTAT
312 cpu_la_LIBADD += -lperfstat
313 endif
314 endif
315
316 if BUILD_PLUGIN_CPUFREQ
317 pkglib_LTLIBRARIES += cpufreq.la
318 cpufreq_la_SOURCES = cpufreq.c
319 cpufreq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
320 endif
321
322 if BUILD_PLUGIN_CPUSLEEP
323 pkglib_LTLIBRARIES += cpusleep.la
324 cpusleep_la_SOURCES = cpusleep.c
325 cpusleep_la_LDFLAGS = $(PLUGIN_LDFLAGS)
326 endif
327
328 if BUILD_PLUGIN_CSV
329 pkglib_LTLIBRARIES += csv.la
330 csv_la_SOURCES = csv.c
331 csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
332 endif
333
334 if BUILD_PLUGIN_CURL
335 pkglib_LTLIBRARIES += curl.la
336 curl_la_SOURCES = curl.c \
337                   utils_curl_stats.c utils_curl_stats.h \
338                   utils_match.c utils_match.h
339 curl_la_LDFLAGS = $(PLUGIN_LDFLAGS)
340 curl_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
341 curl_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) liblatency.la
342 endif
343
344 if BUILD_PLUGIN_CURL_JSON
345 pkglib_LTLIBRARIES += curl_json.la
346 curl_json_la_SOURCES = curl_json.c \
347                   utils_curl_stats.c utils_curl_stats.h
348 curl_json_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
349 curl_json_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
350 curl_json_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
351 curl_json_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBYAJL_LIBS)
352 endif
353
354 if BUILD_PLUGIN_CURL_XML
355 pkglib_LTLIBRARIES += curl_xml.la
356 curl_xml_la_SOURCES = curl_xml.c \
357                   utils_curl_stats.c utils_curl_stats.h
358 curl_xml_la_LDFLAGS = $(PLUGIN_LDFLAGS)
359 curl_xml_la_CFLAGS = $(AM_CFLAGS) \
360                 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
361 curl_xml_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
362 endif
363
364 if BUILD_PLUGIN_DBI
365 pkglib_LTLIBRARIES += dbi.la
366 dbi_la_SOURCES = dbi.c \
367                  utils_db_query.c utils_db_query.h
368 dbi_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBDBI_CPPFLAGS)
369 dbi_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBDBI_LDFLAGS)
370 dbi_la_LIBADD = $(BUILD_WITH_LIBDBI_LIBS)
371 endif
372
373 if BUILD_PLUGIN_DF
374 pkglib_LTLIBRARIES += df.la
375 df_la_SOURCES = df.c
376 df_la_LDFLAGS = $(PLUGIN_LDFLAGS)
377 df_la_LIBADD = libmount.la
378 endif
379
380 if BUILD_PLUGIN_DISK
381 pkglib_LTLIBRARIES += disk.la
382 disk_la_SOURCES = disk.c
383 disk_la_CFLAGS = $(AM_CFLAGS)
384 disk_la_LDFLAGS = $(PLUGIN_LDFLAGS)
385 disk_la_LIBADD =
386 if BUILD_WITH_LIBKSTAT
387 disk_la_LIBADD += -lkstat
388 endif
389 if BUILD_WITH_LIBDEVINFO
390 disk_la_LIBADD += -ldevinfo
391 endif
392 if BUILD_WITH_LIBIOKIT
393 disk_la_LDFLAGS += -framework IOKit
394 endif
395 if BUILD_WITH_LIBSTATGRAB
396 disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
397 disk_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
398 endif
399 if BUILD_WITH_LIBUDEV
400 disk_la_CFLAGS += $(BUILD_WITH_LIBUDEV_CFLAGS)
401 disk_la_LDFLAGS += $(BUILD_WITH_LIBUDEV_LDFLAGS)
402 disk_la_LIBADD += $(BUILD_WITH_LIBUDEV_LIBS)
403 endif
404 if BUILD_FREEBSD
405 disk_la_LIBADD += -ldevstat -lgeom
406 endif
407 if BUILD_WITH_PERFSTAT
408 disk_la_LIBADD += -lperfstat
409 endif
410 endif
411
412 if BUILD_PLUGIN_DNS
413 pkglib_LTLIBRARIES += dns.la
414 dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
415 dns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
416 dns_la_LIBADD = -lpcap
417 endif
418
419 if BUILD_PLUGIN_DPDKSTAT
420 pkglib_LTLIBRARIES += dpdkstat.la
421 dpdkstat_la_SOURCES = dpdkstat.c
422 dpdkstat_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS)
423 dpdkstat_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS)
424 dpdkstat_la_LIBADD = -ldpdk
425 endif
426
427 if BUILD_PLUGIN_DRBD
428 pkglib_LTLIBRARIES += drbd.la
429 drbd_la_SOURCES = drbd.c
430 drbd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
431 endif
432
433 if BUILD_PLUGIN_EMAIL
434 pkglib_LTLIBRARIES += email.la
435 email_la_SOURCES = email.c
436 email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
437 endif
438
439 if BUILD_PLUGIN_ENTROPY
440 pkglib_LTLIBRARIES += entropy.la
441 entropy_la_SOURCES = entropy.c
442 entropy_la_LDFLAGS = $(PLUGIN_LDFLAGS)
443 endif
444
445 if BUILD_PLUGIN_EXEC
446 pkglib_LTLIBRARIES += exec.la
447 exec_la_SOURCES = exec.c
448 exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
449 exec_la_LIBADD = libcmds.la
450 endif
451
452 if BUILD_PLUGIN_ETHSTAT
453 pkglib_LTLIBRARIES += ethstat.la
454 ethstat_la_SOURCES = ethstat.c
455 ethstat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
456 endif
457
458 if BUILD_PLUGIN_FHCOUNT
459 pkglib_LTLIBRARIES += fhcount.la
460 fhcount_la_SOURCES = fhcount.c
461 fhcount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
462 endif
463
464 if BUILD_PLUGIN_FILECOUNT
465 pkglib_LTLIBRARIES += filecount.la
466 filecount_la_SOURCES = filecount.c
467 filecount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
468 endif
469
470 if BUILD_PLUGIN_GMOND
471 pkglib_LTLIBRARIES += gmond.la
472 gmond_la_SOURCES = gmond.c
473 gmond_la_CPPFLAGS = $(AM_CPPFLAGS) $(GANGLIA_CPPFLAGS)
474 gmond_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(GANGLIA_LDFLAGS)
475 gmond_la_LIBADD = $(GANGLIA_LIBS)
476 endif
477
478 if BUILD_PLUGIN_GPS
479 pkglib_LTLIBRARIES += gps.la
480 gps_la_SOURCES = gps.c
481 gps_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBGPS_CFLAGS)
482 gps_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBGPS_LDFLAGS)
483 gps_la_LIBADD = -lpthread $(BUILD_WITH_LIBGPS_LIBS)
484 endif
485
486 if BUILD_PLUGIN_GRPC
487 pkglib_LTLIBRARIES += grpc.la
488 grpc_la_SOURCES = grpc.cc
489 nodist_grpc_la_SOURCES = collectd.grpc.pb.cc collectd.pb.cc types.pb.cc
490 grpc_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBGRPCPP_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_CPPFLAGS)
491 grpc_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBGRPCPP_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_LDFLAGS)
492 grpc_la_LIBADD = $(BUILD_WITH_LIBGRPCPP_LIBS) $(BUILD_WITH_LIBPROTOBUF_LIBS)
493 endif
494
495 if BUILD_PLUGIN_HDDTEMP
496 pkglib_LTLIBRARIES += hddtemp.la
497 hddtemp_la_SOURCES = hddtemp.c
498 hddtemp_la_LDFLAGS = $(PLUGIN_LDFLAGS)
499 hddtemp_la_LIBADD =
500 if BUILD_WITH_LIBSOCKET
501 hddtemp_la_LIBADD += -lsocket
502 endif
503 endif
504
505 if BUILD_PLUGIN_HUGEPAGES
506 pkglib_LTLIBRARIES += hugepages.la
507 hugepages_la_SOURCES = hugepages.c
508 hugepages_la_LDFLAGS = $(PLUGIN_LDFLAGS)
509 endif
510
511 if BUILD_PLUGIN_INTERFACE
512 pkglib_LTLIBRARIES += interface.la
513 interface_la_SOURCES = interface.c
514 interface_la_CFLAGS = $(AM_CFLAGS)
515 interface_la_LDFLAGS = $(PLUGIN_LDFLAGS)
516 interface_la_LIBADD =
517 if BUILD_WITH_LIBSTATGRAB
518 interface_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
519 interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
520 else
521 if BUILD_WITH_LIBKSTAT
522 interface_la_LIBADD += -lkstat
523 endif
524 if BUILD_WITH_LIBDEVINFO
525 interface_la_LIBADD += -ldevinfo
526 endif # BUILD_WITH_LIBDEVINFO
527 endif # !BUILD_WITH_LIBSTATGRAB
528 if BUILD_WITH_PERFSTAT
529 interface_la_LIBADD += -lperfstat
530 endif
531 endif # BUILD_PLUGIN_INTERFACE
532
533 if BUILD_PLUGIN_IPC
534 pkglib_LTLIBRARIES += ipc.la
535 ipc_la_SOURCES = ipc.c
536 ipc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
537 endif
538
539 if BUILD_PLUGIN_IPTABLES
540 pkglib_LTLIBRARIES += iptables.la
541 iptables_la_SOURCES = iptables.c
542 iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS)
543 iptables_la_LDFLAGS = $(PLUGIN_LDFLAGS)
544 iptables_la_LIBADD = $(BUILD_WITH_LIBIPTC_LDFLAGS)
545 endif
546
547 if BUILD_PLUGIN_IPMI
548 pkglib_LTLIBRARIES += ipmi.la
549 ipmi_la_SOURCES = ipmi.c
550 ipmi_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_OPENIPMI_CFLAGS)
551 ipmi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
552 ipmi_la_LIBADD = $(BUILD_WITH_OPENIPMI_LIBS)
553 endif
554
555 if BUILD_PLUGIN_IPVS
556 pkglib_LTLIBRARIES += ipvs.la
557 ipvs_la_SOURCES = ipvs.c
558 ipvs_la_CFLAGS = $(AM_CFLAGS)
559 if IP_VS_H_NEEDS_KERNEL_CFLAGS
560 ipvs_la_CFLAGS += $(KERNEL_CFLAGS)
561 endif
562 ipvs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
563 endif
564
565 if BUILD_PLUGIN_IRQ
566 pkglib_LTLIBRARIES += irq.la
567 irq_la_SOURCES = irq.c
568 irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
569 endif
570
571 if BUILD_PLUGIN_JAVA
572 pkglib_LTLIBRARIES += java.la
573 java_la_SOURCES = java.c
574 java_la_CPPFLAGS = $(AM_CPPFLAGS) $(JAVA_CPPFLAGS)
575 java_la_CFLAGS = $(AM_CFLAGS) $(JAVA_CFLAGS)
576 java_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(JAVA_LDFLAGS)
577 java_la_LIBADD = $(JAVA_LIBS)
578 endif
579
580 if BUILD_PLUGIN_LOAD
581 pkglib_LTLIBRARIES += load.la
582 load_la_SOURCES = load.c
583 load_la_CFLAGS = $(AM_CFLAGS)
584 load_la_LDFLAGS = $(PLUGIN_LDFLAGS)
585 load_la_LIBADD =
586 if BUILD_WITH_LIBSTATGRAB
587 load_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
588 load_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
589 endif # BUILD_WITH_LIBSTATGRAB
590 if BUILD_WITH_PERFSTAT
591 load_la_LIBADD += -lperfstat
592 endif
593 endif # BUILD_PLUGIN_LOAD
594
595 if BUILD_PLUGIN_LOGFILE
596 pkglib_LTLIBRARIES += logfile.la
597 logfile_la_SOURCES = logfile.c
598 logfile_la_LDFLAGS = $(PLUGIN_LDFLAGS)
599 endif
600
601 if BUILD_PLUGIN_LOG_LOGSTASH
602 pkglib_LTLIBRARIES += log_logstash.la
603 log_logstash_la_SOURCES = log_logstash.c
604 log_logstash_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
605 log_logstash_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
606 log_logstash_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
607 endif
608
609 if BUILD_PLUGIN_LPAR
610 pkglib_LTLIBRARIES += lpar.la
611 lpar_la_SOURCES = lpar.c
612 lpar_la_LDFLAGS = $(PLUGIN_LDFLAGS)
613 lpar_la_LIBADD = -lperfstat
614 endif
615
616 if BUILD_PLUGIN_LUA
617 pkglib_LTLIBRARIES += lua.la
618 lua_la_SOURCES = lua.c \
619                  utils_lua.c utils_lua.h
620 lua_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBLUA_CFLAGS)
621 lua_la_LDFLAGS = $(PLUGIN_LDFLAGS)
622 lua_la_LIBADD = $(BUILD_WITH_LIBLUA_LIBS)
623 endif
624
625 if BUILD_PLUGIN_LVM
626 pkglib_LTLIBRARIES += lvm.la
627 lvm_la_SOURCES = lvm.c
628 lvm_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
629 lvm_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBLVM2APP_LDFLAGS)
630 lvm_la_LIBADD = $(BUILD_WITH_LIBLVM2APP_LIBS)
631 endif
632
633 if BUILD_PLUGIN_MADWIFI
634 pkglib_LTLIBRARIES += madwifi.la
635 madwifi_la_SOURCES = madwifi.c madwifi.h
636 madwifi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
637 endif
638
639 if BUILD_PLUGIN_MATCH_EMPTY_COUNTER
640 pkglib_LTLIBRARIES += match_empty_counter.la
641 match_empty_counter_la_SOURCES = match_empty_counter.c
642 match_empty_counter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
643 endif
644
645 if BUILD_PLUGIN_MATCH_HASHED
646 pkglib_LTLIBRARIES += match_hashed.la
647 match_hashed_la_SOURCES = match_hashed.c
648 match_hashed_la_LDFLAGS = $(PLUGIN_LDFLAGS)
649 endif
650
651 if BUILD_PLUGIN_MATCH_REGEX
652 pkglib_LTLIBRARIES += match_regex.la
653 match_regex_la_SOURCES = match_regex.c
654 match_regex_la_LDFLAGS = $(PLUGIN_LDFLAGS)
655 endif
656
657 if BUILD_PLUGIN_MATCH_TIMEDIFF
658 pkglib_LTLIBRARIES += match_timediff.la
659 match_timediff_la_SOURCES = match_timediff.c
660 match_timediff_la_LDFLAGS = $(PLUGIN_LDFLAGS)
661 endif
662
663 if BUILD_PLUGIN_MATCH_VALUE
664 pkglib_LTLIBRARIES += match_value.la
665 match_value_la_SOURCES = match_value.c
666 match_value_la_LDFLAGS = $(PLUGIN_LDFLAGS)
667 endif
668
669 if BUILD_PLUGIN_MBMON
670 pkglib_LTLIBRARIES += mbmon.la
671 mbmon_la_SOURCES = mbmon.c
672 mbmon_la_LDFLAGS = $(PLUGIN_LDFLAGS)
673 mbmon_la_LIBADD =
674 if BUILD_WITH_LIBSOCKET
675 mbmon_la_LIBADD += -lsocket
676 endif
677 endif
678
679 if BUILD_PLUGIN_MD
680 pkglib_LTLIBRARIES += md.la
681 md_la_SOURCES = md.c
682 md_la_LDFLAGS = $(PLUGIN_LDFLAGS)
683 endif
684
685 if BUILD_PLUGIN_MEMCACHEC
686 pkglib_LTLIBRARIES += memcachec.la
687 memcachec_la_SOURCES = memcachec.c \
688                        utils_match.c utils_match.h
689 memcachec_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
690 memcachec_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
691 memcachec_la_LIBADD = $(BUILD_WITH_LIBMEMCACHED_LIBS) liblatency.la
692 endif
693
694 if BUILD_PLUGIN_MEMCACHED
695 pkglib_LTLIBRARIES += memcached.la
696 memcached_la_SOURCES = memcached.c
697 memcached_la_LDFLAGS = $(PLUGIN_LDFLAGS)
698 memcached_la_LIBADD =
699 if BUILD_WITH_LIBSOCKET
700 memcached_la_LIBADD += -lsocket
701 endif
702 endif
703
704 if BUILD_PLUGIN_MEMORY
705 pkglib_LTLIBRARIES += memory.la
706 memory_la_SOURCES = memory.c
707 memory_la_CFLAGS = $(AM_CFLAGS)
708 memory_la_LDFLAGS = $(PLUGIN_LDFLAGS)
709 memory_la_LIBADD =
710 if BUILD_WITH_LIBKSTAT
711 memory_la_LIBADD += -lkstat
712 endif
713 if BUILD_WITH_LIBDEVINFO
714 memory_la_LIBADD += -ldevinfo
715 endif
716 if BUILD_WITH_LIBSTATGRAB
717 memory_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
718 memory_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
719 endif
720 if BUILD_WITH_PERFSTAT
721 memory_la_LIBADD += -lperfstat
722 endif
723 endif
724
725 if BUILD_PLUGIN_MIC
726 pkglib_LTLIBRARIES += mic.la
727 mic_la_SOURCES = mic.c
728 mic_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_MIC_LIBPATH)
729 mic_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_MIC_CPPFLAGS)
730 mic_la_LIBADD = $(BUILD_WITH_MIC_LDADD)
731 endif
732
733 if BUILD_PLUGIN_MODBUS
734 pkglib_LTLIBRARIES += modbus.la
735 modbus_la_SOURCES = modbus.c
736 modbus_la_LDFLAGS = $(PLUGIN_LDFLAGS)
737 modbus_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMODBUS_CFLAGS)
738 modbus_la_LIBADD = $(BUILD_WITH_LIBMODBUS_LIBS)
739 endif
740
741 if BUILD_PLUGIN_MQTT
742 pkglib_LTLIBRARIES += mqtt.la
743 mqtt_la_SOURCES = mqtt.c
744 mqtt_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
745 mqtt_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
746 mqtt_la_LIBADD = $(BUILD_WITH_LIBMOSQUITTO_LIBS)
747 endif
748
749 if BUILD_PLUGIN_MULTIMETER
750 pkglib_LTLIBRARIES += multimeter.la
751 multimeter_la_SOURCES = multimeter.c
752 multimeter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
753 endif
754
755 if BUILD_PLUGIN_MYSQL
756 pkglib_LTLIBRARIES += mysql.la
757 mysql_la_SOURCES = mysql.c
758 mysql_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMYSQL_CFLAGS)
759 mysql_la_LDFLAGS = $(PLUGIN_LDFLAGS)
760 mysql_la_LIBADD = $(BUILD_WITH_LIBMYSQL_LIBS)
761 endif
762
763 if BUILD_PLUGIN_NETAPP
764 pkglib_LTLIBRARIES += netapp.la
765 netapp_la_SOURCES = netapp.c
766 netapp_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBNETAPP_CPPFLAGS)
767 netapp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBNETAPP_LDFLAGS)
768 netapp_la_LIBADD = $(LIBNETAPP_LIBS)
769 endif
770
771 if BUILD_PLUGIN_NETLINK
772 pkglib_LTLIBRARIES += netlink.la
773 netlink_la_SOURCES = netlink.c
774 netlink_la_LDFLAGS = $(PLUGIN_LDFLAGS)
775 netlink_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMNL_CFLAGS)
776 netlink_la_LIBADD = $(BUILD_WITH_LIBMNL_LIBS)
777 endif
778
779 if BUILD_PLUGIN_NETWORK
780 pkglib_LTLIBRARIES += network.la
781 network_la_SOURCES = network.c network.h \
782                      utils_fbhash.c utils_fbhash.h
783 network_la_CPPFLAGS = $(AM_CPPFLAGS)
784 network_la_LDFLAGS = $(PLUGIN_LDFLAGS)
785 network_la_LIBADD =
786 if BUILD_WITH_LIBSOCKET
787 network_la_LIBADD += -lsocket
788 endif
789 if BUILD_WITH_LIBGCRYPT
790 network_la_CPPFLAGS += $(GCRYPT_CPPFLAGS)
791 network_la_LDFLAGS += $(GCRYPT_LDFLAGS)
792 network_la_LIBADD += $(GCRYPT_LIBS)
793 endif
794 endif
795
796 if BUILD_PLUGIN_NFS
797 pkglib_LTLIBRARIES += nfs.la
798 nfs_la_SOURCES = nfs.c
799 nfs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
800 endif
801
802 if BUILD_PLUGIN_FSCACHE
803 pkglib_LTLIBRARIES += fscache.la
804 fscache_la_SOURCES = fscache.c
805 fscache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
806 endif
807
808 if BUILD_PLUGIN_NGINX
809 pkglib_LTLIBRARIES += nginx.la
810 nginx_la_SOURCES = nginx.c
811 nginx_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
812 nginx_la_LDFLAGS = $(PLUGIN_LDFLAGS)
813 nginx_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
814 endif
815
816 if BUILD_PLUGIN_NOTIFY_DESKTOP
817 pkglib_LTLIBRARIES += notify_desktop.la
818 notify_desktop_la_SOURCES = notify_desktop.c
819 notify_desktop_la_CFLAGS = $(AM_CFLAGS) $(LIBNOTIFY_CFLAGS)
820 notify_desktop_la_LDFLAGS = $(PLUGIN_LDFLAGS)
821 notify_desktop_la_LIBADD = $(LIBNOTIFY_LIBS)
822 endif
823
824 if BUILD_PLUGIN_NOTIFY_EMAIL
825 pkglib_LTLIBRARIES += notify_email.la
826 notify_email_la_SOURCES = notify_email.c
827 notify_email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
828 notify_email_la_LIBADD = -lesmtp
829 endif
830
831 if BUILD_PLUGIN_NOTIFY_NAGIOS
832 pkglib_LTLIBRARIES += notify_nagios.la
833 notify_nagios_la_SOURCES = notify_nagios.c
834 notify_nagios_la_LDFLAGS = $(PLUGIN_LDFLAGS)
835 endif
836
837 if BUILD_PLUGIN_NTPD
838 pkglib_LTLIBRARIES += ntpd.la
839 ntpd_la_SOURCES = ntpd.c
840 ntpd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
841 ntpd_la_LIBADD =
842 if BUILD_WITH_LIBSOCKET
843 ntpd_la_LIBADD += -lsocket
844 endif
845 endif
846
847 if BUILD_PLUGIN_NUMA
848 pkglib_LTLIBRARIES += numa.la
849 numa_la_SOURCES = numa.c
850 numa_la_LDFLAGS = $(PLUGIN_LDFLAGS)
851 endif
852
853 if BUILD_PLUGIN_NUT
854 pkglib_LTLIBRARIES += nut.la
855 nut_la_SOURCES = nut.c
856 nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
857 nut_la_LDFLAGS = $(PLUGIN_LDFLAGS)
858 nut_la_LIBADD = $(BUILD_WITH_LIBUPSCLIENT_LIBS)
859 endif
860
861 if BUILD_PLUGIN_OLSRD
862 pkglib_LTLIBRARIES += olsrd.la
863 olsrd_la_SOURCES = olsrd.c
864 olsrd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
865 olsrd_la_LIBADD =
866 if BUILD_WITH_LIBSOCKET
867 olsrd_la_LIBADD += -lsocket
868 endif
869 endif
870
871 if BUILD_PLUGIN_ONEWIRE
872 pkglib_LTLIBRARIES += onewire.la
873 onewire_la_SOURCES = onewire.c
874 onewire_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
875 onewire_la_LIBADD = $(BUILD_WITH_LIBOWCAPI_LIBS)
876 onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOWCAPI_LDFLAGS)
877 endif
878
879 if BUILD_PLUGIN_OPENLDAP
880 pkglib_LTLIBRARIES += openldap.la
881 openldap_la_SOURCES = openldap.c
882 openldap_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBLDAP_CPPFLAGS)
883 openldap_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBLDAP_LDFLAGS)
884 openldap_la_LIBADD = -lldap
885 endif
886
887 if BUILD_PLUGIN_OPENVPN
888 pkglib_LTLIBRARIES += openvpn.la
889 openvpn_la_SOURCES = openvpn.c
890 openvpn_la_LDFLAGS = $(PLUGIN_LDFLAGS)
891 endif
892
893 if BUILD_PLUGIN_ORACLE
894 pkglib_LTLIBRARIES += oracle.la
895 oracle_la_SOURCES = oracle.c \
896         utils_db_query.c utils_db_query.h
897 oracle_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_ORACLE_CPPFLAGS)
898 oracle_la_LIBADD = $(BUILD_WITH_ORACLE_LIBS)
899 oracle_la_LDFLAGS = $(PLUGIN_LDFLAGS)
900 endif
901
902 if BUILD_PLUGIN_PERL
903 pkglib_LTLIBRARIES += perl.la
904 perl_la_SOURCES = perl.c
905 # Despite C99 providing the "bool" type thru stdbool.h, Perl defines its own
906 # version of that type if HAS_BOOL is not defined... *sigh*
907 perl_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAS_BOOL=1
908 # Despite off_t being 64 bit wide on 64 bit platforms, Perl insist on using
909 # off64_t which is only exposed when _LARGEFILE64_SOURCE is defined... *sigh*
910 # On older platforms we also need _REENTRANT. _GNU_SOURCE sets both of these.
911 perl_la_CPPFLAGS += -D_GNU_SOURCE
912 perl_la_CFLAGS  = $(AM_CFLAGS) \
913                 $(PERL_CFLAGS) \
914                 -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
915 # Work-around for issues #41 and #42 - Perl 5.10 incorrectly introduced
916 # __attribute__nonnull__(3) for Perl_load_module().
917 if HAVE_BROKEN_PERL_LOAD_MODULE
918 perl_la_CFLAGS += -Wno-nonnull
919 endif
920 perl_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
921                 $(PERL_LDFLAGS)
922 perl_la_LIBADD = $(PERL_LIBS)
923 endif
924
925 if BUILD_PLUGIN_PF
926 pkglib_LTLIBRARIES += pf.la
927 pf_la_SOURCES = pf.c
928 pf_la_LDFLAGS = $(PLUGIN_LDFLAGS)
929 endif
930
931 if BUILD_PLUGIN_PINBA
932 pkglib_LTLIBRARIES += pinba.la
933 pinba_la_SOURCES = pinba.c
934 nodist_pinba_la_SOURCES = pinba.pb-c.c pinba.pb-c.h
935 pinba_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS)
936 pinba_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_LDFLAGS)
937 pinba_la_LIBADD = $(BUILD_WITH_LIBPROTOBUF_C_LIBS)
938 endif
939
940 if BUILD_PLUGIN_PING
941 pkglib_LTLIBRARIES += ping.la
942 ping_la_SOURCES = ping.c
943 ping_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOPING_CPPFLAGS)
944 ping_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOPING_LDFLAGS)
945 ping_la_LIBADD = -loping -lm
946 endif
947
948 if BUILD_PLUGIN_POSTGRESQL
949 pkglib_LTLIBRARIES += postgresql.la
950 postgresql_la_SOURCES = postgresql.c \
951                  utils_db_query.c utils_db_query.h
952 postgresql_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPQ_CPPFLAGS)
953 postgresql_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
954                 $(BUILD_WITH_LIBPQ_LDFLAGS)
955 postgresql_la_LIBADD = -lpq
956 endif
957
958 if BUILD_PLUGIN_POWERDNS
959 pkglib_LTLIBRARIES += powerdns.la
960 powerdns_la_SOURCES = powerdns.c
961 powerdns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
962 endif
963
964 if BUILD_PLUGIN_PYTHON
965 pkglib_LTLIBRARIES += python.la
966 python_la_SOURCES = python.c pyconfig.c pyvalues.c cpython.h
967 python_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBPYTHON_CPPFLAGS)
968 if COMPILER_IS_GCC
969 python_la_CPPFLAGS += -fno-strict-aliasing -Wno-strict-aliasing
970 endif
971 python_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBPYTHON_LDFLAGS)
972 endif
973
974 if BUILD_PLUGIN_PROCESSES
975 pkglib_LTLIBRARIES += processes.la
976 processes_la_SOURCES = processes.c
977 processes_la_LDFLAGS = $(PLUGIN_LDFLAGS)
978 processes_la_LIBADD =
979 if BUILD_WITH_LIBKVM_GETPROCS
980 processes_la_LIBADD += -lkvm
981 endif
982 endif
983
984 if BUILD_PLUGIN_PROTOCOLS
985 pkglib_LTLIBRARIES += protocols.la
986 protocols_la_SOURCES = protocols.c
987 protocols_la_LDFLAGS = $(PLUGIN_LDFLAGS)
988 endif
989
990 if BUILD_PLUGIN_INTEL_RDT
991 pkglib_LTLIBRARIES += intel_rdt.la
992 intel_rdt_la_SOURCES = intel_rdt.c
993 intel_rdt_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPQOS_LDFLAGS)
994 intel_rdt_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBPQOS_CPPFLAGS)
995 intel_rdt_la_LIBADD = $(BUILD_WITH_LIBPQOS_LIBS)
996 endif
997
998 if BUILD_PLUGIN_REDIS
999 pkglib_LTLIBRARIES += redis.la
1000 redis_la_SOURCES = redis.c
1001 redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
1002 redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
1003 redis_la_LIBADD = -lhiredis
1004 endif
1005
1006 if BUILD_PLUGIN_ROUTEROS
1007 pkglib_LTLIBRARIES += routeros.la
1008 routeros_la_SOURCES = routeros.c
1009 routeros_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
1010 routeros_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBROUTEROS_LDFLAGS)
1011 routeros_la_LIBADD = -lrouteros
1012 endif
1013
1014 if BUILD_PLUGIN_RRDCACHED
1015 pkglib_LTLIBRARIES += rrdcached.la
1016 rrdcached_la_SOURCES = rrdcached.c utils_rrdcreate.c utils_rrdcreate.h
1017 rrdcached_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRRD_LDFLAGS)
1018 rrdcached_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
1019 rrdcached_la_LIBADD = $(BUILD_WITH_LIBRRD_LIBS)
1020 endif
1021
1022 if BUILD_PLUGIN_RRDTOOL
1023 pkglib_LTLIBRARIES += rrdtool.la
1024 rrdtool_la_SOURCES = rrdtool.c utils_rrdcreate.c utils_rrdcreate.h
1025 rrdtool_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRRD_LDFLAGS)
1026 rrdtool_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
1027 rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LIBS)
1028 endif
1029
1030 if BUILD_PLUGIN_SENSORS
1031 pkglib_LTLIBRARIES += sensors.la
1032 sensors_la_SOURCES = sensors.c
1033 sensors_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSENSORS_CFLAGS)
1034 sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBSENSORS_LDFLAGS)
1035 sensors_la_LIBADD = -lsensors
1036 endif
1037
1038 if BUILD_PLUGIN_SERIAL
1039 pkglib_LTLIBRARIES += serial.la
1040 serial_la_SOURCES = serial.c
1041 serial_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1042 endif
1043
1044 if BUILD_PLUGIN_SIGROK
1045 pkglib_LTLIBRARIES += sigrok.la
1046 sigrok_la_SOURCES = sigrok.c
1047 sigrok_la_CFLAGS = $(AM_CFLAGS) $(LIBSIGROK_CFLAGS)
1048 sigrok_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1049 sigrok_la_LIBADD = $(LIBSIGROK_LIBS)
1050 endif
1051
1052 if BUILD_PLUGIN_SMART
1053 if BUILD_WITH_LIBUDEV
1054 pkglib_LTLIBRARIES += smart.la
1055 smart_la_SOURCES = smart.c
1056 smart_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBATASMART_CPPFLAGS) $(BUILD_WITH_LIBUDEV_CFLAGS)
1057 smart_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBATASMART_LDFLAGS) $(BUILD_WITH_LIBUDEV_LDFLAGS)
1058 smart_la_LIBADD = $(BUILD_WITH_LIBATASMART_LIBS) $(BUILD_WITH_LIBUDEV_LIBS)
1059 endif
1060 endif
1061
1062 if BUILD_PLUGIN_SNMP
1063 pkglib_LTLIBRARIES += snmp.la
1064 snmp_la_SOURCES = snmp.c
1065 snmp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
1066 snmp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBNETSNMP_LDFLAGS)
1067 snmp_la_LIBADD = $(BUILD_WITH_LIBNETSNMP_LIBS)
1068 endif
1069
1070 if BUILD_PLUGIN_STATSD
1071 pkglib_LTLIBRARIES += statsd.la
1072 statsd_la_SOURCES = statsd.c
1073 statsd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1074 statsd_la_LIBADD = liblatency.la
1075 endif
1076
1077 if BUILD_PLUGIN_SWAP
1078 pkglib_LTLIBRARIES += swap.la
1079 swap_la_SOURCES = swap.c
1080 swap_la_CFLAGS = $(AM_CFLAGS)
1081 swap_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1082 swap_la_LIBADD =
1083 if BUILD_WITH_LIBKSTAT
1084 swap_la_LIBADD += -lkstat
1085 endif
1086 if BUILD_WITH_LIBDEVINFO
1087 swap_la_LIBADD += -ldevinfo
1088 endif
1089 if BUILD_WITH_LIBKVM_GETSWAPINFO
1090 swap_la_LIBADD += -lkvm
1091 endif
1092 if BUILD_WITH_LIBSTATGRAB
1093 swap_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1094 swap_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1095 endif
1096 if BUILD_WITH_PERFSTAT
1097 swap_la_LIBADD += -lperfstat
1098 endif
1099
1100 endif
1101
1102 if BUILD_PLUGIN_SYSLOG
1103 pkglib_LTLIBRARIES += syslog.la
1104 syslog_la_SOURCES = syslog.c
1105 syslog_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1106 endif
1107
1108 if BUILD_PLUGIN_TABLE
1109 pkglib_LTLIBRARIES += table.la
1110 table_la_SOURCES = table.c
1111 table_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1112 endif
1113
1114 if BUILD_PLUGIN_TAIL
1115 pkglib_LTLIBRARIES += tail.la
1116 tail_la_SOURCES = tail.c \
1117                   utils_match.c utils_match.h \
1118                   utils_tail.c utils_tail.h \
1119                   utils_tail_match.c utils_tail_match.h
1120 tail_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1121 tail_la_LIBADD = liblatency.la
1122 endif
1123
1124 if BUILD_PLUGIN_TAIL_CSV
1125 pkglib_LTLIBRARIES += tail_csv.la
1126 tail_csv_la_SOURCES = tail_csv.c \
1127                       utils_tail.c utils_tail.h
1128 tail_csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1129 endif
1130
1131 if BUILD_PLUGIN_TAPE
1132 pkglib_LTLIBRARIES += tape.la
1133 tape_la_SOURCES = tape.c
1134 tape_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1135 tape_la_LIBADD = -lkstat -ldevinfo
1136 endif
1137
1138 if BUILD_PLUGIN_TARGET_NOTIFICATION
1139 pkglib_LTLIBRARIES += target_notification.la
1140 target_notification_la_SOURCES = target_notification.c
1141 target_notification_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1142 endif
1143
1144 if BUILD_PLUGIN_TARGET_REPLACE
1145 pkglib_LTLIBRARIES += target_replace.la
1146 target_replace_la_SOURCES = target_replace.c
1147 target_replace_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1148 endif
1149
1150 if BUILD_PLUGIN_TARGET_SCALE
1151 pkglib_LTLIBRARIES += target_scale.la
1152 target_scale_la_SOURCES = target_scale.c
1153 target_scale_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1154 endif
1155
1156 if BUILD_PLUGIN_TARGET_SET
1157 pkglib_LTLIBRARIES += target_set.la
1158 target_set_la_SOURCES = target_set.c
1159 target_set_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1160 endif
1161
1162 if BUILD_PLUGIN_TARGET_V5UPGRADE
1163 pkglib_LTLIBRARIES += target_v5upgrade.la
1164 target_v5upgrade_la_SOURCES = target_v5upgrade.c
1165 target_v5upgrade_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1166 endif
1167
1168 if BUILD_PLUGIN_TCPCONNS
1169 pkglib_LTLIBRARIES += tcpconns.la
1170 tcpconns_la_SOURCES = tcpconns.c
1171 tcpconns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1172 tcpconns_la_LIBADD =
1173 if BUILD_WITH_LIBKVM_NLIST
1174 tcpconns_la_LIBADD += -lkvm
1175 endif
1176 endif
1177
1178 if BUILD_PLUGIN_TEAMSPEAK2
1179 pkglib_LTLIBRARIES += teamspeak2.la
1180 teamspeak2_la_SOURCES = teamspeak2.c
1181 teamspeak2_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1182 endif
1183
1184 if BUILD_PLUGIN_TED
1185 pkglib_LTLIBRARIES += ted.la
1186 ted_la_SOURCES = ted.c
1187 ted_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1188 endif
1189
1190 if BUILD_PLUGIN_THERMAL
1191 pkglib_LTLIBRARIES += thermal.la
1192 thermal_la_SOURCES = thermal.c
1193 thermal_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1194 endif
1195
1196 if BUILD_PLUGIN_THRESHOLD
1197 pkglib_LTLIBRARIES += threshold.la
1198 threshold_la_SOURCES = threshold.c
1199 threshold_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1200 endif
1201
1202 if BUILD_PLUGIN_TOKYOTYRANT
1203 pkglib_LTLIBRARIES += tokyotyrant.la
1204 tokyotyrant_la_SOURCES = tokyotyrant.c
1205 tokyotyrant_la_CPPFLAGS  = $(AM_CPPFLAGS) $(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
1206 tokyotyrant_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
1207 tokyotyrant_la_LIBADD  = $(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
1208 if BUILD_WITH_LIBSOCKET
1209 tokyotyrant_la_LIBADD += -lsocket
1210 endif
1211 endif
1212
1213 if BUILD_PLUGIN_TURBOSTAT
1214 pkglib_LTLIBRARIES += turbostat.la
1215 turbostat_la_SOURCES = turbostat.c
1216 turbostat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1217 endif
1218
1219 if BUILD_PLUGIN_UNIXSOCK
1220 pkglib_LTLIBRARIES += unixsock.la
1221 unixsock_la_SOURCES = unixsock.c
1222 unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1223 unixsock_la_LIBADD =  libcmds.la
1224 endif
1225
1226 if BUILD_PLUGIN_UPTIME
1227 pkglib_LTLIBRARIES += uptime.la
1228 uptime_la_SOURCES = uptime.c
1229 uptime_la_CFLAGS = $(AM_CFLAGS)
1230 uptime_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1231 uptime_la_LIBADD =
1232 if BUILD_WITH_LIBKSTAT
1233 uptime_la_LIBADD += -lkstat
1234 endif
1235 if BUILD_WITH_PERFSTAT
1236 uptime_la_LIBADD += -lperfstat
1237 endif
1238 endif
1239
1240 if BUILD_PLUGIN_USERS
1241 pkglib_LTLIBRARIES += users.la
1242 users_la_SOURCES = users.c
1243 users_la_CFLAGS = $(AM_CFLAGS)
1244 users_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1245 users_la_LIBADD =
1246 if BUILD_WITH_LIBSTATGRAB
1247 users_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1248 users_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1249 endif
1250 endif
1251
1252 if BUILD_PLUGIN_UUID
1253 pkglib_LTLIBRARIES += uuid.la
1254 uuid_la_SOURCES = uuid.c
1255 uuid_la_CFLAGS  = $(AM_CFLAGS) $(BUILD_WITH_LIBHAL_CFLAGS)
1256 uuid_la_LIBADD  = $(BUILD_WITH_LIBHAL_LIBS)
1257 uuid_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1258 endif
1259
1260 if BUILD_PLUGIN_VARNISH
1261 pkglib_LTLIBRARIES += varnish.la
1262 varnish_la_SOURCES = varnish.c
1263 varnish_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1264 varnish_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBVARNISH_CFLAGS)
1265 varnish_la_LIBADD = $(BUILD_WITH_LIBVARNISH_LIBS)
1266 endif
1267
1268 if BUILD_PLUGIN_VIRT
1269 pkglib_LTLIBRARIES += virt.la
1270 virt_la_SOURCES = virt.c
1271 virt_la_CFLAGS = $(AM_CFLAGS) \
1272                 $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
1273 virt_la_LIBADD = $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
1274 virt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1275 endif
1276
1277 if BUILD_PLUGIN_VMEM
1278 pkglib_LTLIBRARIES += vmem.la
1279 vmem_la_SOURCES = vmem.c
1280 vmem_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1281 endif
1282
1283 if BUILD_PLUGIN_VSERVER
1284 pkglib_LTLIBRARIES += vserver.la
1285 vserver_la_SOURCES = vserver.c
1286 vserver_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1287 endif
1288
1289 if BUILD_PLUGIN_WIRELESS
1290 pkglib_LTLIBRARIES += wireless.la
1291 wireless_la_SOURCES = wireless.c
1292 wireless_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1293 endif
1294
1295 if BUILD_PLUGIN_WRITE_GRAPHITE
1296 pkglib_LTLIBRARIES += write_graphite.la
1297 write_graphite_la_SOURCES = write_graphite.c
1298 write_graphite_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1299 write_graphite_la_LIBADD = libformat_graphite.la
1300 endif
1301
1302 if BUILD_PLUGIN_WRITE_HTTP
1303 pkglib_LTLIBRARIES += write_http.la
1304 write_http_la_SOURCES = write_http.c \
1305                         utils_format_kairosdb.c utils_format_kairosdb.h
1306 write_http_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1307 write_http_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
1308 write_http_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) libformat_json.la
1309 endif
1310
1311 if BUILD_PLUGIN_WRITE_KAFKA
1312 pkglib_LTLIBRARIES += write_kafka.la
1313 write_kafka_la_SOURCES = write_kafka.c \
1314                          utils_crc32.c utils_crc32.h
1315 write_kafka_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
1316 write_kafka_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
1317 write_kafka_la_LIBADD = $(BUILD_WITH_LIBRDKAFKA_LIBS) \
1318                         libcmds.la libformat_graphite.la libformat_json.la
1319 endif
1320
1321 if BUILD_PLUGIN_WRITE_LOG
1322 pkglib_LTLIBRARIES += write_log.la
1323 write_log_la_SOURCES = write_log.c
1324 write_log_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1325 write_log_la_LIBADD = libformat_graphite.la libformat_json.la
1326 endif
1327
1328 if BUILD_PLUGIN_WRITE_MONGODB
1329 pkglib_LTLIBRARIES += write_mongodb.la
1330 write_mongodb_la_SOURCES = write_mongodb.c
1331 write_mongodb_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMONGOC_CPPFLAGS)
1332 write_mongodb_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMONGOC_LDFLAGS)
1333 write_mongodb_la_LIBADD = -lmongoc
1334 endif
1335
1336 if BUILD_PLUGIN_WRITE_PROMETHEUS
1337 pkglib_LTLIBRARIES += write_prometheus.la
1338 write_prometheus_la_SOURCES = write_prometheus.c
1339 nodist_write_prometheus_la_SOURCES = prometheus.pb-c.c prometheus.pb-c.h
1340 write_prometheus_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS) $(BUILD_WITH_LIBMICROHTTPD_CPPFLAGS)
1341 write_prometheus_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_LDFLAGS) $(BUILD_WITH_LIBMICROHTTPD_LDFLAGS)
1342 write_prometheus_la_LIBADD = $(BUILD_WITH_LIBPROTOBUF_C_LIBS) $(BUILD_WITH_LIBMICROHTTPD_LIBS)
1343 endif
1344
1345 if BUILD_PLUGIN_WRITE_REDIS
1346 pkglib_LTLIBRARIES += write_redis.la
1347 write_redis_la_SOURCES = write_redis.c
1348 write_redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
1349 write_redis_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
1350 write_redis_la_LIBADD = -lhiredis
1351 endif
1352
1353 if BUILD_PLUGIN_WRITE_RIEMANN
1354 pkglib_LTLIBRARIES += write_riemann.la
1355 write_riemann_la_SOURCES = write_riemann.c write_riemann_threshold.c write_riemann_threshold.h
1356 write_riemann_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBRIEMANN_CLIENT_LIBS)
1357 write_riemann_la_CFLAGS = $(AM_CFLAGS) $(LIBRIEMANN_CLIENT_CFLAGS)
1358 endif
1359
1360 if BUILD_PLUGIN_WRITE_SENSU
1361 pkglib_LTLIBRARIES += write_sensu.la
1362 write_sensu_la_SOURCES = write_sensu.c
1363 write_sensu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1364 endif
1365
1366 if BUILD_PLUGIN_WRITE_TSDB
1367 pkglib_LTLIBRARIES += write_tsdb.la
1368 write_tsdb_la_SOURCES = write_tsdb.c
1369 write_tsdb_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1370 endif
1371
1372 if BUILD_PLUGIN_XENCPU
1373 pkglib_LTLIBRARIES += xencpu.la
1374 xencpu_la_SOURCES = xencpu.c
1375 xencpu_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBXENCTL_CPPFLAGS)
1376 xencpu_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBXENCTL_LDFLAGS)
1377 xencpu_la_LIBADD = -lxenctrl
1378 endif
1379
1380 if BUILD_PLUGIN_XMMS
1381 pkglib_LTLIBRARIES += xmms.la
1382 xmms_la_SOURCES = xmms.c
1383 xmms_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBXMMS_CFLAGS)
1384 xmms_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1385 xmms_la_LIBADD = $(BUILD_WITH_LIBXMMS_LIBS)
1386 endif
1387
1388 if BUILD_PLUGIN_ZFS_ARC
1389 pkglib_LTLIBRARIES += zfs_arc.la
1390 zfs_arc_la_SOURCES = zfs_arc.c
1391 zfs_arc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1392 if BUILD_FREEBSD
1393 zfs_arc_la_LIBADD = -lm
1394 endif
1395 if BUILD_SOLARIS
1396 zfs_arc_la_LIBADD = -lkstat
1397 endif
1398 endif
1399
1400 if BUILD_PLUGIN_ZOOKEEPER
1401 pkglib_LTLIBRARIES += zookeeper.la
1402 zookeeper_la_SOURCES = zookeeper.c
1403 zookeeper_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1404 endif
1405
1406 BUILT_SOURCES += $(dist_man_MANS)
1407
1408 if BUILD_PLUGIN_ZONE
1409 pkglib_LTLIBRARIES += zone.la
1410 zone_la_SOURCES = zone.c
1411 zone_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1412 endif
1413
1414 dist_man_MANS = collectd.1 \
1415                 collectd.conf.5 \
1416                 collectd-email.5 \
1417                 collectd-exec.5 \
1418                 collectdctl.1 \
1419                 collectd-java.5 \
1420                 collectd-lua.5 \
1421                 collectdmon.1 \
1422                 collectd-nagios.1 \
1423                 collectd-perl.5 \
1424                 collectd-python.5 \
1425                 collectd-snmp.5 \
1426                 collectd-tg.1 \
1427                 collectd-threshold.5 \
1428                 collectd-unixsock.5 \
1429                 types.db.5
1430
1431 EXTRA_DIST =    collectd.conf.pod \
1432                 collectd-email.pod \
1433                 collectd-exec.pod \
1434                 collectdctl.pod \
1435                 collectd-java.pod \
1436                 collectd-lua.pod \
1437                 collectdmon.pod \
1438                 collectd-nagios.pod \
1439                 collectd-perl.pod \
1440                 collectd-python.pod \
1441                 collectd.pod \
1442                 collectd-snmp.pod \
1443                 collectd-tg.pod \
1444                 collectd-threshold.pod \
1445                 collectd-unixsock.pod \
1446                 postgresql_default.conf \
1447                 types.db \
1448                 types.db.pod \
1449                 valgrind.FreeBSD.suppress
1450
1451 AM_V_POD2MAN_C = $(am__v_POD2MAN_C_@AM_V@)
1452 am__v_POD2MAN_C_ = $(am__v_POD2MAN_C_@AM_DEFAULT_V@)
1453 am__v_POD2MAN_C_0 = @echo "  POD2MAN " $@;
1454 am__v_POD2MAN_C_1 =
1455
1456 .pod.1:
1457         $(AM_V_POD2MAN_C)pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
1458                 >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
1459         @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
1460         then \
1461                 echo "$@ has some POD errors!"; false; \
1462         fi
1463
1464 .pod.5:
1465         $(AM_V_POD2MAN_C)pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< \
1466                 >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
1467         @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
1468         then \
1469                 echo "$@ has some POD errors!"; false; \
1470         fi
1471
1472 AM_V_PROTOC_C = $(am__v_PROTOC_C_@AM_V@)
1473 am__v_PROTOC_C_ = $(am__v_PROTOC_C_@AM_DEFAULT_V@)
1474 am__v_PROTOC_C_0 = @echo "  PROTOC-C" $@;
1475 am__v_PROTOC_C_1 =
1476
1477 # Protocol buffer for the "pinba" plugin.
1478 EXTRA_DIST += pinba.proto
1479 if BUILD_PLUGIN_PINBA
1480 CLEANFILES += pinba.pb-c.c pinba.pb-c.h
1481 BUILT_SOURCES += pinba.pb-c.c pinba.pb-c.h
1482
1483 pinba.pb-c.c pinba.pb-c.h: pinba.proto
1484         $(AM_V_PROTOC_C)$(PROTOC_C) -I$(srcdir) --c_out . $(srcdir)/pinba.proto
1485 endif
1486
1487 # Protocol buffer for the "write_prometheus" plugin.
1488 if BUILD_PLUGIN_WRITE_PROMETHEUS
1489 CLEANFILES += prometheus.pb-c.c prometheus.pb-c.h
1490 BUILT_SOURCES += prometheus.pb-c.c prometheus.pb-c.h
1491
1492 prometheus.pb-c.c prometheus.pb-c.h: $(top_srcdir)/proto/prometheus.proto
1493         $(AM_V_PROTOC_C)$(PROTOC_C) -I$(top_srcdir)/proto --c_out=$(builddir) $(top_srcdir)/proto/prometheus.proto
1494 endif
1495
1496 install-exec-hook:
1497         $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
1498         if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
1499         then \
1500                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
1501         else \
1502                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
1503         fi; \
1504         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
1505         $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db;
1506         $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \
1507                 $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
1508
1509 uninstall-hook:
1510         rm -f $(DESTDIR)$(pkgdatadir)/types.db;
1511         rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
1512         rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
1513
1514 if BUILD_PLUGIN_CEPH
1515 test_plugin_ceph_SOURCES = ceph_test.c
1516 test_plugin_ceph_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
1517 test_plugin_ceph_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
1518 test_plugin_ceph_LDADD = daemon/libplugin_mock.la $(BUILD_WITH_LIBYAJL_LIBS)
1519 check_PROGRAMS += test_plugin_ceph
1520 TESTS += test_plugin_ceph
1521 endif