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