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