Code

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