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