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