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