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