1 SUBDIRS = libcollectdclient
2 if BUILD_WITH_OWN_LIBOCONFIG
7 PLUGIN_LDFLAGS = -module -avoid-version -export-symbols-regex '\<module_register\>'
10 AM_CFLAGS = -Wall -Werror
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"'
21 AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
22 AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
24 AUTOMAKE_OPTIONS = subdir-objects
26 sbin_PROGRAMS = collectdmon
27 bin_PROGRAMS = collectd-nagios collectdctl collectd-tg
29 collectdmon_SOURCES = collectdmon.c
30 collectdmon_CPPFLAGS = $(AM_CPPFLAGS)
32 collectd_nagios_SOURCES = collectd-nagios.c
33 collectd_nagios_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
34 collectd_nagios_LDADD =
35 if BUILD_WITH_LIBSOCKET
36 collectd_nagios_LDADD += -lsocket
39 collectd_nagios_LDADD += -lm
42 collectd_nagios_LDADD += libcollectdclient/libcollectdclient.la
43 collectd_nagios_DEPENDENCIES = libcollectdclient/libcollectdclient.la
46 collectdctl_SOURCES = collectdctl.c
47 collectdctl_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
49 if BUILD_WITH_LIBSOCKET
50 collectdctl_LDADD += -lsocket
53 collectdctl_LDADD += -lm
55 collectdctl_LDADD += libcollectdclient/libcollectdclient.la
56 collectdctl_DEPENDENCIES = libcollectdclient/libcollectdclient.la
58 collectd_tg_SOURCES = collectd-tg.c \
59 daemon/utils_heap.c daemon/utils_heap.h
60 collectd_tg_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
62 if BUILD_WITH_LIBSOCKET
63 collectd_tg_LDADD += -lsocket
66 collectd_tg_LDADD += -lrt
69 collectd_tg_LDADD += -lm
71 if BUILD_WITH_LIBPTHREAD
72 collectd_tg_LDADD += -lpthread
74 collectd_tg_LDADD += libcollectdclient/libcollectdclient.la
75 collectd_tg_DEPENDENCIES = libcollectdclient/libcollectdclient.la
83 if BUILD_PLUGIN_AGGREGATION
84 pkglib_LTLIBRARIES += aggregation.la
85 aggregation_la_SOURCES = aggregation.c \
86 utils_vl_lookup.c utils_vl_lookup.h
87 aggregation_la_LDFLAGS = $(PLUGIN_LDFLAGS)
88 aggregation_la_LIBADD = -lm
92 pkglib_LTLIBRARIES += amqp.la
93 amqp_la_SOURCES = amqp.c \
94 utils_cmd_putval.c utils_cmd_putval.h \
95 utils_format_graphite.c utils_format_graphite.h \
96 utils_format_json.c utils_format_json.h
97 amqp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
98 amqp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
99 amqp_la_LIBADD = $(BUILD_WITH_LIBRABBITMQ_LIBS)
102 if BUILD_PLUGIN_APACHE
103 pkglib_LTLIBRARIES += apache.la
104 apache_la_SOURCES = apache.c
105 apache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
106 apache_la_CFLAGS = $(AM_CFLAGS)
108 if BUILD_WITH_LIBCURL
109 apache_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
110 apache_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
114 if BUILD_PLUGIN_APCUPS
115 pkglib_LTLIBRARIES += apcups.la
116 apcups_la_SOURCES = apcups.c
117 apcups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
119 if BUILD_WITH_LIBSOCKET
120 apcups_la_LIBADD += -lsocket
124 if BUILD_PLUGIN_APPLE_SENSORS
125 pkglib_LTLIBRARIES += apple_sensors.la
126 apple_sensors_la_SOURCES = apple_sensors.c
127 apple_sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS)
128 apple_sensors_la_LDFLAGS += -framework IOKit
131 if BUILD_PLUGIN_AQUAERO
132 pkglib_LTLIBRARIES += aquaero.la
133 aquaero_la_SOURCES = aquaero.c
134 aquaero_la_LDFLAGS = $(PLUGIN_LDFLAGS)
135 aquaero_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBAQUAERO5_CFLAGS)
136 aquaero_la_LIBADD = $(BUILD_WITH_LIBAQUAERO5_LDFLAGS) -laquaero5
139 if BUILD_PLUGIN_ASCENT
140 pkglib_LTLIBRARIES += ascent.la
141 ascent_la_SOURCES = ascent.c
142 ascent_la_LDFLAGS = $(PLUGIN_LDFLAGS)
143 ascent_la_CFLAGS = $(AM_CFLAGS) \
144 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
145 ascent_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
148 if BUILD_PLUGIN_BAROMETER
149 pkglib_LTLIBRARIES += barometer.la
150 barometer_la_SOURCES = barometer.c
151 barometer_la_LDFLAGS = $(PLUGIN_LDFLAGS)
152 barometer_la_LIBADD = -lm
155 if BUILD_PLUGIN_BATTERY
156 pkglib_LTLIBRARIES += battery.la
157 battery_la_SOURCES = battery.c
158 battery_la_LDFLAGS = $(PLUGIN_LDFLAGS)
160 if BUILD_WITH_LIBIOKIT
161 battery_la_LDFLAGS += -framework IOKit
166 pkglib_LTLIBRARIES += bind.la
167 bind_la_SOURCES = bind.c
168 bind_la_LDFLAGS = $(PLUGIN_LDFLAGS)
169 bind_la_CFLAGS = $(AM_CFLAGS) \
170 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
171 bind_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
175 pkglib_LTLIBRARIES += ceph.la
176 ceph_la_SOURCES = ceph.c
177 ceph_la_CFLAGS = $(AM_CFLAGS)
178 ceph_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
179 ceph_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
180 ceph_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
183 if BUILD_PLUGIN_CGROUPS
184 pkglib_LTLIBRARIES += cgroups.la
185 cgroups_la_SOURCES = cgroups.c \
186 utils_ignorelist.c utils_ignorelist.h \
187 utils_mount.c utils_mount.h
188 cgroups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
191 if BUILD_PLUGIN_CONNTRACK
192 pkglib_LTLIBRARIES += conntrack.la
193 conntrack_la_SOURCES = conntrack.c
194 conntrack_la_LDFLAGS = $(PLUGIN_LDFLAGS)
197 if BUILD_PLUGIN_CONTEXTSWITCH
198 pkglib_LTLIBRARIES += contextswitch.la
199 contextswitch_la_SOURCES = contextswitch.c
200 contextswitch_la_LDFLAGS = $(PLUGIN_LDFLAGS)
201 contextswitch_la_LIBADD =
202 if BUILD_WITH_PERFSTAT
203 contextswitch_la_LIBADD += -lperfstat
208 pkglib_LTLIBRARIES += cpu.la
209 cpu_la_SOURCES = cpu.c
210 cpu_la_CFLAGS = $(AM_CFLAGS)
211 cpu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
213 if BUILD_WITH_LIBKSTAT
214 cpu_la_LIBADD += -lkstat
216 if BUILD_WITH_LIBDEVINFO
217 cpu_la_LIBADD += -ldevinfo
219 if BUILD_WITH_LIBSTATGRAB
220 cpu_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
221 cpu_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
223 if BUILD_WITH_PERFSTAT
224 cpu_la_LIBADD += -lperfstat
228 if BUILD_PLUGIN_CPUFREQ
229 pkglib_LTLIBRARIES += cpufreq.la
230 cpufreq_la_SOURCES = cpufreq.c
231 cpufreq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
235 pkglib_LTLIBRARIES += csv.la
236 csv_la_SOURCES = csv.c
237 csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
241 pkglib_LTLIBRARIES += curl.la
242 curl_la_SOURCES = curl.c
243 curl_la_LDFLAGS = $(PLUGIN_LDFLAGS)
244 curl_la_CFLAGS = $(AM_CFLAGS)
246 if BUILD_WITH_LIBCURL
247 curl_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
248 curl_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
252 if BUILD_PLUGIN_CURL_JSON
253 pkglib_LTLIBRARIES += curl_json.la
254 curl_json_la_SOURCES = curl_json.c
255 curl_json_la_CFLAGS = $(AM_CFLAGS)
256 curl_json_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
257 curl_json_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
258 curl_json_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
259 if BUILD_WITH_LIBCURL
260 curl_json_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
261 curl_json_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
265 if BUILD_PLUGIN_CURL_XML
266 pkglib_LTLIBRARIES += curl_xml.la
267 curl_xml_la_SOURCES = curl_xml.c
268 curl_xml_la_LDFLAGS = $(PLUGIN_LDFLAGS)
269 curl_xml_la_CFLAGS = $(AM_CFLAGS) \
270 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
271 curl_xml_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
275 pkglib_LTLIBRARIES += dbi.la
276 dbi_la_SOURCES = dbi.c \
277 utils_db_query.c utils_db_query.h
278 dbi_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBDBI_CPPFLAGS)
279 dbi_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBDBI_LDFLAGS)
280 dbi_la_LIBADD = $(BUILD_WITH_LIBDBI_LIBS)
284 pkglib_LTLIBRARIES += df.la
285 df_la_SOURCES = df.c \
286 utils_ignorelist.c utils_ignorelist.h \
287 utils_mount.c utils_mount.h
288 df_la_LDFLAGS = $(PLUGIN_LDFLAGS)
292 pkglib_LTLIBRARIES += disk.la
293 disk_la_SOURCES = disk.c \
294 utils_ignorelist.c utils_ignorelist.h
295 disk_la_CFLAGS = $(AM_CFLAGS)
296 disk_la_LDFLAGS = $(PLUGIN_LDFLAGS)
298 if BUILD_WITH_LIBKSTAT
299 disk_la_LIBADD += -lkstat
301 if BUILD_WITH_LIBDEVINFO
302 disk_la_LIBADD += -ldevinfo
304 if BUILD_WITH_LIBIOKIT
305 disk_la_LDFLAGS += -framework IOKit
307 if BUILD_WITH_LIBSTATGRAB
308 disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
309 disk_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
311 if BUILD_WITH_LIBUDEV
312 disk_la_LIBADD += -ludev
314 if BUILD_WITH_PERFSTAT
315 disk_la_LIBADD += -lperfstat
320 pkglib_LTLIBRARIES += dns.la
321 dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
322 dns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
323 dns_la_LIBADD = -lpcap -lpthread
327 pkglib_LTLIBRARIES += drbd.la
328 drbd_la_SOURCES = drbd.c
329 drbd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
330 drbd_la_LIBADD = -lpthread
333 if BUILD_PLUGIN_EMAIL
334 pkglib_LTLIBRARIES += email.la
335 email_la_SOURCES = email.c
336 email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
337 email_la_LIBADD = -lpthread
340 if BUILD_PLUGIN_ENTROPY
341 pkglib_LTLIBRARIES += entropy.la
342 entropy_la_SOURCES = entropy.c
343 entropy_la_LDFLAGS = $(PLUGIN_LDFLAGS)
347 pkglib_LTLIBRARIES += exec.la
348 exec_la_SOURCES = exec.c \
349 utils_cmd_putnotif.c utils_cmd_putnotif.h \
350 utils_cmd_putval.c utils_cmd_putval.h \
351 utils_parse_option.h utils_parse_option.c
352 exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
353 exec_la_LIBADD = -lpthread
356 if BUILD_PLUGIN_ETHSTAT
357 pkglib_LTLIBRARIES += ethstat.la
358 ethstat_la_SOURCES = ethstat.c
359 ethstat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
362 if BUILD_PLUGIN_FILECOUNT
363 pkglib_LTLIBRARIES += filecount.la
364 filecount_la_SOURCES = filecount.c
365 filecount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
368 if BUILD_PLUGIN_GMOND
369 pkglib_LTLIBRARIES += gmond.la
370 gmond_la_SOURCES = gmond.c
371 gmond_la_CPPFLAGS = $(AM_CPPFLAGS) $(GANGLIA_CPPFLAGS)
372 gmond_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(GANGLIA_LDFLAGS)
373 gmond_la_LIBADD = $(GANGLIA_LIBS)
376 if BUILD_PLUGIN_HDDTEMP
377 pkglib_LTLIBRARIES += hddtemp.la
378 hddtemp_la_SOURCES = hddtemp.c
379 hddtemp_la_LDFLAGS = $(PLUGIN_LDFLAGS)
381 if BUILD_WITH_LIBSOCKET
382 hddtemp_la_LIBADD += -lsocket
386 if BUILD_PLUGIN_INTERFACE
387 pkglib_LTLIBRARIES += interface.la
388 interface_la_SOURCES = interface.c \
389 utils_ignorelist.c utils_ignorelist.h
390 interface_la_CFLAGS = $(AM_CFLAGS)
391 interface_la_LDFLAGS = $(PLUGIN_LDFLAGS)
392 interface_la_LIBADD =
393 if BUILD_WITH_LIBSTATGRAB
394 interface_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
395 interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
397 if BUILD_WITH_LIBKSTAT
398 interface_la_LIBADD += -lkstat
400 if BUILD_WITH_LIBDEVINFO
401 interface_la_LIBADD += -ldevinfo
402 endif # BUILD_WITH_LIBDEVINFO
403 endif # !BUILD_WITH_LIBSTATGRAB
404 if BUILD_WITH_PERFSTAT
405 interface_la_LIBADD += -lperfstat
407 endif # BUILD_PLUGIN_INTERFACE
409 if BUILD_PLUGIN_IPTABLES
410 pkglib_LTLIBRARIES += iptables.la
411 iptables_la_SOURCES = iptables.c
412 iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS)
413 iptables_la_LDFLAGS = $(PLUGIN_LDFLAGS)
414 iptables_la_LIBADD = $(BUILD_WITH_LIBIPTC_LDFLAGS)
418 pkglib_LTLIBRARIES += ipmi.la
419 ipmi_la_SOURCES = ipmi.c \
420 utils_ignorelist.c utils_ignorelist.h
421 ipmi_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_OPENIPMI_CFLAGS)
422 ipmi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
423 ipmi_la_LIBADD = $(BUILD_WITH_OPENIPMI_LIBS)
427 pkglib_LTLIBRARIES += ipvs.la
428 ipvs_la_SOURCES = ipvs.c
429 if IP_VS_H_NEEDS_KERNEL_CFLAGS
430 ipvs_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS)
432 ipvs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
436 pkglib_LTLIBRARIES += irq.la
437 irq_la_SOURCES = irq.c \
438 utils_ignorelist.c utils_ignorelist.h
439 irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
443 pkglib_LTLIBRARIES += java.la
444 java_la_SOURCES = java.c
445 java_la_CPPFLAGS = $(AM_CPPFLAGS) $(JAVA_CPPFLAGS)
446 java_la_CFLAGS = $(AM_CFLAGS) $(JAVA_CFLAGS)
447 java_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(JAVA_LDFLAGS)
448 java_la_LIBADD = $(JAVA_LIBS)
452 pkglib_LTLIBRARIES += load.la
453 load_la_SOURCES = load.c
454 load_la_CFLAGS = $(AM_CFLAGS)
455 load_la_LDFLAGS = $(PLUGIN_LDFLAGS)
457 if BUILD_WITH_LIBSTATGRAB
458 load_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
459 load_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
460 endif # BUILD_WITH_LIBSTATGRAB
461 if BUILD_WITH_PERFSTAT
462 load_la_LIBADD += -lperfstat
464 endif # BUILD_PLUGIN_LOAD
466 if BUILD_PLUGIN_LOGFILE
467 pkglib_LTLIBRARIES += logfile.la
468 logfile_la_SOURCES = logfile.c
469 logfile_la_LDFLAGS = $(PLUGIN_LDFLAGS)
472 if BUILD_PLUGIN_LOG_LOGSTASH
473 pkglib_LTLIBRARIES += log_logstash.la
474 log_logstash_la_SOURCES = log_logstash.c
475 log_logstash_la_CFLAGS = $(AM_CFLAGS)
476 log_logstash_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
477 log_logstash_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
478 log_logstash_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
482 pkglib_LTLIBRARIES += lpar.la
483 lpar_la_SOURCES = lpar.c
484 lpar_la_LDFLAGS = $(PLUGIN_LDFLAGS)
485 lpar_la_LIBADD = -lperfstat
489 pkglib_LTLIBRARIES += lvm.la
490 lvm_la_SOURCES = lvm.c
491 lvm_la_LDFLAGS = $(PLUGIN_LDFLAGS)
492 lvm_la_LIBADD = $(BUILD_WITH_LIBLVM2APP_LIBS)
495 if BUILD_PLUGIN_MADWIFI
496 pkglib_LTLIBRARIES += madwifi.la
497 madwifi_la_SOURCES = madwifi.c madwifi.h \
498 utils_ignorelist.c utils_ignorelist.h
499 madwifi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
502 if BUILD_PLUGIN_MATCH_EMPTY_COUNTER
503 pkglib_LTLIBRARIES += match_empty_counter.la
504 match_empty_counter_la_SOURCES = match_empty_counter.c
505 match_empty_counter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
508 if BUILD_PLUGIN_MATCH_HASHED
509 pkglib_LTLIBRARIES += match_hashed.la
510 match_hashed_la_SOURCES = match_hashed.c
511 match_hashed_la_LDFLAGS = $(PLUGIN_LDFLAGS)
514 if BUILD_PLUGIN_MATCH_REGEX
515 pkglib_LTLIBRARIES += match_regex.la
516 match_regex_la_SOURCES = match_regex.c
517 match_regex_la_LDFLAGS = $(PLUGIN_LDFLAGS)
520 if BUILD_PLUGIN_MATCH_TIMEDIFF
521 pkglib_LTLIBRARIES += match_timediff.la
522 match_timediff_la_SOURCES = match_timediff.c
523 match_timediff_la_LDFLAGS = $(PLUGIN_LDFLAGS)
526 if BUILD_PLUGIN_MATCH_VALUE
527 pkglib_LTLIBRARIES += match_value.la
528 match_value_la_SOURCES = match_value.c
529 match_value_la_LDFLAGS = $(PLUGIN_LDFLAGS)
532 if BUILD_PLUGIN_MBMON
533 pkglib_LTLIBRARIES += mbmon.la
534 mbmon_la_SOURCES = mbmon.c
535 mbmon_la_LDFLAGS = $(PLUGIN_LDFLAGS)
537 if BUILD_WITH_LIBSOCKET
538 mbmon_la_LIBADD += -lsocket
543 pkglib_LTLIBRARIES += md.la
544 md_la_SOURCES = md.c \
545 utils_ignorelist.c utils_ignorelist.h
546 md_la_LDFLAGS = $(PLUGIN_LDFLAGS)
549 if BUILD_PLUGIN_MEMCACHEC
550 pkglib_LTLIBRARIES += memcachec.la
551 memcachec_la_SOURCES = memcachec.c
552 memcachec_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
553 memcachec_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
554 memcachec_la_LIBADD = $(BUILD_WITH_LIBMEMCACHED_LIBS)
557 if BUILD_PLUGIN_MEMCACHED
558 pkglib_LTLIBRARIES += memcached.la
559 memcached_la_SOURCES = memcached.c
560 memcached_la_LDFLAGS = $(PLUGIN_LDFLAGS)
561 memcached_la_LIBADD =
562 if BUILD_WITH_LIBSOCKET
563 memcached_la_LIBADD += -lsocket
567 if BUILD_PLUGIN_MEMORY
568 pkglib_LTLIBRARIES += memory.la
569 memory_la_SOURCES = memory.c
570 memory_la_CFLAGS = $(AM_CFLAGS)
571 memory_la_LDFLAGS = $(PLUGIN_LDFLAGS)
573 if BUILD_WITH_LIBKSTAT
574 memory_la_LIBADD += -lkstat
576 if BUILD_WITH_LIBDEVINFO
577 memory_la_LIBADD += -ldevinfo
579 if BUILD_WITH_LIBSTATGRAB
580 memory_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
581 memory_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
583 if BUILD_WITH_PERFSTAT
584 memory_la_LIBADD += -lperfstat
589 pkglib_LTLIBRARIES += mic.la
590 mic_la_SOURCES = mic.c \
591 utils_ignorelist.c utils_ignorelist.h
592 mic_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_MIC_LIBPATH)
593 mic_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_MIC_CPPFLAGS)
594 mic_la_LIBADD = $(BUILD_WITH_MIC_LDADD)
597 if BUILD_PLUGIN_MODBUS
598 pkglib_LTLIBRARIES += modbus.la
599 modbus_la_SOURCES = modbus.c
600 modbus_la_LDFLAGS = $(PLUGIN_LDFLAGS)
601 modbus_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMODBUS_CFLAGS)
602 modbus_la_LIBADD = $(BUILD_WITH_LIBMODBUS_LIBS)
605 if BUILD_PLUGIN_MULTIMETER
606 pkglib_LTLIBRARIES += multimeter.la
607 multimeter_la_SOURCES = multimeter.c
608 multimeter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
611 if BUILD_PLUGIN_MYSQL
612 pkglib_LTLIBRARIES += mysql.la
613 mysql_la_SOURCES = mysql.c
614 mysql_la_LDFLAGS = $(PLUGIN_LDFLAGS)
615 mysql_la_CFLAGS = $(AM_CFLAGS)
617 if BUILD_WITH_LIBMYSQL
618 mysql_la_CFLAGS += $(BUILD_WITH_LIBMYSQL_CFLAGS)
619 mysql_la_LIBADD += $(BUILD_WITH_LIBMYSQL_LIBS)
623 if BUILD_PLUGIN_NETAPP
624 pkglib_LTLIBRARIES += netapp.la
625 netapp_la_SOURCES = netapp.c \
626 utils_ignorelist.c utils_ignorelist.h
627 netapp_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBNETAPP_CPPFLAGS)
628 netapp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBNETAPP_LDFLAGS)
629 netapp_la_LIBADD = $(LIBNETAPP_LIBS)
632 if BUILD_PLUGIN_NETLINK
633 pkglib_LTLIBRARIES += netlink.la
634 netlink_la_SOURCES = netlink.c
635 netlink_la_LDFLAGS = $(PLUGIN_LDFLAGS)
636 netlink_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMNL_CFLAGS)
637 netlink_la_LIBADD = $(BUILD_WITH_LIBMNL_LIBS)
640 if BUILD_PLUGIN_NETWORK
641 pkglib_LTLIBRARIES += network.la
642 network_la_SOURCES = network.c network.h \
643 utils_fbhash.c utils_fbhash.h
644 network_la_CPPFLAGS = $(AM_CPPFLAGS)
645 network_la_LDFLAGS = $(PLUGIN_LDFLAGS)
646 network_la_LIBADD = -lpthread
647 if BUILD_WITH_LIBSOCKET
648 network_la_LIBADD += -lsocket
650 if BUILD_WITH_LIBGCRYPT
651 network_la_CPPFLAGS += $(GCRYPT_CPPFLAGS)
652 network_la_LDFLAGS += $(GCRYPT_LDFLAGS)
653 network_la_LIBADD += $(GCRYPT_LIBS)
658 pkglib_LTLIBRARIES += nfs.la
659 nfs_la_SOURCES = nfs.c
660 nfs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
663 if BUILD_PLUGIN_FSCACHE
664 pkglib_LTLIBRARIES += fscache.la
665 fscache_la_SOURCES = fscache.c
666 fscache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
669 if BUILD_PLUGIN_NGINX
670 pkglib_LTLIBRARIES += nginx.la
671 nginx_la_SOURCES = nginx.c
672 nginx_la_CFLAGS = $(AM_CFLAGS)
674 nginx_la_LDFLAGS = $(PLUGIN_LDFLAGS)
675 if BUILD_WITH_LIBCURL
676 nginx_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
677 nginx_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
681 if BUILD_PLUGIN_NOTIFY_DESKTOP
682 pkglib_LTLIBRARIES += notify_desktop.la
683 notify_desktop_la_SOURCES = notify_desktop.c
684 notify_desktop_la_CFLAGS = $(AM_CFLAGS) $(LIBNOTIFY_CFLAGS)
685 notify_desktop_la_LDFLAGS = $(PLUGIN_LDFLAGS)
686 notify_desktop_la_LIBADD = $(LIBNOTIFY_LIBS)
689 if BUILD_PLUGIN_NOTIFY_EMAIL
690 pkglib_LTLIBRARIES += notify_email.la
691 notify_email_la_SOURCES = notify_email.c
692 notify_email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
693 notify_email_la_LIBADD = -lesmtp -lssl -lcrypto -lpthread -ldl
697 pkglib_LTLIBRARIES += ntpd.la
698 ntpd_la_SOURCES = ntpd.c
699 ntpd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
701 if BUILD_WITH_LIBSOCKET
702 ntpd_la_LIBADD += -lsocket
707 pkglib_LTLIBRARIES += numa.la
708 numa_la_SOURCES = numa.c
709 numa_la_LDFLAGS = $(PLUGIN_LDFLAGS)
713 pkglib_LTLIBRARIES += nut.la
714 nut_la_SOURCES = nut.c
715 nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
716 nut_la_LDFLAGS = $(PLUGIN_LDFLAGS)
717 nut_la_LIBADD = -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS)
720 if BUILD_PLUGIN_OLSRD
721 pkglib_LTLIBRARIES += olsrd.la
722 olsrd_la_SOURCES = olsrd.c
723 olsrd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
725 if BUILD_WITH_LIBSOCKET
726 olsrd_la_LIBADD += -lsocket
730 if BUILD_PLUGIN_ONEWIRE
731 pkglib_LTLIBRARIES += onewire.la
732 onewire_la_SOURCES = onewire.c \
733 utils_ignorelist.c utils_ignorelist.h
734 onewire_la_CFLAGS = $(AM_CFLAGS)
735 onewire_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
736 onewire_la_LIBADD = $(BUILD_WITH_LIBOWCAPI_LIBS)
737 onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS)
740 if BUILD_PLUGIN_OPENLDAP
741 pkglib_LTLIBRARIES += openldap.la
742 openldap_la_SOURCES = openldap.c
743 openldap_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBLDAP_LDFLAGS)
744 openldap_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBLDAP_CPPFLAGS)
745 openldap_la_LIBADD = -lldap
748 if BUILD_PLUGIN_OPENVPN
749 pkglib_LTLIBRARIES += openvpn.la
750 openvpn_la_SOURCES = openvpn.c
751 openvpn_la_CFLAGS = $(AM_CFLAGS)
752 openvpn_la_LDFLAGS = $(PLUGIN_LDFLAGS)
755 if BUILD_PLUGIN_ORACLE
756 pkglib_LTLIBRARIES += oracle.la
757 oracle_la_SOURCES = oracle.c \
758 utils_db_query.c utils_db_query.h
759 oracle_la_CFLAGS = $(AM_CFLAGS)
760 oracle_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_ORACLE_CFLAGS)
761 oracle_la_LIBADD = $(BUILD_WITH_ORACLE_LIBS)
762 oracle_la_LDFLAGS = $(PLUGIN_LDFLAGS)
766 pkglib_LTLIBRARIES += perl.la
767 perl_la_SOURCES = perl.c
768 # Despite C99 providing the "bool" type thru stdbool.h, Perl defines its own
769 # version of that type if HAS_BOOL is not defined... *sigh*
770 perl_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAS_BOOL=1
771 perl_la_CFLAGS = $(AM_CFLAGS) \
773 -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
774 # Work-around for issues #41 and #42 - Perl 5.10 incorrectly introduced
775 # __attribute__nonnull__(3) for Perl_load_module().
776 if HAVE_BROKEN_PERL_LOAD_MODULE
777 perl_la_CFLAGS += -Wno-nonnull
779 perl_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
781 perl_la_LIBADD = $(PERL_LIBS)
785 pkglib_LTLIBRARIES += pf.la
787 pf_la_LDFLAGS = $(PLUGIN_LDFLAGS)
790 if BUILD_PLUGIN_PINBA
791 pkglib_LTLIBRARIES += pinba.la
792 pinba_la_SOURCES = pinba.c
793 nodist_pinba_la_SOURCES = pinba.pb-c.c pinba.pb-c.h
794 pinba_la_LDFLAGS = $(PLUGIN_LDFLAGS)
795 pinba_la_LIBADD = -lprotobuf-c
799 pkglib_LTLIBRARIES += ping.la
800 ping_la_SOURCES = ping.c
801 ping_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOPING_CPPFLAGS)
802 ping_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOPING_LDFLAGS)
803 ping_la_LIBADD = -loping -lm
806 if BUILD_PLUGIN_POSTGRESQL
807 pkglib_LTLIBRARIES += postgresql.la
808 postgresql_la_SOURCES = postgresql.c \
809 utils_db_query.c utils_db_query.h
810 postgresql_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPQ_CPPFLAGS)
811 postgresql_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
812 $(BUILD_WITH_LIBPQ_LDFLAGS)
813 postgresql_la_LIBADD = -lpq
816 if BUILD_PLUGIN_POWERDNS
817 pkglib_LTLIBRARIES += powerdns.la
818 powerdns_la_SOURCES = powerdns.c
819 powerdns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
822 if BUILD_PLUGIN_PYTHON
823 pkglib_LTLIBRARIES += python.la
824 python_la_SOURCES = python.c pyconfig.c pyvalues.c cpython.h
825 python_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_PYTHON_CPPFLAGS)
826 python_la_CFLAGS = $(AM_CFLAGS)
828 python_la_CFLAGS += -fno-strict-aliasing -Wno-strict-aliasing
830 python_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_PYTHON_LDFLAGS)
831 python_la_LIBADD = $(BUILD_WITH_PYTHON_LIBS)
834 if BUILD_PLUGIN_PROCESSES
835 pkglib_LTLIBRARIES += processes.la
836 processes_la_SOURCES = processes.c
837 processes_la_LDFLAGS = $(PLUGIN_LDFLAGS)
838 processes_la_LIBADD =
839 if BUILD_WITH_LIBKVM_GETPROCS
840 processes_la_LIBADD += -lkvm
844 if BUILD_PLUGIN_PROTOCOLS
845 pkglib_LTLIBRARIES += protocols.la
846 protocols_la_SOURCES = protocols.c \
847 utils_ignorelist.c utils_ignorelist.h
848 protocols_la_LDFLAGS = $(PLUGIN_LDFLAGS)
851 if BUILD_PLUGIN_REDIS
852 pkglib_LTLIBRARIES += redis.la
853 redis_la_SOURCES = redis.c
854 redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
855 redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
856 redis_la_LIBADD = -lhiredis
859 if BUILD_PLUGIN_ROUTEROS
860 pkglib_LTLIBRARIES += routeros.la
861 routeros_la_SOURCES = routeros.c
862 routeros_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
863 routeros_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBROUTEROS_LDFLAGS)
864 routeros_la_LIBADD = -lrouteros
867 if BUILD_PLUGIN_RRDCACHED
868 pkglib_LTLIBRARIES += rrdcached.la
869 rrdcached_la_SOURCES = rrdcached.c utils_rrdcreate.c utils_rrdcreate.h
870 rrdcached_la_LDFLAGS = $(PLUGIN_LDFLAGS)
871 rrdcached_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
872 rrdcached_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
875 if BUILD_PLUGIN_RRDTOOL
876 pkglib_LTLIBRARIES += rrdtool.la
877 rrdtool_la_SOURCES = rrdtool.c utils_rrdcreate.c utils_rrdcreate.h
878 rrdtool_la_LDFLAGS = $(PLUGIN_LDFLAGS)
879 rrdtool_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
880 rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
883 if BUILD_PLUGIN_SENSORS
884 pkglib_LTLIBRARIES += sensors.la
885 sensors_la_SOURCES = sensors.c \
886 utils_ignorelist.c utils_ignorelist.h
887 sensors_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSENSORS_CFLAGS)
888 sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBSENSORS_LDFLAGS)
889 sensors_la_LIBADD = -lsensors
892 if BUILD_PLUGIN_SERIAL
893 pkglib_LTLIBRARIES += serial.la
894 serial_la_SOURCES = serial.c
895 serial_la_LDFLAGS = $(PLUGIN_LDFLAGS)
898 if BUILD_PLUGIN_SIGROK
899 pkglib_LTLIBRARIES += sigrok.la
900 sigrok_la_SOURCES = sigrok.c
901 sigrok_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSIGROK_CFLAGS)
902 sigrok_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBSIGROK_LDFLAGS)
903 sigrok_la_LIBADD = -lsigrok
906 if BUILD_PLUGIN_SMART
907 if BUILD_WITH_LIBUDEV
908 pkglib_LTLIBRARIES += smart.la
909 smart_la_SOURCES = smart.c \
910 utils_ignorelist.c utils_ignorelist.h
911 smart_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBATASMART_CPPFLAGS)
912 smart_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBATASMART_LDFLAGS)
913 smart_la_LIBADD = $(BUILD_WITH_LIBATASMART_LIBS) -ludev
918 pkglib_LTLIBRARIES += snmp.la
919 snmp_la_SOURCES = snmp.c
920 snmp_la_LDFLAGS = $(PLUGIN_LDFLAGS)
921 snmp_la_CFLAGS = $(AM_CFLAGS)
923 if BUILD_WITH_LIBNETSNMP
924 snmp_la_CFLAGS += $(BUILD_WITH_LIBSNMP_CFLAGS)
925 snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS)
927 if BUILD_WITH_LIBPTHREAD
928 snmp_la_LIBADD += -lpthread
932 if BUILD_PLUGIN_STATSD
933 pkglib_LTLIBRARIES += statsd.la
934 statsd_la_SOURCES = statsd.c \
935 utils_latency.h utils_latency.c
936 statsd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
937 statsd_la_LIBADD = -lpthread
941 pkglib_LTLIBRARIES += swap.la
942 swap_la_SOURCES = swap.c
943 swap_la_CFLAGS = $(AM_CFLAGS)
944 swap_la_LDFLAGS = $(PLUGIN_LDFLAGS)
946 if BUILD_WITH_LIBKSTAT
947 swap_la_LIBADD += -lkstat
949 if BUILD_WITH_LIBDEVINFO
950 swap_la_LIBADD += -ldevinfo
952 if BUILD_WITH_LIBKVM_GETSWAPINFO
953 swap_la_LIBADD += -lkvm
955 if BUILD_WITH_LIBSTATGRAB
956 swap_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
957 swap_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
959 if BUILD_WITH_PERFSTAT
960 swap_la_LIBADD += -lperfstat
965 if BUILD_PLUGIN_SYSLOG
966 pkglib_LTLIBRARIES += syslog.la
967 syslog_la_SOURCES = syslog.c
968 syslog_la_LDFLAGS = $(PLUGIN_LDFLAGS)
971 if BUILD_PLUGIN_TABLE
972 pkglib_LTLIBRARIES += table.la
973 table_la_SOURCES = table.c
974 table_la_LDFLAGS = $(PLUGIN_LDFLAGS)
978 pkglib_LTLIBRARIES += tail.la
979 tail_la_SOURCES = tail.c
980 tail_la_LDFLAGS = $(PLUGIN_LDFLAGS)
983 if BUILD_PLUGIN_TAIL_CSV
984 pkglib_LTLIBRARIES += tail_csv.la
985 tail_csv_la_SOURCES = tail_csv.c
986 tail_csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
990 pkglib_LTLIBRARIES += tape.la
991 tape_la_SOURCES = tape.c
992 tape_la_LDFLAGS = $(PLUGIN_LDFLAGS)
993 tape_la_LIBADD = -lkstat -ldevinfo
996 if BUILD_PLUGIN_TARGET_NOTIFICATION
997 pkglib_LTLIBRARIES += target_notification.la
998 target_notification_la_SOURCES = target_notification.c
999 target_notification_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1002 if BUILD_PLUGIN_TARGET_REPLACE
1003 pkglib_LTLIBRARIES += target_replace.la
1004 target_replace_la_SOURCES = target_replace.c
1005 target_replace_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1008 if BUILD_PLUGIN_TARGET_SCALE
1009 pkglib_LTLIBRARIES += target_scale.la
1010 target_scale_la_SOURCES = target_scale.c
1011 target_scale_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1014 if BUILD_PLUGIN_TARGET_SET
1015 pkglib_LTLIBRARIES += target_set.la
1016 target_set_la_SOURCES = target_set.c
1017 target_set_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1020 if BUILD_PLUGIN_TARGET_V5UPGRADE
1021 pkglib_LTLIBRARIES += target_v5upgrade.la
1022 target_v5upgrade_la_SOURCES = target_v5upgrade.c
1023 target_v5upgrade_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1026 if BUILD_PLUGIN_TCPCONNS
1027 pkglib_LTLIBRARIES += tcpconns.la
1028 tcpconns_la_SOURCES = tcpconns.c
1029 tcpconns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1030 tcpconns_la_LIBADD =
1031 if BUILD_WITH_LIBKVM_NLIST
1032 tcpconns_la_LIBADD += -lkvm
1036 if BUILD_PLUGIN_TEAMSPEAK2
1037 pkglib_LTLIBRARIES += teamspeak2.la
1038 teamspeak2_la_SOURCES = teamspeak2.c
1039 teamspeak2_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1043 pkglib_LTLIBRARIES += ted.la
1044 ted_la_SOURCES = ted.c
1045 ted_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1048 if BUILD_PLUGIN_THERMAL
1049 pkglib_LTLIBRARIES += thermal.la
1050 thermal_la_SOURCES = thermal.c \
1051 utils_ignorelist.c utils_ignorelist.h
1052 thermal_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1055 if BUILD_PLUGIN_THRESHOLD
1056 pkglib_LTLIBRARIES += threshold.la
1057 threshold_la_SOURCES = threshold.c
1058 threshold_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1061 if BUILD_PLUGIN_TOKYOTYRANT
1062 pkglib_LTLIBRARIES += tokyotyrant.la
1063 tokyotyrant_la_SOURCES = tokyotyrant.c
1064 tokyotyrant_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
1065 tokyotyrant_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
1066 tokyotyrant_la_LIBADD = $(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
1067 if BUILD_WITH_LIBSOCKET
1068 tokyotyrant_la_LIBADD += -lsocket
1072 if BUILD_PLUGIN_UNIXSOCK
1073 pkglib_LTLIBRARIES += unixsock.la
1074 unixsock_la_SOURCES = unixsock.c \
1075 utils_cmd_flush.h utils_cmd_flush.c \
1076 utils_cmd_getval.h utils_cmd_getval.c \
1077 utils_cmd_getthreshold.h utils_cmd_getthreshold.c \
1078 utils_cmd_listval.h utils_cmd_listval.c \
1079 utils_cmd_putval.h utils_cmd_putval.c \
1080 utils_cmd_putnotif.h utils_cmd_putnotif.c \
1081 utils_parse_option.h utils_parse_option.c
1082 unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1083 unixsock_la_LIBADD = -lpthread
1086 if BUILD_PLUGIN_UPTIME
1087 pkglib_LTLIBRARIES += uptime.la
1088 uptime_la_SOURCES = uptime.c
1089 uptime_la_CFLAGS = $(AM_CFLAGS)
1090 uptime_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1092 if BUILD_WITH_LIBKSTAT
1093 uptime_la_LIBADD += -lkstat
1095 if BUILD_WITH_PERFSTAT
1096 uptime_la_LIBADD += -lperfstat
1100 if BUILD_PLUGIN_USERS
1101 pkglib_LTLIBRARIES += users.la
1102 users_la_SOURCES = users.c
1103 users_la_CFLAGS = $(AM_CFLAGS)
1104 users_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1106 if BUILD_WITH_LIBSTATGRAB
1107 users_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1108 users_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1112 if BUILD_PLUGIN_UUID
1113 pkglib_LTLIBRARIES += uuid.la
1114 uuid_la_SOURCES = uuid.c
1115 uuid_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHAL_CFLAGS)
1116 uuid_la_LIBADD = $(BUILD_WITH_LIBHAL_LIBS)
1117 uuid_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1120 if BUILD_PLUGIN_VARNISH
1121 pkglib_LTLIBRARIES += varnish.la
1122 varnish_la_SOURCES = varnish.c
1123 varnish_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1124 varnish_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBVARNISH_CFLAGS)
1125 varnish_la_LIBADD = $(BUILD_WITH_LIBVARNISH_LIBS)
1128 if BUILD_PLUGIN_VIRT
1129 pkglib_LTLIBRARIES += virt.la
1130 virt_la_SOURCES = virt.c \
1131 utils_ignorelist.c utils_ignorelist.h
1132 virt_la_CFLAGS = $(AM_CFLAGS) \
1133 $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
1134 virt_la_LIBADD = $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
1135 virt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1138 if BUILD_PLUGIN_VMEM
1139 pkglib_LTLIBRARIES += vmem.la
1140 vmem_la_SOURCES = vmem.c
1141 vmem_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1144 if BUILD_PLUGIN_VSERVER
1145 pkglib_LTLIBRARIES += vserver.la
1146 vserver_la_SOURCES = vserver.c
1147 vserver_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1150 if BUILD_PLUGIN_WIRELESS
1151 pkglib_LTLIBRARIES += wireless.la
1152 wireless_la_SOURCES = wireless.c
1153 wireless_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1156 if BUILD_PLUGIN_WRITE_GRAPHITE
1157 pkglib_LTLIBRARIES += write_graphite.la
1158 write_graphite_la_SOURCES = write_graphite.c \
1159 utils_format_graphite.c utils_format_graphite.h \
1160 utils_format_json.c utils_format_json.h
1161 write_graphite_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1164 if BUILD_PLUGIN_WRITE_HTTP
1165 pkglib_LTLIBRARIES += write_http.la
1166 write_http_la_SOURCES = write_http.c \
1167 utils_format_json.c utils_format_json.h
1168 write_http_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1169 write_http_la_CFLAGS = $(AM_CFLAGS)
1170 write_http_la_LIBADD =
1171 if BUILD_WITH_LIBCURL
1172 write_http_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
1173 write_http_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
1177 if BUILD_PLUGIN_WRITE_KAFKA
1178 pkglib_LTLIBRARIES += write_kafka.la
1179 write_kafka_la_SOURCES = write_kafka.c \
1180 utils_format_graphite.c utils_format_graphite.h \
1181 utils_format_json.c utils_format_json.h \
1182 utils_cmd_putval.c utils_cmd_putval.h \
1183 utils_crc32.c utils_crc32.h
1184 write_kafka_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
1185 write_kafka_la_LIBADD = $(BUILD_WITH_LIBRDKAFKA_LIBS)
1188 if BUILD_PLUGIN_WRITE_LOG
1189 pkglib_LTLIBRARIES += write_log.la
1190 write_log_la_SOURCES = write_log.c \
1191 utils_format_graphite.c utils_format_graphite.h
1192 write_log_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1195 if BUILD_PLUGIN_WRITE_MONGODB
1196 pkglib_LTLIBRARIES += write_mongodb.la
1197 write_mongodb_la_SOURCES = write_mongodb.c
1198 write_mongodb_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMONGOC_CPPFLAGS)
1199 write_mongodb_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMONGOC_LDFLAGS)
1200 write_mongodb_la_LIBADD = -lmongoc
1203 if BUILD_PLUGIN_WRITE_REDIS
1204 pkglib_LTLIBRARIES += write_redis.la
1205 write_redis_la_SOURCES = write_redis.c
1206 write_redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
1207 write_redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
1208 write_redis_la_LIBADD = -lhiredis
1211 if BUILD_PLUGIN_WRITE_RIEMANN
1212 pkglib_LTLIBRARIES += write_riemann.la
1213 write_riemann_la_SOURCES = write_riemann.c write_riemann_threshold.c
1214 nodist_write_riemann_la_SOURCES = riemann.pb-c.c riemann.pb-c.h
1215 write_riemann_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1216 write_riemann_la_LIBADD = -lprotobuf-c
1219 if BUILD_PLUGIN_WRITE_TSDB
1220 pkglib_LTLIBRARIES += write_tsdb.la
1221 write_tsdb_la_SOURCES = write_tsdb.c
1222 write_tsdb_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1225 if BUILD_PLUGIN_XMMS
1226 pkglib_LTLIBRARIES += xmms.la
1227 xmms_la_SOURCES = xmms.c
1228 xmms_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBXMMS_CFLAGS)
1229 xmms_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1230 xmms_la_LIBADD = $(BUILD_WITH_LIBXMMS_LIBS)
1233 if BUILD_PLUGIN_ZFS_ARC
1234 pkglib_LTLIBRARIES += zfs_arc.la
1235 zfs_arc_la_SOURCES = zfs_arc.c
1236 zfs_arc_la_CFLAGS = $(AM_CFLAGS)
1237 zfs_arc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1239 zfs_arc_la_LIBADD = -lm
1242 # zfs_arc requires no library on linux
1245 zfs_arc_la_LIBADD = -lkstat
1250 if BUILD_PLUGIN_ZOOKEEPER
1251 pkglib_LTLIBRARIES += zookeeper.la
1252 zookeeper_la_SOURCES = zookeeper.c
1253 zookeeper_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1256 BUILT_SOURCES += $(dist_man_MANS)
1258 dist_man_MANS = collectd.1 \
1270 collectd-threshold.5 \
1271 collectd-unixsock.5 \
1274 #collectd_1_SOURCES = collectd.pod
1276 EXTRA_DIST = types.db
1278 EXTRA_DIST += collectd.conf.pod \
1279 collectd-email.pod \
1284 collectd-nagios.pod \
1286 collectd-python.pod \
1290 collectd-threshold.pod \
1291 collectd-unixsock.pod \
1292 postgresql_default.conf \
1296 pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
1297 >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
1298 @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
1300 echo "$@ has some POD errors!"; false; \
1304 pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< \
1305 >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
1306 @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
1308 echo "$@ has some POD errors!"; false; \
1311 # Protocol buffer for the "pinba" plugin.
1312 EXTRA_DIST += pinba.proto
1314 CLEANFILES += pinba.pb-c.c pinba.pb-c.h
1315 BUILT_SOURCES += pinba.pb-c.c pinba.pb-c.h
1317 pinba.pb-c.c pinba.pb-c.h: pinba.proto
1318 protoc-c -I$(srcdir) --c_out . $(srcdir)/pinba.proto
1321 # Protocol buffer for the "write_riemann" plugin.
1322 EXTRA_DIST += riemann.proto
1324 CLEANFILES += riemann.pb-c.c riemann.pb-c.h
1326 BUILT_SOURCES += riemann.pb-c.c riemann.pb-c.h
1328 riemann.pb-c.c riemann.pb-c.h: riemann.proto
1329 protoc-c -I$(srcdir) --c_out . $(srcdir)/riemann.proto
1333 $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
1334 if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
1336 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
1338 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
1340 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
1341 $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db;
1342 $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \
1343 $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
1346 rm -f $(DESTDIR)$(pkgdatadir)/types.db;
1347 rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
1348 rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
1350 check_PROGRAMS = test_common test_utils_avltree test_utils_heap test_utils_mount test_utils_vl_lookup
1352 test_common_SOURCES = tests/test_common.c \
1353 daemon/common.h daemon/common.c \
1354 tests/mock/plugin.c \
1355 tests/mock/utils_cache.c \
1356 tests/mock/utils_time.c
1357 test_common_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
1358 test_common_LDFLAGS = -export-dynamic
1361 test_utils_avltree_SOURCES = tests/test_utils_avltree.c \
1362 daemon/utils_avltree.c daemon/utils_avltree.h
1363 test_utils_avltree_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
1364 test_utils_avltree_LDFLAGS = -export-dynamic
1365 test_utils_avltree_LDADD =
1367 test_utils_heap_SOURCES = tests/test_utils_heap.c \
1368 daemon/utils_heap.c daemon/utils_heap.h
1369 test_utils_heap_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
1370 test_utils_heap_LDFLAGS = -export-dynamic
1371 test_utils_heap_LDADD =
1373 test_utils_mount_SOURCES = tests/test_utils_mount.c \
1374 utils_mount.c utils_mount.h \
1375 daemon/common.c daemon/common.h \
1376 tests/mock/plugin.c \
1377 tests/mock/utils_cache.c \
1378 tests/mock/utils_time.c
1379 test_utils_mount_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
1380 test_utils_mount_LDFLAGS = -export-dynamic
1381 test_utils_mount_LDADD =
1383 test_utils_vl_lookup_SOURCES = tests/test_utils_vl_lookup.c \
1384 utils_vl_lookup.h utils_vl_lookup.c \
1385 daemon/utils_avltree.c daemon/utils_avltree.h \
1386 daemon/common.c daemon/common.h \
1387 tests/mock/plugin.c \
1388 tests/mock/utils_cache.c \
1389 tests/mock/utils_time.c
1390 test_utils_vl_lookup_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
1391 test_utils_vl_lookup_LDFLAGS = -export-dynamic
1392 test_utils_vl_lookup_LDADD =
1394 TESTS = test_common test_utils_avltree test_utils_heap test_utils_mount test_utils_vl_lookup