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