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