Code

curl_json plugin: len is unsigned
[collectd.git] / src / Makefile.am
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 AM_CPPFLAGS = -I$(srcdir)/daemon
10 AM_CPPFLAGS += -DPREFIX='"${prefix}"'
11 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
12 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
13 AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
14 if BUILD_FEATURE_DAEMON
15 AM_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
16 endif
17 AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
18 AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
20 AUTOMAKE_OPTIONS = subdir-objects
22 noinst_LTLIBRARIES =
23 check_PROGRAMS =
24 TESTS =
26 noinst_LTLIBRARIES += liblatency.la
27 liblatency_la_SOURCES = utils_latency.c utils_latency.h
28 check_PROGRAMS += test_utils_latency
29 TESTS += test_utils_latency
30 test_utils_latency_SOURCES = utils_latency_test.c testing.h
31 test_utils_latency_LDADD = liblatency.la daemon/libplugin_mock.la -lm
33 noinst_LTLIBRARIES += liblookup.la
34 liblookup_la_SOURCES = utils_vl_lookup.c utils_vl_lookup.h
35 liblookup_la_LIBADD = daemon/libavltree.la
36 check_PROGRAMS += test_utils_vl_lookup
37 TESTS += test_utils_vl_lookup
38 test_utils_vl_lookup_SOURCES = utils_vl_lookup_test.c testing.h
39 test_utils_vl_lookup_LDADD = liblookup.la daemon/libplugin_mock.la
40 if BUILD_WITH_LIBKSTAT
41 test_utils_vl_lookup_LDADD += -lkstat
42 endif
44 noinst_LTLIBRARIES += libmount.la
45 libmount_la_SOURCES = utils_mount.c utils_mount.h
46 check_PROGRAMS += test_utils_mount
47 TESTS += test_utils_mount
48 test_utils_mount_SOURCES = utils_mount_test.c testing.h
49 test_utils_mount_LDADD = libmount.la daemon/libplugin_mock.la
50 if BUILD_WITH_LIBKSTAT
51 test_utils_mount_LDADD += -lkstat
52 endif
54 sbin_PROGRAMS = collectdmon
55 bin_PROGRAMS = collectd-nagios collectdctl collectd-tg
57 collectdmon_SOURCES = collectdmon.c
58 collectdmon_CPPFLAGS = $(AM_CPPFLAGS)
60 collectd_nagios_SOURCES = collectd-nagios.c
61 collectd_nagios_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
62 collectd_nagios_LDADD =
63 if BUILD_WITH_LIBSOCKET
64 collectd_nagios_LDADD += -lsocket
65 endif
66 if BUILD_AIX
67 collectd_nagios_LDADD += -lm
68 endif
70 collectd_nagios_LDADD += libcollectdclient/libcollectdclient.la
71 collectd_nagios_DEPENDENCIES = libcollectdclient/libcollectdclient.la
74 collectdctl_SOURCES = collectdctl.c
75 collectdctl_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
76 collectdctl_LDADD =
77 if BUILD_WITH_LIBSOCKET
78 collectdctl_LDADD += -lsocket
79 endif
80 if BUILD_AIX
81 collectdctl_LDADD += -lm
82 endif
83 collectdctl_LDADD += libcollectdclient/libcollectdclient.la
84 collectdctl_DEPENDENCIES = libcollectdclient/libcollectdclient.la
86 collectd_tg_SOURCES = collectd-tg.c
87 collectd_tg_CPPFLAGS = $(AM_CPPFLAGS) \
88                        -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
89 collectd_tg_LDADD = daemon/libheap.la
90 if BUILD_WITH_LIBSOCKET
91 collectd_tg_LDADD += -lsocket
92 endif
93 if BUILD_WITH_LIBRT
94 collectd_tg_LDADD += -lrt
95 endif
96 if BUILD_AIX
97 collectd_tg_LDADD += -lm
98 endif
99 if BUILD_WITH_LIBPTHREAD
100 collectd_tg_LDADD += $(PTHREAD_LIBS)
101 endif
102 collectd_tg_LDADD += libcollectdclient/libcollectdclient.la
103 collectd_tg_DEPENDENCIES = libcollectdclient/libcollectdclient.la
106 pkglib_LTLIBRARIES =
108 BUILT_SOURCES =
109 CLEANFILES =
111 if BUILD_PLUGIN_AGGREGATION
112 pkglib_LTLIBRARIES += aggregation.la
113 aggregation_la_SOURCES = aggregation.c \
114                          utils_vl_lookup.c utils_vl_lookup.h
115 aggregation_la_LDFLAGS = $(PLUGIN_LDFLAGS)
116 aggregation_la_LIBADD = -lm
117 endif
119 if BUILD_PLUGIN_AMQP
120 pkglib_LTLIBRARIES += amqp.la
121 amqp_la_SOURCES = amqp.c \
122                   utils_cmd_putval.c utils_cmd_putval.h \
123                   utils_parse_option.c utils_parse_option.h \
124                   utils_format_graphite.c utils_format_graphite.h \
125                   utils_format_json.c utils_format_json.h
126 amqp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
127 amqp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
128 amqp_la_LIBADD = $(BUILD_WITH_LIBRABBITMQ_LIBS)
129 endif
131 if BUILD_PLUGIN_APACHE
132 pkglib_LTLIBRARIES += apache.la
133 apache_la_SOURCES = apache.c
134 apache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
135 apache_la_CFLAGS = $(AM_CFLAGS)
136 apache_la_LIBADD =
137 if BUILD_WITH_LIBCURL
138 apache_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
139 apache_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
140 endif
141 endif
143 if BUILD_PLUGIN_APCUPS
144 pkglib_LTLIBRARIES += apcups.la
145 apcups_la_SOURCES = apcups.c
146 apcups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
147 apcups_la_LIBADD =
148 if BUILD_WITH_LIBSOCKET
149 apcups_la_LIBADD += -lsocket
150 endif
151 endif
153 if BUILD_PLUGIN_APPLE_SENSORS
154 pkglib_LTLIBRARIES += apple_sensors.la
155 apple_sensors_la_SOURCES = apple_sensors.c
156 apple_sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS)
157 apple_sensors_la_LDFLAGS += -framework IOKit
158 endif
160 if BUILD_PLUGIN_AQUAERO
161 pkglib_LTLIBRARIES += aquaero.la
162 aquaero_la_SOURCES = aquaero.c
163 aquaero_la_LDFLAGS = $(PLUGIN_LDFLAGS)
164 aquaero_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBAQUAERO5_CFLAGS)
165 aquaero_la_LIBADD = $(BUILD_WITH_LIBAQUAERO5_LDFLAGS) -laquaero5
166 endif
168 if BUILD_PLUGIN_ASCENT
169 pkglib_LTLIBRARIES += ascent.la
170 ascent_la_SOURCES = ascent.c
171 ascent_la_LDFLAGS = $(PLUGIN_LDFLAGS)
172 ascent_la_CFLAGS = $(AM_CFLAGS) \
173                 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
174 ascent_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
175 endif
177 if BUILD_PLUGIN_BAROMETER
178 pkglib_LTLIBRARIES += barometer.la
179 barometer_la_SOURCES = barometer.c
180 barometer_la_LDFLAGS = $(PLUGIN_LDFLAGS)
181 barometer_la_LIBADD = -lm
182 endif
184 if BUILD_PLUGIN_BATTERY
185 pkglib_LTLIBRARIES += battery.la
186 battery_la_SOURCES = battery.c
187 battery_la_LDFLAGS = $(PLUGIN_LDFLAGS)
188 battery_la_LIBADD =
189 if BUILD_WITH_LIBIOKIT
190 battery_la_LDFLAGS += -framework IOKit
191 endif
192 endif
194 if BUILD_PLUGIN_BIND
195 pkglib_LTLIBRARIES += bind.la
196 bind_la_SOURCES = bind.c
197 bind_la_LDFLAGS = $(PLUGIN_LDFLAGS)
198 bind_la_CFLAGS = $(AM_CFLAGS) \
199                  $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
200 bind_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
201 endif
203 if BUILD_PLUGIN_CEPH
204 pkglib_LTLIBRARIES += ceph.la
205 ceph_la_SOURCES = ceph.c
206 ceph_la_CFLAGS = $(AM_CFLAGS)
207 ceph_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
208 ceph_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
209 ceph_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
210 endif
212 if BUILD_PLUGIN_CGROUPS
213 pkglib_LTLIBRARIES += cgroups.la
214 cgroups_la_SOURCES = cgroups.c
215 cgroups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
216 cgroups_la_LIBADD = libmount.la
217 endif
219 if BUILD_PLUGIN_CONNTRACK
220 pkglib_LTLIBRARIES += conntrack.la
221 conntrack_la_SOURCES = conntrack.c
222 conntrack_la_LDFLAGS = $(PLUGIN_LDFLAGS)
223 endif
225 if BUILD_PLUGIN_CONTEXTSWITCH
226 pkglib_LTLIBRARIES += contextswitch.la
227 contextswitch_la_SOURCES = contextswitch.c
228 contextswitch_la_LDFLAGS = $(PLUGIN_LDFLAGS)
229 contextswitch_la_LIBADD =
230 if BUILD_WITH_PERFSTAT
231 contextswitch_la_LIBADD += -lperfstat
232 endif
233 endif
235 if BUILD_PLUGIN_CPU
236 pkglib_LTLIBRARIES += cpu.la
237 cpu_la_SOURCES = cpu.c
238 cpu_la_CFLAGS = $(AM_CFLAGS)
239 cpu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
240 cpu_la_LIBADD =
241 if BUILD_WITH_LIBKSTAT
242 cpu_la_LIBADD += -lkstat
243 endif
244 if BUILD_WITH_LIBDEVINFO
245 cpu_la_LIBADD += -ldevinfo
246 endif
247 if BUILD_WITH_LIBSTATGRAB
248 cpu_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
249 cpu_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
250 endif
251 if BUILD_WITH_PERFSTAT
252 cpu_la_LIBADD += -lperfstat
253 endif
254 endif
256 if BUILD_PLUGIN_CPUFREQ
257 pkglib_LTLIBRARIES += cpufreq.la
258 cpufreq_la_SOURCES = cpufreq.c
259 cpufreq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
260 endif
262 if BUILD_PLUGIN_CSV
263 pkglib_LTLIBRARIES += csv.la
264 csv_la_SOURCES = csv.c
265 csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
266 endif
268 if BUILD_PLUGIN_CURL
269 pkglib_LTLIBRARIES += curl.la
270 curl_la_SOURCES = curl.c
271 curl_la_LDFLAGS = $(PLUGIN_LDFLAGS)
272 curl_la_CFLAGS = $(AM_CFLAGS)
273 curl_la_LIBADD =
274 if BUILD_WITH_LIBCURL
275 curl_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
276 curl_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
277 endif
278 endif
280 if BUILD_PLUGIN_CURL_JSON
281 pkglib_LTLIBRARIES += curl_json.la
282 curl_json_la_SOURCES = curl_json.c
283 curl_json_la_CFLAGS = $(AM_CFLAGS)
284 curl_json_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
285 curl_json_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
286 curl_json_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
287 if BUILD_WITH_LIBCURL
288 curl_json_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
289 curl_json_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
290 endif
291 endif
293 if BUILD_PLUGIN_CURL_XML
294 pkglib_LTLIBRARIES += curl_xml.la
295 curl_xml_la_SOURCES = curl_xml.c
296 curl_xml_la_LDFLAGS = $(PLUGIN_LDFLAGS)
297 curl_xml_la_CFLAGS = $(AM_CFLAGS) \
298                 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
299 curl_xml_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
300 endif
302 if BUILD_PLUGIN_DBI
303 pkglib_LTLIBRARIES += dbi.la
304 dbi_la_SOURCES = dbi.c \
305                  utils_db_query.c utils_db_query.h
306 dbi_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBDBI_CPPFLAGS)
307 dbi_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBDBI_LDFLAGS)
308 dbi_la_LIBADD = $(BUILD_WITH_LIBDBI_LIBS)
309 endif
311 if BUILD_PLUGIN_DF
312 pkglib_LTLIBRARIES += df.la
313 df_la_SOURCES = df.c
314 df_la_LDFLAGS = $(PLUGIN_LDFLAGS)
315 df_la_LIBADD = libmount.la
316 endif
318 if BUILD_PLUGIN_DISK
319 pkglib_LTLIBRARIES += disk.la
320 disk_la_SOURCES = disk.c
321 disk_la_CFLAGS = $(AM_CFLAGS)
322 disk_la_LDFLAGS = $(PLUGIN_LDFLAGS)
323 disk_la_LIBADD =
324 if BUILD_WITH_LIBKSTAT
325 disk_la_LIBADD += -lkstat
326 endif
327 if BUILD_WITH_LIBDEVINFO
328 disk_la_LIBADD += -ldevinfo
329 endif
330 if BUILD_WITH_LIBIOKIT
331 disk_la_LDFLAGS += -framework IOKit
332 endif
333 if BUILD_WITH_LIBSTATGRAB
334 disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
335 disk_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
336 endif
337 if BUILD_WITH_LIBUDEV
338 disk_la_LIBADD += -ludev
339 endif
340 if BUILD_FREEBSD
341 disk_la_LIBADD += -ldevstat -lgeom
342 endif
343 if BUILD_WITH_PERFSTAT
344 disk_la_LIBADD += -lperfstat
345 endif
346 endif
348 if BUILD_PLUGIN_DNS
349 pkglib_LTLIBRARIES += dns.la
350 dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
351 dns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
352 dns_la_LIBADD = $(PTHREAD_LIBS) -lpcap
353 endif
355 if BUILD_PLUGIN_DRBD
356 pkglib_LTLIBRARIES += drbd.la
357 drbd_la_SOURCES = drbd.c
358 drbd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
359 endif
361 if BUILD_PLUGIN_EMAIL
362 pkglib_LTLIBRARIES += email.la
363 email_la_SOURCES = email.c
364 email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
365 email_la_LIBADD = $(PTHREAD_LIBS)
366 endif
368 if BUILD_PLUGIN_ENTROPY
369 pkglib_LTLIBRARIES += entropy.la
370 entropy_la_SOURCES = entropy.c
371 entropy_la_LDFLAGS = $(PLUGIN_LDFLAGS)
372 endif
374 if BUILD_PLUGIN_EXEC
375 pkglib_LTLIBRARIES += exec.la
376 exec_la_SOURCES = exec.c \
377                   utils_cmd_putnotif.c utils_cmd_putnotif.h \
378                   utils_cmd_putval.c utils_cmd_putval.h \
379                   utils_parse_option.h utils_parse_option.c
380 exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
381 exec_la_LIBADD = $(PTHREAD_LIBS)
382 endif
384 if BUILD_PLUGIN_ETHSTAT
385 pkglib_LTLIBRARIES += ethstat.la
386 ethstat_la_SOURCES = ethstat.c
387 ethstat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
388 endif
390 if BUILD_PLUGIN_FHCOUNT
391 pkglib_LTLIBRARIES += fhcount.la
392 fhcount_la_SOURCES = fhcount.c
393 fhcount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
394 endif
396 if BUILD_PLUGIN_FILECOUNT
397 pkglib_LTLIBRARIES += filecount.la
398 filecount_la_SOURCES = filecount.c
399 filecount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
400 endif
402 if BUILD_PLUGIN_GMOND
403 pkglib_LTLIBRARIES += gmond.la
404 gmond_la_SOURCES = gmond.c
405 gmond_la_CPPFLAGS = $(AM_CPPFLAGS) $(GANGLIA_CPPFLAGS)
406 gmond_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(GANGLIA_LDFLAGS)
407 gmond_la_LIBADD = $(GANGLIA_LIBS)
408 endif
410 if BUILD_PLUGIN_HDDTEMP
411 pkglib_LTLIBRARIES += hddtemp.la
412 hddtemp_la_SOURCES = hddtemp.c
413 hddtemp_la_LDFLAGS = $(PLUGIN_LDFLAGS)
414 hddtemp_la_LIBADD =
415 if BUILD_WITH_LIBSOCKET
416 hddtemp_la_LIBADD += -lsocket
417 endif
418 endif
420 if BUILD_PLUGIN_INTERFACE
421 pkglib_LTLIBRARIES += interface.la
422 interface_la_SOURCES = interface.c
423 interface_la_CFLAGS = $(AM_CFLAGS)
424 interface_la_LDFLAGS = $(PLUGIN_LDFLAGS)
425 interface_la_LIBADD =
426 if BUILD_WITH_LIBSTATGRAB
427 interface_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
428 interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
429 else
430 if BUILD_WITH_LIBKSTAT
431 interface_la_LIBADD += -lkstat
432 endif
433 if BUILD_WITH_LIBDEVINFO
434 interface_la_LIBADD += -ldevinfo
435 endif # BUILD_WITH_LIBDEVINFO
436 endif # !BUILD_WITH_LIBSTATGRAB
437 if BUILD_WITH_PERFSTAT
438 interface_la_LIBADD += -lperfstat
439 endif
440 endif # BUILD_PLUGIN_INTERFACE
442 if BUILD_PLUGIN_IPC
443 pkglib_LTLIBRARIES += ipc.la
444 ipc_la_SOURCES = ipc.c
445 ipc_la_CFLAGS = $(AM_CFLAGS)
446 ipc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
447 endif
449 if BUILD_PLUGIN_IPTABLES
450 pkglib_LTLIBRARIES += iptables.la
451 iptables_la_SOURCES = iptables.c
452 iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS)
453 iptables_la_LDFLAGS = $(PLUGIN_LDFLAGS)
454 iptables_la_LIBADD = $(BUILD_WITH_LIBIPTC_LDFLAGS)
455 endif
457 if BUILD_PLUGIN_IPMI
458 pkglib_LTLIBRARIES += ipmi.la
459 ipmi_la_SOURCES = ipmi.c
460 ipmi_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_OPENIPMI_CFLAGS)
461 ipmi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
462 ipmi_la_LIBADD = $(BUILD_WITH_OPENIPMI_LIBS)
463 endif
465 if BUILD_PLUGIN_IPVS
466 pkglib_LTLIBRARIES += ipvs.la
467 ipvs_la_SOURCES = ipvs.c
468 if IP_VS_H_NEEDS_KERNEL_CFLAGS
469 ipvs_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS)
470 else
471 ipvs_la_CFLAGS = $(AM_CFLAGS)
472 endif
473 ipvs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
474 endif
476 if BUILD_PLUGIN_IRQ
477 pkglib_LTLIBRARIES += irq.la
478 irq_la_SOURCES = irq.c
479 irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
480 endif
482 if BUILD_PLUGIN_JAVA
483 pkglib_LTLIBRARIES += java.la
484 java_la_SOURCES = java.c
485 java_la_CPPFLAGS = $(AM_CPPFLAGS) $(JAVA_CPPFLAGS)
486 java_la_CFLAGS = $(AM_CFLAGS) $(JAVA_CFLAGS)
487 java_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(JAVA_LDFLAGS)
488 java_la_LIBADD = $(PTHREAD_LIBS) $(JAVA_LIBS)
489 endif
491 if BUILD_PLUGIN_LOAD
492 pkglib_LTLIBRARIES += load.la
493 load_la_SOURCES = load.c
494 load_la_CFLAGS = $(AM_CFLAGS)
495 load_la_LDFLAGS = $(PLUGIN_LDFLAGS)
496 load_la_LIBADD =
497 if BUILD_WITH_LIBSTATGRAB
498 load_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
499 load_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
500 endif # BUILD_WITH_LIBSTATGRAB
501 if BUILD_WITH_PERFSTAT
502 load_la_LIBADD += -lperfstat
503 endif
504 endif # BUILD_PLUGIN_LOAD
506 if BUILD_PLUGIN_LOGFILE
507 pkglib_LTLIBRARIES += logfile.la
508 logfile_la_SOURCES = logfile.c
509 logfile_la_LDFLAGS = $(PLUGIN_LDFLAGS)
510 endif
512 if BUILD_PLUGIN_LOG_LOGSTASH
513 pkglib_LTLIBRARIES += log_logstash.la
514 log_logstash_la_SOURCES = log_logstash.c
515 log_logstash_la_CFLAGS = $(AM_CFLAGS)
516 log_logstash_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
517 log_logstash_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
518 log_logstash_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
519 endif
521 if BUILD_PLUGIN_LPAR
522 pkglib_LTLIBRARIES += lpar.la
523 lpar_la_SOURCES = lpar.c
524 lpar_la_LDFLAGS = $(PLUGIN_LDFLAGS)
525 lpar_la_LIBADD = -lperfstat
526 endif
528 if BUILD_PLUGIN_LVM
529 pkglib_LTLIBRARIES += lvm.la
530 lvm_la_SOURCES = lvm.c
531 lvm_la_LDFLAGS = $(PLUGIN_LDFLAGS)
532 lvm_la_LIBADD = $(BUILD_WITH_LIBLVM2APP_LIBS)
533 endif
535 if BUILD_PLUGIN_MADWIFI
536 pkglib_LTLIBRARIES += madwifi.la
537 madwifi_la_SOURCES = madwifi.c madwifi.h
538 madwifi_la_LDFLAGS = $(PLUGIN_LDFLAGS)
539 endif
541 if BUILD_PLUGIN_MATCH_EMPTY_COUNTER
542 pkglib_LTLIBRARIES += match_empty_counter.la
543 match_empty_counter_la_SOURCES = match_empty_counter.c
544 match_empty_counter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
545 endif
547 if BUILD_PLUGIN_MATCH_HASHED
548 pkglib_LTLIBRARIES += match_hashed.la
549 match_hashed_la_SOURCES = match_hashed.c
550 match_hashed_la_LDFLAGS = $(PLUGIN_LDFLAGS)
551 endif
553 if BUILD_PLUGIN_MATCH_REGEX
554 pkglib_LTLIBRARIES += match_regex.la
555 match_regex_la_SOURCES = match_regex.c
556 match_regex_la_LDFLAGS = $(PLUGIN_LDFLAGS)
557 endif
559 if BUILD_PLUGIN_MATCH_TIMEDIFF
560 pkglib_LTLIBRARIES += match_timediff.la
561 match_timediff_la_SOURCES = match_timediff.c
562 match_timediff_la_LDFLAGS = $(PLUGIN_LDFLAGS)
563 endif
565 if BUILD_PLUGIN_MATCH_VALUE
566 pkglib_LTLIBRARIES += match_value.la
567 match_value_la_SOURCES = match_value.c
568 match_value_la_LDFLAGS = $(PLUGIN_LDFLAGS)
569 endif
571 if BUILD_PLUGIN_MBMON
572 pkglib_LTLIBRARIES += mbmon.la
573 mbmon_la_SOURCES = mbmon.c
574 mbmon_la_LDFLAGS = $(PLUGIN_LDFLAGS)
575 mbmon_la_LIBADD =
576 if BUILD_WITH_LIBSOCKET
577 mbmon_la_LIBADD += -lsocket
578 endif
579 endif
581 if BUILD_PLUGIN_MD
582 pkglib_LTLIBRARIES += md.la
583 md_la_SOURCES = md.c
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 mic_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_MIC_LIBPATH)
630 mic_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_MIC_CPPFLAGS)
631 mic_la_LIBADD = $(BUILD_WITH_MIC_LDADD)
632 endif
634 if BUILD_PLUGIN_MODBUS
635 pkglib_LTLIBRARIES += modbus.la
636 modbus_la_SOURCES = modbus.c
637 modbus_la_LDFLAGS = $(PLUGIN_LDFLAGS)
638 modbus_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMODBUS_CFLAGS)
639 modbus_la_LIBADD = $(BUILD_WITH_LIBMODBUS_LIBS)
640 endif
642 if BUILD_PLUGIN_MQTT
643 pkglib_LTLIBRARIES += mqtt.la
644 mqtt_la_SOURCES = mqtt.c
645 mqtt_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
646 mqtt_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
647 mqtt_la_LIBADD = $(BUILD_WITH_LIBMOSQUITTO_LIBS)
648 endif
650 if BUILD_PLUGIN_MULTIMETER
651 pkglib_LTLIBRARIES += multimeter.la
652 multimeter_la_SOURCES = multimeter.c
653 multimeter_la_LDFLAGS = $(PLUGIN_LDFLAGS)
654 endif
656 if BUILD_PLUGIN_MYSQL
657 pkglib_LTLIBRARIES += mysql.la
658 mysql_la_SOURCES = mysql.c
659 mysql_la_LDFLAGS = $(PLUGIN_LDFLAGS)
660 mysql_la_CFLAGS = $(AM_CFLAGS)
661 mysql_la_LIBADD =
662 if BUILD_WITH_LIBMYSQL
663 mysql_la_CFLAGS += $(BUILD_WITH_LIBMYSQL_CFLAGS)
664 mysql_la_LIBADD += $(BUILD_WITH_LIBMYSQL_LIBS)
665 endif
666 endif
668 if BUILD_PLUGIN_NETAPP
669 pkglib_LTLIBRARIES += netapp.la
670 netapp_la_SOURCES = netapp.c
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 = $(PTHREAD_LIBS)
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 = $(PTHREAD_LIBS) -lesmtp -lssl -lcrypto
738 endif
740 if BUILD_PLUGIN_NOTIFY_NAGIOS
741 pkglib_LTLIBRARIES += notify_nagios.la
742 notify_nagios_la_SOURCES = notify_nagios.c
743 notify_nagios_la_LDFLAGS = $(PLUGIN_LDFLAGS)
744 endif
746 if BUILD_PLUGIN_NTPD
747 pkglib_LTLIBRARIES += ntpd.la
748 ntpd_la_SOURCES = ntpd.c
749 ntpd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
750 ntpd_la_LIBADD =
751 if BUILD_WITH_LIBSOCKET
752 ntpd_la_LIBADD += -lsocket
753 endif
754 endif
756 if BUILD_PLUGIN_NUMA
757 pkglib_LTLIBRARIES += numa.la
758 numa_la_SOURCES = numa.c
759 numa_la_LDFLAGS = $(PLUGIN_LDFLAGS)
760 endif
762 if BUILD_PLUGIN_NUT
763 pkglib_LTLIBRARIES += nut.la
764 nut_la_SOURCES = nut.c
765 nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
766 nut_la_LDFLAGS = $(PLUGIN_LDFLAGS)
767 nut_la_LIBADD = $(PTHREAD_LIBS) $(BUILD_WITH_LIBUPSCLIENT_LIBS)
768 endif
770 if BUILD_PLUGIN_OLSRD
771 pkglib_LTLIBRARIES += olsrd.la
772 olsrd_la_SOURCES = olsrd.c
773 olsrd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
774 olsrd_la_LIBADD =
775 if BUILD_WITH_LIBSOCKET
776 olsrd_la_LIBADD += -lsocket
777 endif
778 endif
780 if BUILD_PLUGIN_ONEWIRE
781 pkglib_LTLIBRARIES += onewire.la
782 onewire_la_SOURCES = onewire.c
783 onewire_la_CFLAGS = $(AM_CFLAGS)
784 onewire_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
785 onewire_la_LIBADD = $(BUILD_WITH_LIBOWCAPI_LIBS)
786 onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOWCAPI_LDFLAGS)
787 endif
789 if BUILD_PLUGIN_OPENLDAP
790 pkglib_LTLIBRARIES += openldap.la
791 openldap_la_SOURCES = openldap.c
792 openldap_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBLDAP_LDFLAGS)
793 openldap_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBLDAP_CPPFLAGS)
794 openldap_la_LIBADD = -lldap
795 endif
797 if BUILD_PLUGIN_OPENVPN
798 pkglib_LTLIBRARIES += openvpn.la
799 openvpn_la_SOURCES = openvpn.c
800 openvpn_la_CFLAGS = $(AM_CFLAGS)
801 openvpn_la_LDFLAGS = $(PLUGIN_LDFLAGS)
802 endif
804 if BUILD_PLUGIN_ORACLE
805 pkglib_LTLIBRARIES += oracle.la
806 oracle_la_SOURCES = oracle.c \
807         utils_db_query.c utils_db_query.h
808 oracle_la_CFLAGS = $(AM_CFLAGS)
809 oracle_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_ORACLE_CFLAGS)
810 oracle_la_LIBADD = $(BUILD_WITH_ORACLE_LIBS)
811 oracle_la_LDFLAGS = $(PLUGIN_LDFLAGS)
812 endif
814 if BUILD_PLUGIN_PERL
815 pkglib_LTLIBRARIES += perl.la
816 perl_la_SOURCES = perl.c
817 # Despite C99 providing the "bool" type thru stdbool.h, Perl defines its own
818 # version of that type if HAS_BOOL is not defined... *sigh*
819 perl_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAS_BOOL=1
820 perl_la_CFLAGS  = $(AM_CFLAGS) \
821                 $(PERL_CFLAGS) \
822                 -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
823 # Work-around for issues #41 and #42 - Perl 5.10 incorrectly introduced
824 # __attribute__nonnull__(3) for Perl_load_module().
825 if HAVE_BROKEN_PERL_LOAD_MODULE
826 perl_la_CFLAGS += -Wno-nonnull
827 endif
828 perl_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
829                 $(PERL_LDFLAGS)
830 perl_la_LIBADD = $(PERL_LIBS)
831 endif
833 if BUILD_PLUGIN_PF
834 pkglib_LTLIBRARIES += pf.la
835 pf_la_SOURCES = pf.c
836 pf_la_LDFLAGS = $(PLUGIN_LDFLAGS)
837 endif
839 if BUILD_PLUGIN_PINBA
840 pkglib_LTLIBRARIES += pinba.la
841 pinba_la_SOURCES = pinba.c
842 nodist_pinba_la_SOURCES = pinba.pb-c.c pinba.pb-c.h
843 pinba_la_LDFLAGS = $(PLUGIN_LDFLAGS)
844 pinba_la_LIBADD = -lprotobuf-c
845 endif
847 if BUILD_PLUGIN_PING
848 pkglib_LTLIBRARIES += ping.la
849 ping_la_SOURCES = ping.c
850 ping_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOPING_CPPFLAGS)
851 ping_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOPING_LDFLAGS)
852 ping_la_LIBADD = -loping -lm
853 endif
855 if BUILD_PLUGIN_POSTGRESQL
856 pkglib_LTLIBRARIES += postgresql.la
857 postgresql_la_SOURCES = postgresql.c \
858                  utils_db_query.c utils_db_query.h
859 postgresql_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPQ_CPPFLAGS)
860 postgresql_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
861                 $(BUILD_WITH_LIBPQ_LDFLAGS)
862 postgresql_la_LIBADD = -lpq
863 endif
865 if BUILD_PLUGIN_POWERDNS
866 pkglib_LTLIBRARIES += powerdns.la
867 powerdns_la_SOURCES = powerdns.c
868 powerdns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
869 endif
871 if BUILD_PLUGIN_PYTHON
872 pkglib_LTLIBRARIES += python.la
873 python_la_SOURCES = python.c pyconfig.c pyvalues.c cpython.h
874 python_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_PYTHON_CPPFLAGS)
875 python_la_CFLAGS = $(AM_CFLAGS)
876 if COMPILER_IS_GCC
877 python_la_CFLAGS += -fno-strict-aliasing -Wno-strict-aliasing
878 endif
879 python_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_PYTHON_LDFLAGS)
880 python_la_LIBADD = $(BUILD_WITH_PYTHON_LIBS)
881 endif
883 if BUILD_PLUGIN_PROCESSES
884 pkglib_LTLIBRARIES += processes.la
885 processes_la_SOURCES = processes.c
886 processes_la_LDFLAGS = $(PLUGIN_LDFLAGS)
887 processes_la_LIBADD =
888 if BUILD_WITH_LIBKVM_GETPROCS
889 processes_la_LIBADD += -lkvm
890 endif
891 endif
893 if BUILD_PLUGIN_PROTOCOLS
894 pkglib_LTLIBRARIES += protocols.la
895 protocols_la_SOURCES = protocols.c
896 protocols_la_LDFLAGS = $(PLUGIN_LDFLAGS)
897 endif
899 if BUILD_PLUGIN_REDIS
900 pkglib_LTLIBRARIES += redis.la
901 redis_la_SOURCES = redis.c
902 redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
903 redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
904 redis_la_LIBADD = -lhiredis
905 endif
907 if BUILD_PLUGIN_ROUTEROS
908 pkglib_LTLIBRARIES += routeros.la
909 routeros_la_SOURCES = routeros.c
910 routeros_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
911 routeros_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBROUTEROS_LDFLAGS)
912 routeros_la_LIBADD = -lrouteros
913 endif
915 if BUILD_PLUGIN_RRDCACHED
916 pkglib_LTLIBRARIES += rrdcached.la
917 rrdcached_la_SOURCES = rrdcached.c utils_rrdcreate.c utils_rrdcreate.h
918 rrdcached_la_LDFLAGS = $(PLUGIN_LDFLAGS)
919 rrdcached_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
920 rrdcached_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
921 endif
923 if BUILD_PLUGIN_RRDTOOL
924 pkglib_LTLIBRARIES += rrdtool.la
925 rrdtool_la_SOURCES = rrdtool.c utils_rrdcreate.c utils_rrdcreate.h
926 rrdtool_la_LDFLAGS = $(PLUGIN_LDFLAGS)
927 rrdtool_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
928 rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
929 endif
931 if BUILD_PLUGIN_SENSORS
932 pkglib_LTLIBRARIES += sensors.la
933 sensors_la_SOURCES = sensors.c
934 sensors_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSENSORS_CFLAGS)
935 sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBSENSORS_LDFLAGS)
936 sensors_la_LIBADD = -lsensors
937 endif
939 if BUILD_PLUGIN_SERIAL
940 pkglib_LTLIBRARIES += serial.la
941 serial_la_SOURCES = serial.c
942 serial_la_LDFLAGS = $(PLUGIN_LDFLAGS)
943 endif
945 if BUILD_PLUGIN_SIGROK
946 pkglib_LTLIBRARIES += sigrok.la
947 sigrok_la_SOURCES = sigrok.c
948 sigrok_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSIGROK_CFLAGS)
949 sigrok_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBSIGROK_LDFLAGS)
950 sigrok_la_LIBADD = -lsigrok
951 endif
953 if BUILD_PLUGIN_SMART
954 if BUILD_WITH_LIBUDEV
955 pkglib_LTLIBRARIES += smart.la
956 smart_la_SOURCES = smart.c
957 smart_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBATASMART_CPPFLAGS)
958 smart_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBATASMART_LDFLAGS)
959 smart_la_LIBADD = $(BUILD_WITH_LIBATASMART_LIBS) -ludev
960 endif
961 endif
963 if BUILD_PLUGIN_SNMP
964 pkglib_LTLIBRARIES += snmp.la
965 snmp_la_SOURCES = snmp.c
966 snmp_la_LDFLAGS = $(PLUGIN_LDFLAGS)
967 snmp_la_CFLAGS = $(AM_CFLAGS)
968 snmp_la_LIBADD =
969 if BUILD_WITH_LIBNETSNMP
970 snmp_la_CFLAGS += $(BUILD_WITH_LIBSNMP_CFLAGS)
971 snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS)
972 endif
973 if BUILD_WITH_LIBPTHREAD
974 snmp_la_LIBADD += $(PTHREAD_LIBS)
975 endif
976 endif
978 if BUILD_PLUGIN_STATSD
979 pkglib_LTLIBRARIES += statsd.la
980 statsd_la_SOURCES = statsd.c
981 statsd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
982 statsd_la_LIBADD = $(PTHREAD_LIBS) liblatency.la -lm
983 endif
985 if BUILD_PLUGIN_SWAP
986 pkglib_LTLIBRARIES += swap.la
987 swap_la_SOURCES = swap.c
988 swap_la_CFLAGS = $(AM_CFLAGS)
989 swap_la_LDFLAGS = $(PLUGIN_LDFLAGS)
990 swap_la_LIBADD =
991 if BUILD_WITH_LIBKSTAT
992 swap_la_LIBADD += -lkstat
993 endif
994 if BUILD_WITH_LIBDEVINFO
995 swap_la_LIBADD += -ldevinfo
996 endif
997 if BUILD_WITH_LIBKVM_GETSWAPINFO
998 swap_la_LIBADD += -lkvm
999 endif
1000 if BUILD_WITH_LIBSTATGRAB
1001 swap_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
1002 swap_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
1003 endif
1004 if BUILD_WITH_PERFSTAT
1005 swap_la_LIBADD += -lperfstat
1006 endif
1008 endif
1010 if BUILD_PLUGIN_SYSLOG
1011 pkglib_LTLIBRARIES += syslog.la
1012 syslog_la_SOURCES = syslog.c
1013 syslog_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1014 endif
1016 if BUILD_PLUGIN_TABLE
1017 pkglib_LTLIBRARIES += table.la
1018 table_la_SOURCES = table.c
1019 table_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1020 endif
1022 if BUILD_PLUGIN_TAIL
1023 pkglib_LTLIBRARIES += tail.la
1024 tail_la_SOURCES = tail.c
1025 tail_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1026 endif
1028 if BUILD_PLUGIN_TAIL_CSV
1029 pkglib_LTLIBRARIES += tail_csv.la
1030 tail_csv_la_SOURCES = tail_csv.c
1031 tail_csv_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1032 endif
1034 if BUILD_PLUGIN_TAPE
1035 pkglib_LTLIBRARIES += tape.la
1036 tape_la_SOURCES = tape.c
1037 tape_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1038 tape_la_LIBADD = -lkstat -ldevinfo
1039 endif
1041 if BUILD_PLUGIN_TARGET_NOTIFICATION
1042 pkglib_LTLIBRARIES += target_notification.la
1043 target_notification_la_SOURCES = target_notification.c
1044 target_notification_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1045 endif
1047 if BUILD_PLUGIN_TARGET_REPLACE
1048 pkglib_LTLIBRARIES += target_replace.la
1049 target_replace_la_SOURCES = target_replace.c
1050 target_replace_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1051 endif
1053 if BUILD_PLUGIN_TARGET_SCALE
1054 pkglib_LTLIBRARIES += target_scale.la
1055 target_scale_la_SOURCES = target_scale.c
1056 target_scale_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1057 endif
1059 if BUILD_PLUGIN_TARGET_SET
1060 pkglib_LTLIBRARIES += target_set.la
1061 target_set_la_SOURCES = target_set.c
1062 target_set_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1063 endif
1065 if BUILD_PLUGIN_TARGET_V5UPGRADE
1066 pkglib_LTLIBRARIES += target_v5upgrade.la
1067 target_v5upgrade_la_SOURCES = target_v5upgrade.c
1068 target_v5upgrade_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1069 endif
1071 if BUILD_PLUGIN_TCPCONNS
1072 pkglib_LTLIBRARIES += tcpconns.la
1073 tcpconns_la_SOURCES = tcpconns.c
1074 tcpconns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1075 tcpconns_la_LIBADD =
1076 if BUILD_WITH_LIBKVM_NLIST
1077 tcpconns_la_LIBADD += -lkvm
1078 endif
1079 endif
1081 if BUILD_PLUGIN_TEAMSPEAK2
1082 pkglib_LTLIBRARIES += teamspeak2.la
1083 teamspeak2_la_SOURCES = teamspeak2.c
1084 teamspeak2_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1085 endif
1087 if BUILD_PLUGIN_TED
1088 pkglib_LTLIBRARIES += ted.la
1089 ted_la_SOURCES = ted.c
1090 ted_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1091 endif
1093 if BUILD_PLUGIN_THERMAL
1094 pkglib_LTLIBRARIES += thermal.la
1095 thermal_la_SOURCES = thermal.c
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 = $(PTHREAD_LIBS)
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 virt_la_CFLAGS = $(AM_CFLAGS) \
1182                 $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
1183 virt_la_LIBADD = $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
1184 virt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1185 endif
1187 if BUILD_PLUGIN_VMEM
1188 pkglib_LTLIBRARIES += vmem.la
1189 vmem_la_SOURCES = vmem.c
1190 vmem_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1191 endif
1193 if BUILD_PLUGIN_VSERVER
1194 pkglib_LTLIBRARIES += vserver.la
1195 vserver_la_SOURCES = vserver.c
1196 vserver_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1197 endif
1199 if BUILD_PLUGIN_WIRELESS
1200 pkglib_LTLIBRARIES += wireless.la
1201 wireless_la_SOURCES = wireless.c
1202 wireless_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1203 endif
1205 if BUILD_PLUGIN_WRITE_GRAPHITE
1206 pkglib_LTLIBRARIES += write_graphite.la
1207 write_graphite_la_SOURCES = write_graphite.c \
1208                         utils_format_graphite.c utils_format_graphite.h \
1209                         utils_format_json.c utils_format_json.h
1210 write_graphite_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1211 endif
1213 if BUILD_PLUGIN_WRITE_HTTP
1214 pkglib_LTLIBRARIES += write_http.la
1215 write_http_la_SOURCES = write_http.c \
1216                         utils_format_json.c utils_format_json.h
1217 write_http_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1218 write_http_la_CFLAGS = $(AM_CFLAGS)
1219 write_http_la_LIBADD =
1220 if BUILD_WITH_LIBCURL
1221 write_http_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
1222 write_http_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
1223 endif
1224 endif
1226 if BUILD_PLUGIN_WRITE_KAFKA
1227 pkglib_LTLIBRARIES += write_kafka.la
1228 write_kafka_la_SOURCES = write_kafka.c \
1229                         utils_format_graphite.c utils_format_graphite.h \
1230                         utils_format_json.c utils_format_json.h \
1231                         utils_cmd_putval.c utils_cmd_putval.h \
1232                         utils_crc32.c utils_crc32.h
1233 write_kafka_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
1234 write_kafka_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
1235 write_kafka_la_LIBADD = $(BUILD_WITH_LIBRDKAFKA_LIBS)
1236 endif
1238 if BUILD_PLUGIN_WRITE_LOG
1239 pkglib_LTLIBRARIES += write_log.la
1240 write_log_la_SOURCES = write_log.c \
1241                         utils_format_graphite.c utils_format_graphite.h
1242 write_log_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1243 endif
1245 if BUILD_PLUGIN_WRITE_MONGODB
1246 pkglib_LTLIBRARIES += write_mongodb.la
1247 write_mongodb_la_SOURCES = write_mongodb.c
1248 write_mongodb_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMONGOC_CPPFLAGS)
1249 write_mongodb_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMONGOC_LDFLAGS)
1250 write_mongodb_la_LIBADD = -lmongoc
1251 endif
1253 if BUILD_PLUGIN_WRITE_REDIS
1254 pkglib_LTLIBRARIES += write_redis.la
1255 write_redis_la_SOURCES = write_redis.c
1256 write_redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
1257 write_redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
1258 write_redis_la_LIBADD = -lhiredis
1259 endif
1261 if BUILD_PLUGIN_WRITE_RIEMANN
1262 pkglib_LTLIBRARIES += write_riemann.la
1263 write_riemann_la_SOURCES = write_riemann.c write_riemann_threshold.c write_riemann_threshold.h
1264 write_riemann_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(RIEMANN_C_LIBS)
1265 write_riemann_la_CFLAGS = $(AM_CFLAGS) $(RIEMANN_C_CFLAGS)
1266 endif
1268 if BUILD_PLUGIN_WRITE_SENSU
1269 pkglib_LTLIBRARIES += write_sensu.la
1270 write_sensu_la_SOURCES = write_sensu.c
1271 write_sensu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1272 endif
1274 if BUILD_PLUGIN_WRITE_TSDB
1275 pkglib_LTLIBRARIES += write_tsdb.la
1276 write_tsdb_la_SOURCES = write_tsdb.c
1277 write_tsdb_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1278 endif
1280 if BUILD_PLUGIN_XENCPU
1281 pkglib_LTLIBRARIES += xencpu.la
1282 xencpu_la_SOURCES = xencpu.c
1283 xencpu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1284 xencpu_la_LIBADD = -lxenctrl
1285 endif
1287 if BUILD_PLUGIN_XMMS
1288 pkglib_LTLIBRARIES += xmms.la
1289 xmms_la_SOURCES = xmms.c
1290 xmms_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBXMMS_CFLAGS)
1291 xmms_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1292 xmms_la_LIBADD = $(BUILD_WITH_LIBXMMS_LIBS)
1293 endif
1295 if BUILD_PLUGIN_ZFS_ARC
1296 pkglib_LTLIBRARIES += zfs_arc.la
1297 zfs_arc_la_SOURCES = zfs_arc.c
1298 zfs_arc_la_CFLAGS = $(AM_CFLAGS)
1299 zfs_arc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1300 if BUILD_FREEBSD
1301 zfs_arc_la_LIBADD = -lm
1302 else
1303 if BUILD_LINUX
1304 # zfs_arc requires no library on linux
1305 else
1306 # solaris
1307 zfs_arc_la_LIBADD = -lkstat
1308 endif
1309 endif
1310 endif
1312 if BUILD_PLUGIN_ZOOKEEPER
1313 pkglib_LTLIBRARIES += zookeeper.la
1314 zookeeper_la_SOURCES = zookeeper.c
1315 zookeeper_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1316 endif
1318 BUILT_SOURCES += $(dist_man_MANS)
1320 if BUILD_PLUGIN_ZONE
1321 pkglib_LTLIBRARIES += zone.la
1322 zone_la_SOURCES = zone.c
1323 zone_la_CFLAGS = $(AM_CFLAGS)
1324 zone_la_LDFLAGS = $(PLUGIN_LDFLAGS)
1325 endif
1327 dist_man_MANS = collectd.1 \
1328                 collectd.conf.5 \
1329                 collectd-email.5 \
1330                 collectd-exec.5 \
1331                 collectdctl.1 \
1332                 collectd-java.5 \
1333                 collectdmon.1 \
1334                 collectd-nagios.1 \
1335                 collectd-perl.5 \
1336                 collectd-python.5 \
1337                 collectd-snmp.5 \
1338                 collectd-tg.1 \
1339                 collectd-threshold.5 \
1340                 collectd-unixsock.5 \
1341                 types.db.5
1343 #collectd_1_SOURCES = collectd.pod
1345 EXTRA_DIST = types.db
1347 EXTRA_DIST +=   collectd.conf.pod \
1348                 collectd-email.pod \
1349                 collectd-exec.pod \
1350                 collectdctl.pod \
1351                 collectd-java.pod \
1352                 collectdmon.pod \
1353                 collectd-nagios.pod \
1354                 collectd-perl.pod \
1355                 collectd-python.pod \
1356                 collectd.pod \
1357                 collectd-snmp.pod \
1358                 collectd-tg.pod \
1359                 collectd-threshold.pod \
1360                 collectd-unixsock.pod \
1361                 postgresql_default.conf \
1362                 types.db.pod
1364 .pod.1:
1365         pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
1366                 >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
1367         @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
1368         then \
1369                 echo "$@ has some POD errors!"; false; \
1370         fi
1372 .pod.5:
1373         pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< \
1374                 >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
1375         @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
1376         then \
1377                 echo "$@ has some POD errors!"; false; \
1378         fi
1380 AM_V_PROTOC_C = $(am__v_PROTOC_C_@AM_V@)
1381 am__v_PROTOC_C_ = $(am__v_PROTOC_C_@AM_DEFAULT_V@)
1382 am__v_PROTOC_C_0 = @echo "  PROTOC-C    " $@;
1383 am__v_PROTOC_C_1 =
1385 # Protocol buffer for the "pinba" plugin.
1386 EXTRA_DIST += pinba.proto
1387 if BUILD_PLUGIN_PINBA
1388 CLEANFILES += pinba.pb-c.c pinba.pb-c.h
1389 BUILT_SOURCES += pinba.pb-c.c pinba.pb-c.h
1391 pinba.pb-c.c pinba.pb-c.h: pinba.proto
1392         $(AM_V_PROTOC_C)protoc-c -I$(srcdir) --c_out . $(srcdir)/pinba.proto
1393 endif
1395 install-exec-hook:
1396         $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
1397         if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
1398         then \
1399                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
1400         else \
1401                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
1402         fi; \
1403         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
1404         $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db;
1405         $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \
1406                 $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
1408 uninstall-hook:
1409         rm -f $(DESTDIR)$(pkgdatadir)/types.db;
1410         rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
1411         rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
1413 if BUILD_PLUGIN_CEPH
1414 test_plugin_ceph_SOURCES = ceph_test.c
1415 test_plugin_ceph_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
1416 test_plugin_ceph_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
1417 test_plugin_ceph_LDADD = daemon/libcommon.la daemon/libplugin_mock.la $(BUILD_WITH_LIBYAJL_LIBS)
1418 check_PROGRAMS += test_plugin_ceph
1419 TESTS += test_plugin_ceph
1420 endif