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