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