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