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