Code

789f7f8adaa06448012ab3cb9d8af8ea0f78c8de
[collectd.git] / src / Makefile.am
1 SUBDIRS =
2 if BUILD_WITH_OWN_LIBIPTC
3 SUBDIRS += libiptc
4 endif
5 if BUILD_WITH_OWN_LIBOCONFIG
6 SUBDIRS += liboconfig
7 endif
8 if BUILD_WITH_OWN_LIBOPING
9 SUBDIRS += liboping
10 endif
12 if COMPILER_IS_GCC
13 AM_CFLAGS = -Wall -Werror
14 endif
16 AM_CPPFLAGS = -DPREFIX='"${prefix}"'
17 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
18 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
19 AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
20 if BUILD_FEATURE_DAEMON
21 AM_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
22 endif
23 AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
24 AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
26 sbin_PROGRAMS = collectd collectdmon
27 bin_PROGRAMS = collectd-nagios
29 collectd_SOURCES = collectd.c collectd.h \
30                    common.c common.h \
31                    configfile.c configfile.h \
32                    plugin.c plugin.h \
33                    utils_avltree.c utils_avltree.h \
34                    utils_cache.c utils_cache.h \
35                    utils_complain.c utils_complain.h \
36                    utils_ignorelist.c utils_ignorelist.h \
37                    utils_llist.c utils_llist.h \
38                    utils_tail_match.c utils_tail_match.h \
39                    utils_match.c utils_match.h \
40                    utils_mount.c utils_mount.h \
41                    utils_tail.c utils_tail.h \
42                    utils_threshold.c utils_threshold.h \
43                    types_list.c types_list.h
45 collectd_CPPFLAGS =  $(AM_CPPFLAGS) $(LTDLINCL)
46 collectd_CFLAGS = $(AM_CFLAGS)
47 collectd_LDFLAGS = -export-dynamic
48 collectd_LDADD =
49 collectd_DEPENDENCIES =
51 # Link to these libraries..
52 if BUILD_WITH_LIBRT
53 collectd_LDADD += -lrt
54 endif
55 if BUILD_WITH_LIBSOCKET
56 collectd_LDADD += -lsocket
57 endif
58 if BUILD_WITH_LIBRESOLV
59 collectd_LDADD += -lresolv
60 endif
61 if BUILD_WITH_LIBPTHREAD
62 collectd_LDADD += -lpthread
63 endif
64 if BUILD_WITH_LIBKSTAT
65 collectd_LDADD += -lkstat
66 endif
67 if BUILD_WITH_LIBDEVINFO
68 collectd_LDADD += -ldevinfo
69 endif
71 # The daemon needs to call sg_init, so we need to link it against libstatgrab,
72 # too. -octo
73 if BUILD_WITH_LIBSTATGRAB
74 collectd_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
75 collectd_LDADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
76 endif
78 if BUILD_WITH_OWN_LIBOCONFIG
79 collectd_LDADD += $(LIBLTDL) liboconfig/liboconfig.la
80 collectd_DEPENDENCIES += $(LIBLTDL) liboconfig/liboconfig.la
81 else
82 collectd_LDADD += -loconfig
83 endif
85 collectdmon_SOURCES = collectdmon.c
86 collectdmon_CPPFLAGS = $(AM_CPPFLAGS)
88 collectd_nagios_SOURCES = collectd-nagios.c
89 collectd_nagios_LDFLAGS =
90 if BUILD_WITH_LIBSOCKET
91 collectd_nagios_LDFLAGS += -lsocket
92 endif
94 pkglib_LTLIBRARIES = 
96 if BUILD_PLUGIN_APACHE
97 pkglib_LTLIBRARIES += apache.la
98 apache_la_SOURCES = apache.c
99 apache_la_LDFLAGS = -module -avoid-version
100 apache_la_CFLAGS = $(AM_CFLAGS)
101 apache_la_LIBADD =
102 collectd_LDADD += "-dlopen" apache.la
103 if BUILD_WITH_LIBCURL
104 apache_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
105 apache_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
106 endif
107 collectd_DEPENDENCIES += apache.la
108 endif
110 if BUILD_PLUGIN_APCUPS
111 pkglib_LTLIBRARIES += apcups.la
112 apcups_la_SOURCES = apcups.c
113 apcups_la_LDFLAGS = -module -avoid-version
114 if BUILD_WITH_LIBSOCKET
115 apcups_la_LDFLAGS += -lsocket
116 endif
117 collectd_LDADD += "-dlopen" apcups.la
118 collectd_DEPENDENCIES += apcups.la
119 endif
121 if BUILD_PLUGIN_APPLE_SENSORS
122 pkglib_LTLIBRARIES += apple_sensors.la
123 apple_sensors_la_SOURCES = apple_sensors.c
124 apple_sensors_la_LDFLAGS = -module -avoid-version -lIOKit
125 collectd_LDADD += "-dlopen" apple_sensors.la
126 collectd_DEPENDENCIES += apple_sensors.la
127 endif
129 if BUILD_PLUGIN_ASCENT
130 pkglib_LTLIBRARIES += ascent.la
131 ascent_la_SOURCES = ascent.c
132 ascent_la_LDFLAGS = -module -avoid-version
133 ascent_la_CFLAGS = $(AM_CFLAGS) \
134                 $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
135 ascent_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
136 collectd_LDADD += "-dlopen" apache.la
137 collectd_DEPENDENCIES += ascent.la
138 endif
140 if BUILD_PLUGIN_BATTERY
141 pkglib_LTLIBRARIES += battery.la
142 battery_la_SOURCES = battery.c
143 battery_la_LDFLAGS = -module -avoid-version
144 if BUILD_WITH_LIBIOKIT
145 battery_la_LDFLAGS += -lIOKit
146 endif
147 collectd_LDADD += "-dlopen" battery.la
148 collectd_DEPENDENCIES += battery.la
149 endif
151 if BUILD_PLUGIN_CPU
152 pkglib_LTLIBRARIES += cpu.la
153 cpu_la_SOURCES = cpu.c
154 cpu_la_CFLAGS = $(AM_CFLAGS)
155 cpu_la_LDFLAGS = -module -avoid-version
156 cpu_la_LIBADD = 
157 if BUILD_WITH_LIBKSTAT
158 cpu_la_LDFLAGS += -lkstat
159 endif
160 if BUILD_WITH_LIBDEVINFO
161 cpu_la_LDFLAGS += -ldevinfo
162 endif
163 if BUILD_WITH_LIBSTATGRAB
164 cpu_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
165 cpu_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
166 endif
167 collectd_LDADD += "-dlopen" cpu.la
168 collectd_DEPENDENCIES += cpu.la
169 endif
171 if BUILD_PLUGIN_CPUFREQ
172 pkglib_LTLIBRARIES += cpufreq.la
173 cpufreq_la_SOURCES = cpufreq.c
174 cpufreq_la_LDFLAGS = -module -avoid-version
175 collectd_LDADD += "-dlopen" cpufreq.la
176 collectd_DEPENDENCIES += cpufreq.la
177 endif
179 if BUILD_PLUGIN_CSV
180 pkglib_LTLIBRARIES += csv.la
181 csv_la_SOURCES = csv.c
182 csv_la_LDFLAGS = -module -avoid-version
183 collectd_LDADD += "-dlopen" csv.la
184 collectd_DEPENDENCIES += csv.la
185 endif
187 if BUILD_PLUGIN_DF
188 pkglib_LTLIBRARIES += df.la
189 df_la_SOURCES = df.c
190 df_la_LDFLAGS = -module -avoid-version
191 collectd_LDADD += "-dlopen" df.la
192 collectd_DEPENDENCIES += df.la
193 endif
195 if BUILD_PLUGIN_DISK
196 pkglib_LTLIBRARIES += disk.la
197 disk_la_SOURCES = disk.c
198 disk_la_CFLAGS = $(AM_CFLAGS)
199 disk_la_LDFLAGS = -module -avoid-version
200 disk_la_LIBADD = 
201 if BUILD_WITH_LIBKSTAT
202 disk_la_LDFLAGS += -lkstat
203 endif
204 if BUILD_WITH_LIBDEVINFO
205 disk_la_LDFLAGS += -ldevinfo
206 endif
207 if BUILD_WITH_LIBIOKIT
208 disk_la_LDFLAGS += -lIOKit
209 endif
210 if BUILD_WITH_LIBSTATGRAB
211 disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)  
212 disk_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
213 endif
214 collectd_LDADD += "-dlopen" disk.la
215 collectd_DEPENDENCIES += disk.la
216 endif
218 if BUILD_PLUGIN_DNS
219 pkglib_LTLIBRARIES += dns.la
220 dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
221 dns_la_LDFLAGS = -module -avoid-version -lpcap -lpthread
222 collectd_LDADD += "-dlopen" dns.la
223 collectd_DEPENDENCIES += dns.la
224 endif
226 if BUILD_PLUGIN_EMAIL
227 pkglib_LTLIBRARIES += email.la
228 email_la_SOURCES = email.c
229 email_la_LDFLAGS = -module -avoid-version
230 if BUILD_WITH_LIBPTHREAD
231 email_la_LDFLAGS += -lpthread
232 endif
233 collectd_LDADD += "-dlopen" email.la
234 collectd_DEPENDENCIES += email.la
235 endif
237 if BUILD_PLUGIN_ENTROPY
238 pkglib_LTLIBRARIES += entropy.la
239 entropy_la_SOURCES = entropy.c
240 entropy_la_LDFLAGS = -module -avoid-version
241 collectd_LDADD += "-dlopen" entropy.la
242 collectd_DEPENDENCIES += entropy.la
243 endif
245 if BUILD_PLUGIN_EXEC
246 pkglib_LTLIBRARIES += exec.la
247 exec_la_SOURCES = exec.c \
248                   utils_cmd_putnotif.c utils_cmd_putnotif.h \
249                   utils_cmd_putval.c utils_cmd_putval.h
250 exec_la_LDFLAGS = -module -avoid-version
251 if BUILD_WITH_LIBPTHREAD
252 exec_la_LDFLAGS += -lpthread
253 endif
254 collectd_LDADD += "-dlopen" exec.la
255 collectd_DEPENDENCIES += exec.la
256 endif
258 if BUILD_PLUGIN_HDDTEMP
259 pkglib_LTLIBRARIES += hddtemp.la
260 hddtemp_la_SOURCES = hddtemp.c
261 hddtemp_la_LDFLAGS = -module -avoid-version
262 if BUILD_WITH_LIBSOCKET
263 hddtemp_la_LDFLAGS += -lsocket
264 endif
265 collectd_LDADD += "-dlopen" hddtemp.la
266 collectd_DEPENDENCIES += hddtemp.la
267 endif
269 if BUILD_PLUGIN_INTERFACE
270 pkglib_LTLIBRARIES += interface.la
271 interface_la_SOURCES = interface.c
272 interface_la_CFLAGS = $(AM_CFLAGS)
273 interface_la_LDFLAGS = -module -avoid-version
274 interface_la_LIBADD =
275 collectd_LDADD += "-dlopen" interface.la
276 collectd_DEPENDENCIES += interface.la
277 if BUILD_WITH_LIBSTATGRAB
278 interface_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
279 interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
280 else
281 if BUILD_WITH_LIBKSTAT
282 interface_la_LDFLAGS += -lkstat
283 endif
284 if BUILD_WITH_LIBDEVINFO
285 interface_la_LDFLAGS += -ldevinfo
286 endif # BUILD_WITH_LIBDEVINFO
287 endif # !BUILD_WITH_LIBSTATGRAB
288 endif # BUILD_PLUGIN_INTERFACE
290 if BUILD_PLUGIN_IPTABLES
291 pkglib_LTLIBRARIES += iptables.la
292 iptables_la_SOURCES = iptables.c
293 iptables_la_LDFLAGS = -module -avoid-version
294 if BUILD_WITH_OWN_LIBIPTC
295 iptables_la_LIBADD  = libiptc/libiptc.la
296 iptables_la_DEPENDENCIES = libiptc/libiptc.la
297 else
298 iptables_la_LDFLAGS += -liptc
299 endif
300 collectd_LDADD += "-dlopen" iptables.la
301 collectd_DEPENDENCIES += iptables.la
302 endif
304 if BUILD_PLUGIN_IPMI
305 pkglib_LTLIBRARIES += ipmi.la
306 ipmi_la_SOURCES = ipmi.c
307 ipmi_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_OPENIPMI_CFLAGS)
308 ipmi_la_LDFLAGS = -module -avoid-version
309 ipmi_la_LIBADD = $(BUILD_WITH_OPENIPMI_LIBS)
310 collectd_LDADD += "-dlopen" ipmi.la
311 collectd_DEPENDENCIES += ipmi.la
312 endif
314 if BUILD_PLUGIN_IPVS
315 pkglib_LTLIBRARIES += ipvs.la
316 ipvs_la_SOURCES = ipvs.c
317 ipvs_la_CFLAGS = $(KERNEL_CFLAGS)
318 ipvs_la_LDFLAGS = -module -avoid-version
319 collectd_LDADD += "-dlopen" ipvs.la
320 collectd_DEPENDENCIES += ipvs.la
321 endif
323 if BUILD_PLUGIN_IRQ
324 pkglib_LTLIBRARIES += irq.la
325 irq_la_SOURCES = irq.c
326 irq_la_LDFLAGS = -module -avoid-version
327 collectd_LDADD += "-dlopen" irq.la
328 collectd_DEPENDENCIES += irq.la
329 endif
331 if BUILD_PLUGIN_LIBVIRT
332 pkglib_LTLIBRARIES += libvirt.la
333 libvirt_la_SOURCES = libvirt.c
334 libvirt_la_CFLAGS = $(AM_CFLAGS) \
335                 $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
336 libvirt_la_LIBADD = $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
337 libvirt_la_LDFLAGS = -module -avoid-version
338 collectd_LDADD += "-dlopen" libvirt.la
339 collectd_DEPENDENCIES += libvirt.la
340 endif
342 if BUILD_PLUGIN_LOAD
343 pkglib_LTLIBRARIES += load.la
344 load_la_SOURCES = load.c
345 load_la_CFLAGS = $(AM_CFLAGS)
346 load_la_LDFLAGS = -module -avoid-version
347 load_la_LIBADD =
348 collectd_LDADD += "-dlopen" load.la
349 collectd_DEPENDENCIES += load.la
350 if BUILD_WITH_LIBSTATGRAB
351 load_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
352 load_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
353 endif # BUILD_WITH_LIBSTATGRAB
354 endif # BUILD_PLUGIN_LOAD
356 if BUILD_PLUGIN_LOGFILE
357 pkglib_LTLIBRARIES += logfile.la
358 logfile_la_SOURCES = logfile.c
359 logfile_la_LDFLAGS = -module -avoid-version
360 collectd_LDADD += "-dlopen" logfile.la
361 collectd_DEPENDENCIES += logfile.la
362 endif
364 if BUILD_PLUGIN_MBMON
365 pkglib_LTLIBRARIES += mbmon.la
366 mbmon_la_SOURCES = mbmon.c
367 mbmon_la_LDFLAGS = -module -avoid-version
368 if BUILD_WITH_LIBSOCKET
369 mbmon_la_LDFLAGS += -lsocket
370 endif
371 collectd_LDADD += "-dlopen" mbmon.la
372 collectd_DEPENDENCIES += mbmon.la
373 endif
375 if BUILD_PLUGIN_MEMCACHED
376 pkglib_LTLIBRARIES += memcached.la
377 memcached_la_SOURCES = memcached.c
378 memcached_la_LDFLAGS = -module -avoid-version
379 memcached_la_LIBADD =
380 if BUILD_WITH_LIBSOCKET
381 memcached_la_LDFLAGS += -lsocket
382 endif
383 collectd_LDADD += "-dlopen" memcached.la
384 collectd_DEPENDENCIES += memcached.la
385 endif
387 if BUILD_PLUGIN_MEMORY
388 pkglib_LTLIBRARIES += memory.la
389 memory_la_SOURCES = memory.c
390 memory_la_CFLAGS = $(AM_CFLAGS)
391 memory_la_LDFLAGS = -module -avoid-version
392 memory_la_LIBADD =
393 collectd_LDADD += "-dlopen" memory.la
394 collectd_DEPENDENCIES += memory.la
395 if BUILD_WITH_LIBKSTAT
396 memory_la_LIBADD += -lkstat
397 endif
398 if BUILD_WITH_LIBDEVINFO
399 memory_la_LIBADD += -ldevinfo
400 endif
401 if BUILD_WITH_LIBSTATGRAB
402 memory_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
403 memory_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
404 endif
405 endif
407 if BUILD_PLUGIN_MULTIMETER
408 pkglib_LTLIBRARIES += multimeter.la
409 multimeter_la_SOURCES = multimeter.c
410 multimeter_la_LDFLAGS = -module -avoid-version
411 collectd_LDADD += "-dlopen" multimeter.la
412 collectd_DEPENDENCIES += multimeter.la
413 endif
415 if BUILD_PLUGIN_MYSQL
416 pkglib_LTLIBRARIES += mysql.la
417 mysql_la_SOURCES = mysql.c
418 mysql_la_LDFLAGS = -module -avoid-version
419 mysql_la_CFLAGS = $(AM_CFLAGS)
420 mysql_la_LIBADD =
421 collectd_LDADD += "-dlopen" mysql.la
422 if BUILD_WITH_LIBMYSQL
423 mysql_la_CFLAGS += $(BUILD_WITH_LIBMYSQL_CFLAGS)
424 mysql_la_LIBADD += $(BUILD_WITH_LIBMYSQL_LIBS)
425 endif
426 collectd_DEPENDENCIES += mysql.la
427 endif
429 if BUILD_PLUGIN_NETLINK
430 pkglib_LTLIBRARIES += netlink.la
431 netlink_la_SOURCES = netlink.c
432 netlink_la_LDFLAGS = -module -avoid-version
433 netlink_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBNETLINK_CFLAGS)
434 netlink_la_LIBADD = $(BUILD_WITH_LIBNETLINK_LIBS)
435 collectd_LDADD += "-dlopen" netlink.la
436 collectd_DEPENDENCIES += netlink.la
437 endif
439 if BUILD_PLUGIN_NETWORK
440 pkglib_LTLIBRARIES += network.la
441 network_la_SOURCES = network.c network.h
442 network_la_LDFLAGS = -module -avoid-version
443 if BUILD_WITH_LIBSOCKET
444 network_la_LDFLAGS += -lsocket
445 endif
446 if BUILD_WITH_LIBPTHREAD
447 network_la_LDFLAGS += -lpthread
448 endif
449 collectd_LDADD += "-dlopen" network.la
450 collectd_DEPENDENCIES += network.la
451 endif
453 if BUILD_PLUGIN_NFS
454 pkglib_LTLIBRARIES += nfs.la
455 nfs_la_SOURCES = nfs.c
456 nfs_la_LDFLAGS = -module -avoid-version
457 collectd_LDADD += "-dlopen" nfs.la
458 collectd_DEPENDENCIES += nfs.la
459 endif
461 if BUILD_PLUGIN_NGINX
462 pkglib_LTLIBRARIES += nginx.la
463 nginx_la_SOURCES = nginx.c
464 nginx_la_CFLAGS = $(AM_CFLAGS)
465 nginx_la_LIBADD =
466 nginx_la_LDFLAGS = -module -avoid-version
467 if BUILD_WITH_LIBCURL
468 nginx_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
469 nginx_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
470 endif
471 collectd_LDADD += "-dlopen" nginx.la
472 collectd_DEPENDENCIES += nginx.la
473 endif
475 if BUILD_PLUGIN_NOTIFY_DESKTOP
476 pkglib_LTLIBRARIES += notify_desktop.la
477 notify_desktop_la_SOURCES = notify_desktop.c
478 notify_desktop_la_CFLAGS = $(AM_CFLAGS) $(LIBNOTIFY_CFLAGS)
479 notify_desktop_la_LDFLAGS = -module -avoid-version $(LIBNOTIFY_LIBS)
480 collectd_LDADD += "-dlopen" notify_desktop.la
481 collectd_DEPENDENCIES += notify_desktop.la
482 endif
484 if BUILD_PLUGIN_NOTIFY_EMAIL
485 pkglib_LTLIBRARIES += notify_email.la
486 notify_email_la_SOURCES = notify_email.c
487 notify_email_la_LDFLAGS = -L/usr/local/lib -lesmtp -lssl -lcrypto -pthread -module -avoid-version
488 collectd_LDADD += "-dlopen" notify_email.la
489 collectd_DEPENDENCIES += notify_email.la
490 endif
492 if BUILD_PLUGIN_NTPD
493 pkglib_LTLIBRARIES += ntpd.la
494 ntpd_la_SOURCES = ntpd.c
495 ntpd_la_LDFLAGS = -module -avoid-version
496 if BUILD_WITH_LIBSOCKET
497 ntpd_la_LDFLAGS += -lsocket
498 endif
499 collectd_LDADD += "-dlopen" ntpd.la
500 collectd_DEPENDENCIES += ntpd.la
501 endif
503 if BUILD_PLUGIN_NUT
504 pkglib_LTLIBRARIES += nut.la
505 nut_la_SOURCES = nut.c
506 nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
507 nut_la_LDFLAGS = -module -avoid-version -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS)
508 collectd_LDADD += "-dlopen" nut.la
509 collectd_DEPENDENCIES += nut.la
510 endif
512 if BUILD_PLUGIN_ONEWIRE
513 pkglib_LTLIBRARIES += onewire.la
514 onewire_la_SOURCES = onewire.c
515 onewire_la_CFLAGS = $(AM_CFLAGS)
516 onewire_la_CPPFLAGS = $(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
517 onewire_la_LIBADD = $(BUILD_WITH_LIBOWCAPI_LIBS)
518 onewire_la_LDFLAGS = -module -avoid-version
519 collectd_LDADD += "-dlopen" onewire.la
520 collectd_DEPENDENCIES += onewire.la
521 endif
523 if BUILD_PLUGIN_PERL
524 pkglib_LTLIBRARIES += perl.la
525 perl_la_SOURCES = perl.c
526 # Despite C99 providing the "bool" type thru stdbool.h, Perl defines its own
527 # version of that type if HAS_BOOL is not defined... *sigh*
528 perl_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAS_BOOL=1
529 perl_la_CFLAGS  = $(AM_CFLAGS) \
530                 $(PERL_CFLAGS) \
531                 -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
532 perl_la_LDFLAGS = -module -avoid-version \
533                 $(PERL_LDFLAGS)
534 collectd_LDADD += "-dlopen" perl.la
535 collectd_DEPENDENCIES += perl.la
536 endif
538 if BUILD_PLUGIN_PING
539 pkglib_LTLIBRARIES += ping.la
540 ping_la_SOURCES = ping.c
541 ping_la_LDFLAGS = -module -avoid-version
542 if BUILD_WITH_OWN_LIBOPING
543 ping_la_LIBADD  = liboping/liboping.la
544 ping_la_DEPENDENCIES = liboping/liboping.la
545 else
546 ping_la_LDFLAGS += -loping
547 endif
548 collectd_LDADD += "-dlopen" ping.la
549 collectd_DEPENDENCIES += ping.la
550 endif
552 if BUILD_PLUGIN_POSTGRESQL
553 pkglib_LTLIBRARIES += postgresql.la
554 postgresql_la_SOURCES = postgresql.c
555 postgresql_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPQ_CPPFLAGS)
556 postgresql_la_LDFLAGS = -module -avoid-version \
557                 $(BUILD_WITH_LIBPQ_LDFLAGS) -lpq
558 collectd_LDADD += "-dlopen" postgresql.la
559 collectd_DEPENDENCIES += postgresql.la
560 endif
562 if BUILD_PLUGIN_POWERDNS
563 pkglib_LTLIBRARIES += powerdns.la
564 powerdns_la_SOURCES = powerdns.c
565 powerdns_la_LDFLAGS = -module -avoid-version
566 collectd_LDADD += "-dlopen" powerdns.la
567 collectd_DEPENDENCIES += powerdns.la
568 endif
570 if BUILD_PLUGIN_PROCESSES
571 pkglib_LTLIBRARIES += processes.la
572 processes_la_SOURCES = processes.c
573 processes_la_LDFLAGS = -module -avoid-version
574 processes_la_LIBADD =
575 collectd_LDADD += "-dlopen" processes.la
576 collectd_DEPENDENCIES += processes.la
577 if BUILD_WITH_LIBKVM_GETPROCS
578 processes_la_LIBADD += -lkvm
579 endif
580 endif
582 if BUILD_PLUGIN_QMAIL
583 pkglib_LTLIBRARIES += qmail.la
584 qmail_la_SOURCES = qmail.c
585 qmail_la_LDFLAGS = -module -avoid-version
586 collectd_LDADD += "-dlopen" qmail.la
587 collectd_DEPENDENCIES += qmail.la
588 endif
590 if BUILD_PLUGIN_RRDTOOL
591 pkglib_LTLIBRARIES += rrdtool.la
592 rrdtool_la_SOURCES = rrdtool.c
593 rrdtool_la_LDFLAGS = -module -avoid-version
594 rrdtool_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
595 rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
596 collectd_LDADD += "-dlopen" rrdtool.la
597 collectd_DEPENDENCIES += rrdtool.la
598 endif
600 if BUILD_PLUGIN_SENSORS
601 pkglib_LTLIBRARIES += sensors.la
602 sensors_la_SOURCES = sensors.c
603 sensors_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSENSORS_CFLAGS)
604 sensors_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBSENSORS_LDFLAGS)
605 sensors_la_LIBADD = -lsensors
606 collectd_LDADD += "-dlopen" sensors.la
607 collectd_DEPENDENCIES += sensors.la
608 endif
610 if BUILD_PLUGIN_SERIAL
611 pkglib_LTLIBRARIES += serial.la
612 serial_la_SOURCES = serial.c
613 serial_la_LDFLAGS = -module -avoid-version
614 collectd_LDADD += "-dlopen" serial.la
615 collectd_DEPENDENCIES += serial.la
616 endif
618 if BUILD_PLUGIN_SNMP
619 pkglib_LTLIBRARIES += snmp.la
620 snmp_la_SOURCES = snmp.c
621 snmp_la_LDFLAGS = -module -avoid-version
622 snmp_la_CFLAGS = $(AM_CFLAGS)
623 snmp_la_LIBADD =
624 if BUILD_WITH_LIBNETSNMP
625 snmp_la_CFLAGS += $(BUILD_WITH_LIBSNMP_CFLAGS)
626 snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS)
627 endif
628 if BUILD_WITH_LIBPTHREAD
629 snmp_la_LIBADD += -lpthread
630 endif
631 collectd_LDADD += "-dlopen" snmp.la
632 collectd_DEPENDENCIES += snmp.la
633 endif
635 if BUILD_PLUGIN_SWAP
636 pkglib_LTLIBRARIES += swap.la
637 swap_la_SOURCES = swap.c
638 swap_la_CFLAGS = $(AM_CFLAGS)
639 swap_la_LDFLAGS = -module -avoid-version
640 swap_la_LIBADD =
641 collectd_LDADD += "-dlopen" swap.la
642 collectd_DEPENDENCIES += swap.la
643 if BUILD_WITH_LIBKSTAT
644 swap_la_LIBADD += -lkstat
645 endif
646 if BUILD_WITH_LIBDEVINFO
647 swap_la_LIBADD += -ldevinfo
648 endif
649 if BUILD_WITH_LIBKVM_GETSWAPINFO
650 swap_la_LIBADD += -lkvm
651 endif
652 if BUILD_WITH_LIBSTATGRAB
653 swap_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
654 swap_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
655 endif
656 endif
658 if BUILD_PLUGIN_SYSLOG
659 pkglib_LTLIBRARIES += syslog.la
660 syslog_la_SOURCES = syslog.c
661 syslog_la_LDFLAGS = -module -avoid-version
662 collectd_LDADD += "-dlopen" syslog.la
663 collectd_DEPENDENCIES += syslog.la
664 endif
666 if BUILD_PLUGIN_TAIL
667 pkglib_LTLIBRARIES += tail.la
668 tail_la_SOURCES = tail.c
669 tail_la_LDFLAGS = -module -avoid-version
670 collectd_LDADD += "-dlopen" tail.la
671 collectd_DEPENDENCIES += tail.la
672 endif
674 if BUILD_PLUGIN_TAPE
675 pkglib_LTLIBRARIES += tape.la
676 tape_la_SOURCES = tape.c
677 tape_la_LDFLAGS = -module -avoid-version -lkstat -ldevinfo
678 collectd_LDADD += "-dlopen" tape.la
679 collectd_DEPENDENCIES += tape.la
680 endif
682 if BUILD_PLUGIN_TCPCONNS
683 pkglib_LTLIBRARIES += tcpconns.la
684 tcpconns_la_SOURCES = tcpconns.c
685 tcpconns_la_LDFLAGS = -module -avoid-version
686 collectd_LDADD += "-dlopen" tcpconns.la
687 collectd_DEPENDENCIES += tcpconns.la
688 endif
690 if BUILD_PLUGIN_TEAMSPEAK2
691 pkglib_LTLIBRARIES += teamspeak2.la
692 teamspeak2_la_SOURCES = teamspeak2.c
693 teamspeak2_la_LDFLAGS = -module -avoid-version
694 collectd_LDADD += "-dlopen" teamspeak2.la
695 collectd_DEPENDENCIES += teamspeak2.la
696 endif
698 if BUILD_PLUGIN_THERMAL
699 pkglib_LTLIBRARIES += thermal.la
700 thermal_la_SOURCES = thermal.c
701 thermal_la_LDFLAGS = -module -avoid-version
702 collectd_LDADD += "-dlopen" thermal.la
703 collectd_DEPENDENCIES += thermal.la
704 endif
706 if BUILD_PLUGIN_UNIXSOCK
707 pkglib_LTLIBRARIES += unixsock.la
708 unixsock_la_SOURCES = unixsock.c \
709                       utils_cmd_flush.h utils_cmd_flush.c \
710                       utils_cmd_getval.h utils_cmd_getval.c \
711                       utils_cmd_listval.h utils_cmd_listval.c \
712                       utils_cmd_putval.h utils_cmd_putval.c \
713                       utils_cmd_putnotif.h utils_cmd_putnotif.c
714 unixsock_la_LDFLAGS = -module -avoid-version -lpthread
715 collectd_LDADD += "-dlopen" unixsock.la
716 collectd_DEPENDENCIES += unixsock.la
717 endif
719 if BUILD_PLUGIN_USERS
720 pkglib_LTLIBRARIES += users.la
721 users_la_SOURCES = users.c
722 users_la_CFLAGS = $(AM_CFLAGS)
723 users_la_LDFLAGS = -module -avoid-version
724 users_la_LIBADD =
725 if BUILD_WITH_LIBSTATGRAB
726 users_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
727 users_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
728 endif
729 collectd_LDADD += "-dlopen" users.la
730 collectd_DEPENDENCIES += users.la
731 endif
733 if BUILD_PLUGIN_UUID
734 pkglib_LTLIBRARIES += uuid.la
735 uuid_la_SOURCES = uuid.c
736 uuid_la_CFLAGS  = $(BUILD_WITH_LIBHAL_CFLAGS)
737 uuid_la_LIBADD  = $(BUILD_WITH_LIBHAL_LIBS)
738 uuid_la_LDFLAGS = -module -avoid-version
739 collectd_LDADD += "-dlopen" uuid.la
740 collectd_DEPENDENCIES += uuid.la
741 endif
743 if BUILD_PLUGIN_VMEM
744 pkglib_LTLIBRARIES += vmem.la
745 vmem_la_SOURCES = vmem.c
746 vmem_la_LDFLAGS = -module -avoid-version
747 collectd_LDADD += "-dlopen" vmem.la
748 collectd_DEPENDENCIES += vmem.la
749 endif
751 if BUILD_PLUGIN_VSERVER
752 pkglib_LTLIBRARIES += vserver.la
753 vserver_la_SOURCES = vserver.c
754 vserver_la_LDFLAGS = -module -avoid-version
755 collectd_LDADD += "-dlopen" vserver.la
756 collectd_DEPENDENCIES += vserver.la
757 endif
759 if BUILD_PLUGIN_WIRELESS
760 pkglib_LTLIBRARIES += wireless.la
761 wireless_la_SOURCES = wireless.c
762 wireless_la_LDFLAGS = -module -avoid-version
763 collectd_LDADD += "-dlopen" wireless.la
764 collectd_DEPENDENCIES += wireless.la
765 endif
767 if BUILD_PLUGIN_XMMS
768 pkglib_LTLIBRARIES += xmms.la
769 xmms_la_SOURCES = xmms.c
770 xmms_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBXMMS_CFLAGS)
771 xmms_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBXMMS_LIBS)
772 collectd_LDADD += "-dlopen" xmms.la
773 collectd_DEPENDENCIES += xmms.la
774 endif
777 dist_man_MANS = collectd.1 collectd-nagios.1 collectd.conf.5 \
778                 collectd-email.5 collectd-exec.5 collectd-perl.5 \
779                 collectd-snmp.5 collectd-unixsock.5 collectdmon.1 \
780                 types.db.5
782 #collectd_1_SOURCES = collectd.pod
784 EXTRA_DIST = types.db
786 EXTRA_DIST += collectd-email.pod collectd-exec.pod collectd-nagios.pod \
787         collectd-perl.pod collectd-snmp.pod collectd-unixsock.pod \
788         collectd.conf.pod collectd.pod collectdmon.pod types.db.pod \
789         postgresql_default.conf
791 .pod.1:
792         pod2man --release=$(VERSION) --center=$(PACKAGE) $< >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
794 .pod.5:
795         pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
797 install-exec-hook:
798         $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
799         if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
800         then \
801                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
802         else \
803                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
804         fi; \
805         cp -f $(srcdir)/types.db $(DESTDIR)$(pkglibdir)/;
806         $(INSTALL) -D -m 0644 $(srcdir)/postgresql_default.conf \
807                 $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;