Code

build system: Don't (accidentally) clear the LDFLAGS when checking for libxml2 or...
[collectd.git] / src / Makefile.am
1 SUBDIRS =
2 if BUILD_WITH_OWN_LIBOCONFIG
3 SUBDIRS += liboconfig
4 endif
5 if BUILD_WITH_OWN_LIBOPING
6 SUBDIRS += liboping
7 endif
9 if COMPILER_IS_GCC
10 AM_CFLAGS = -Wall -Werror
11 endif
13 AM_CPPFLAGS = -DPREFIX='"${prefix}"'
14 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
15 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
16 AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
17 if BUILD_FEATURE_DAEMON
18 AM_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
19 endif
20 AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
22 sbin_PROGRAMS = collectd collectdmon
23 bin_PROGRAMS = collectd-nagios
25 collectd_SOURCES = collectd.c collectd.h \
26                    common.c common.h \
27                    configfile.c configfile.h \
28                    plugin.c plugin.h \
29                    utils_avltree.c utils_avltree.h \
30                    utils_cache.c utils_cache.h \
31                    utils_ignorelist.c utils_ignorelist.h \
32                    utils_llist.c utils_llist.h \
33                    utils_mount.c utils_mount.h \
34                    utils_threshold.c utils_threshold.h \
35                    types_list.c types_list.h
36 collectd_CPPFLAGS = $(LTDLINCL)
37 collectd_CPPFLAGS += $(AM_CPPFLAGS)
39 # Link to these libraries..
40 collectd_LDFLAGS = -export-dynamic
41 if BUILD_WITH_LIBRT
42 collectd_LDFLAGS += -lrt
43 endif
44 if BUILD_WITH_LIBSOCKET
45 collectd_LDFLAGS += -lsocket
46 endif
47 if BUILD_WITH_LIBRESOLV
48 collectd_LDFLAGS += -lresolv
49 endif
50 if BUILD_WITH_LIBPTHREAD
51 collectd_LDFLAGS += -lpthread
52 endif
53 if BUILD_WITH_LIBKSTAT
54 collectd_LDFLAGS += -lkstat
55 endif
56 if BUILD_WITH_LIBDEVINFO
57 collectd_LDFLAGS += -ldevinfo
58 endif
60 if BUILD_WITH_LIBSTATGRAB
61 if BUILD_WITH_LIBKVM
62 collectd_LDFLAGS += -lkvm
63 endif
64 if BUILD_WITH_LIBDEVSTAT
65 collectd_LDFLAGS += -ldevstat
66 endif
67 collectd_LDFLAGS += -lstatgrab
68 endif
71 collectd_LDADD =
72 collectd_DEPENDENCIES =
73 if BUILD_WITH_OWN_LIBOCONFIG
74 collectd_LDADD += $(LIBLTDL) liboconfig/liboconfig.la
75 collectd_DEPENDENCIES += $(LIBLTDL) liboconfig/liboconfig.la
76 else
77 collectd_LDFLAGS += -loconfig
78 endif
80 collectdmon_SOURCES = collectdmon.c
81 collectdmon_CPPFLAGS = $(AM_CPPFLAGS)
83 collectd_nagios_SOURCES = collectd-nagios.c
84 collectd_nagios_LDFLAGS =
85 if BUILD_WITH_LIBSOCKET
86 collectd_nagios_LDFLAGS += -lsocket
87 endif
89 pkglib_LTLIBRARIES = 
91 if BUILD_PLUGIN_APACHE
92 pkglib_LTLIBRARIES += apache.la
93 apache_la_SOURCES = apache.c
94 apache_la_LDFLAGS = -module -avoid-version
95 apache_la_CFLAGS =
96 apache_la_LIBADD =
97 collectd_LDADD += "-dlopen" apache.la
98 if BUILD_WITH_LIBCURL
99 apache_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
100 apache_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
101 endif
102 collectd_DEPENDENCIES += apache.la
103 endif
105 if BUILD_PLUGIN_APCUPS
106 pkglib_LTLIBRARIES += apcups.la
107 apcups_la_SOURCES = apcups.c
108 apcups_la_LDFLAGS = -module -avoid-version
109 if BUILD_WITH_LIBSOCKET
110 apcups_la_LDFLAGS += -lsocket
111 endif
112 collectd_LDADD += "-dlopen" apcups.la
113 collectd_DEPENDENCIES += apcups.la
114 endif
116 if BUILD_PLUGIN_APPLE_SENSORS
117 pkglib_LTLIBRARIES += apple_sensors.la
118 apple_sensors_la_SOURCES = apple_sensors.c
119 apple_sensors_la_LDFLAGS = -module -avoid-version -lIOKit
120 collectd_LDADD += "-dlopen" apple_sensors.la
121 collectd_DEPENDENCIES += apple_sensors.la
122 endif
124 if BUILD_PLUGIN_BATTERY
125 pkglib_LTLIBRARIES += battery.la
126 battery_la_SOURCES = battery.c
127 battery_la_LDFLAGS = -module -avoid-version
128 if BUILD_WITH_LIBIOKIT
129 battery_la_LDFLAGS += -lIOKit
130 endif
131 collectd_LDADD += "-dlopen" battery.la
132 collectd_DEPENDENCIES += battery.la
133 endif
135 if BUILD_PLUGIN_CPU
136 pkglib_LTLIBRARIES += cpu.la
137 cpu_la_SOURCES = cpu.c
138 cpu_la_LDFLAGS = -module -avoid-version
139 if BUILD_WITH_LIBKSTAT
140 cpu_la_LDFLAGS += -lkstat
141 endif
142 if BUILD_WITH_LIBDEVINFO
143 cpu_la_LDFLAGS += -ldevinfo
144 endif
145 collectd_LDADD += "-dlopen" cpu.la
146 collectd_DEPENDENCIES += cpu.la
147 endif
149 if BUILD_PLUGIN_CPUFREQ
150 pkglib_LTLIBRARIES += cpufreq.la
151 cpufreq_la_SOURCES = cpufreq.c
152 cpufreq_la_LDFLAGS = -module -avoid-version
153 collectd_LDADD += "-dlopen" cpufreq.la
154 collectd_DEPENDENCIES += cpufreq.la
155 endif
157 if BUILD_PLUGIN_CSV
158 pkglib_LTLIBRARIES += csv.la
159 csv_la_SOURCES = csv.c
160 csv_la_LDFLAGS = -module -avoid-version
161 collectd_LDADD += "-dlopen" csv.la
162 collectd_DEPENDENCIES += csv.la
163 endif
165 if BUILD_PLUGIN_DF
166 pkglib_LTLIBRARIES += df.la
167 df_la_SOURCES = df.c
168 df_la_LDFLAGS = -module -avoid-version
169 collectd_LDADD += "-dlopen" df.la
170 collectd_DEPENDENCIES += df.la
171 endif
173 if BUILD_PLUGIN_DISK
174 pkglib_LTLIBRARIES += disk.la
175 disk_la_SOURCES = disk.c
176 disk_la_LDFLAGS = -module -avoid-version
177 if BUILD_WITH_LIBKSTAT
178 disk_la_LDFLAGS += -lkstat
179 endif
180 if BUILD_WITH_LIBDEVINFO
181 disk_la_LDFLAGS += -ldevinfo
182 endif
183 if BUILD_WITH_LIBIOKIT
184 disk_la_LDFLAGS += -lIOKit
185 endif
186 collectd_LDADD += "-dlopen" disk.la
187 collectd_DEPENDENCIES += disk.la
188 endif
190 if BUILD_PLUGIN_DNS
191 pkglib_LTLIBRARIES += dns.la
192 dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
193 dns_la_LDFLAGS = -module -avoid-version -lpcap -lpthread
194 collectd_LDADD += "-dlopen" dns.la
195 collectd_DEPENDENCIES += dns.la
196 endif
198 if BUILD_PLUGIN_EMAIL
199 pkglib_LTLIBRARIES += email.la
200 email_la_SOURCES = email.c
201 email_la_LDFLAGS = -module -avoid-version
202 if BUILD_WITH_LIBPTHREAD
203 email_la_LDFLAGS += -lpthread
204 endif
205 collectd_LDADD += "-dlopen" email.la
206 collectd_DEPENDENCIES += email.la
207 endif
209 if BUILD_PLUGIN_ENTROPY
210 pkglib_LTLIBRARIES += entropy.la
211 entropy_la_SOURCES = entropy.c
212 entropy_la_LDFLAGS = -module -avoid-version
213 collectd_LDADD += "-dlopen" entropy.la
214 collectd_DEPENDENCIES += entropy.la
215 endif
217 if BUILD_PLUGIN_EXEC
218 pkglib_LTLIBRARIES += exec.la
219 exec_la_SOURCES = exec.c \
220                   utils_cmd_putnotif.c utils_cmd_putnotif.h \
221                   utils_cmd_putval.c utils_cmd_putval.h
222 exec_la_LDFLAGS = -module -avoid-version
223 if BUILD_WITH_LIBPTHREAD
224 exec_la_LDFLAGS += -lpthread
225 endif
226 collectd_LDADD += "-dlopen" exec.la
227 collectd_DEPENDENCIES += exec.la
228 endif
230 if BUILD_PLUGIN_HDDTEMP
231 pkglib_LTLIBRARIES += hddtemp.la
232 hddtemp_la_SOURCES = hddtemp.c
233 hddtemp_la_LDFLAGS = -module -avoid-version
234 if BUILD_WITH_LIBSOCKET
235 hddtemp_la_LDFLAGS += -lsocket
236 endif
237 collectd_LDADD += "-dlopen" hddtemp.la
238 collectd_DEPENDENCIES += hddtemp.la
239 endif
241 if BUILD_PLUGIN_INTERFACE
242 pkglib_LTLIBRARIES += interface.la
243 interface_la_SOURCES = interface.c
244 interface_la_LDFLAGS = -module -avoid-version
245 collectd_LDADD += "-dlopen" interface.la
246 collectd_DEPENDENCIES += interface.la
247 if BUILD_WITH_LIBKSTAT
248 interface_la_LDFLAGS += -lkstat
249 endif
250 if BUILD_WITH_LIBDEVINFO
251 interface_la_LDFLAGS += -ldevinfo
252 endif
253 if BUILD_WITH_LIBSTATGRAB
254 if BUILD_WITH_LIBKVM
255 interface_la_LDFLAGS += -lkvm
256 endif
257 if BUILD_WITH_LIBDEVSTAT
258 interface_la_LDFLAGS += -ldevstat
259 endif
260 interface_la_LDFLAGS += -lstatgrab
261 endif
262 endif
264 if BUILD_PLUGIN_IPTABLES
265 pkglib_LTLIBRARIES += iptables.la
266 iptables_la_SOURCES = iptables.c
267 iptables_la_LDFLAGS = -module -avoid-version -liptc
268 collectd_LDADD += "-dlopen" iptables.la
269 collectd_DEPENDENCIES += iptables.la
270 endif
272 if BUILD_PLUGIN_IPVS
273 pkglib_LTLIBRARIES += ipvs.la
274 ipvs_la_SOURCES = ipvs.c
275 ipvs_la_LDFLAGS = -module -avoid-version
276 collectd_LDADD += "-dlopen" ipvs.la
277 collectd_DEPENDENCIES += ipvs.la
278 endif
280 if BUILD_PLUGIN_IRQ
281 pkglib_LTLIBRARIES += irq.la
282 irq_la_SOURCES = irq.c
283 irq_la_LDFLAGS = -module -avoid-version
284 collectd_LDADD += "-dlopen" irq.la
285 collectd_DEPENDENCIES += irq.la
286 endif
288 if BUILD_PLUGIN_LIBVIRT
289 pkglib_LTLIBRARIES += libvirt.la
290 libvirt_la_SOURCES = libvirt.c
291 libvirt_la_CFLAGS = $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
292 libvirt_la_LIBADD = $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
293 libvirt_la_LDFLAGS = -module -avoid-version
294 collectd_LDADD += "-dlopen" libvirt.la
295 collectd_DEPENDENCIES += libvirt.la
296 endif
298 if BUILD_PLUGIN_LOAD
299 pkglib_LTLIBRARIES += load.la
300 load_la_SOURCES = load.c
301 load_la_LDFLAGS = -module -avoid-version
302 collectd_LDADD += "-dlopen" load.la
303 collectd_DEPENDENCIES += load.la
304 if BUILD_WITH_LIBSTATGRAB
305 if BUILD_WITH_LIBKVM
306 load_la_LDFLAGS += -lkvm
307 endif
308 if BUILD_WITH_LIBDEVSTAT
309 load_la_LDFLAGS += -ldevstat
310 endif
311 load_la_LDFLAGS += -lstatgrab
312 endif
313 endif
315 if BUILD_PLUGIN_LOGFILE
316 pkglib_LTLIBRARIES += logfile.la
317 logfile_la_SOURCES = logfile.c
318 logfile_la_LDFLAGS = -module -avoid-version
319 collectd_LDADD += "-dlopen" logfile.la
320 collectd_DEPENDENCIES += logfile.la
321 endif
323 if BUILD_PLUGIN_MBMON
324 pkglib_LTLIBRARIES += mbmon.la
325 mbmon_la_SOURCES = mbmon.c
326 mbmon_la_LDFLAGS = -module -avoid-version
327 if BUILD_WITH_LIBSOCKET
328 mbmon_la_LDFLAGS += -lsocket
329 endif
330 collectd_LDADD += "-dlopen" mbmon.la
331 collectd_DEPENDENCIES += mbmon.la
332 endif
334 if BUILD_PLUGIN_MEMCACHED
335 pkglib_LTLIBRARIES += memcached.la
336 memcached_la_SOURCES = memcached.c
337 memcached_la_LDFLAGS = -module -avoid-version
338 memcached_la_CFLAGS =
339 memcached_la_LIBADD =
340 if BUILD_WITH_LIBSOCKET
341 memcached_la_LDFLAGS += -lsocket
342 endif
343 collectd_LDADD += "-dlopen" memcached.la
344 collectd_DEPENDENCIES += memcached.la
345 endif
347 if BUILD_PLUGIN_MEMORY
348 pkglib_LTLIBRARIES += memory.la
349 memory_la_SOURCES = memory.c
350 memory_la_LDFLAGS = -module -avoid-version
351 collectd_LDADD += "-dlopen" memory.la
352 collectd_DEPENDENCIES += memory.la
353 if BUILD_WITH_LIBKSTAT
354 memory_la_LDFLAGS += -lkstat
355 endif
356 if BUILD_WITH_LIBDEVINFO
357 memory_la_LDFLAGS += -ldevinfo
358 endif
359 if BUILD_WITH_LIBSTATGRAB
360 if BUILD_WITH_LIBKVM
361 memory_la_LDFLAGS += -lkvm
362 endif
363 if BUILD_WITH_LIBDEVSTAT
364 memory_la_LDFLAGS += -ldevstat
365 endif
366 memory_la_LDFLAGS += -lstatgrab
367 endif
368 endif
370 if BUILD_PLUGIN_MULTIMETER
371 pkglib_LTLIBRARIES += multimeter.la
372 multimeter_la_SOURCES = multimeter.c
373 multimeter_la_LDFLAGS = -module -avoid-version
374 collectd_LDADD += "-dlopen" multimeter.la
375 collectd_DEPENDENCIES += multimeter.la
376 endif
378 if BUILD_PLUGIN_MYSQL
379 pkglib_LTLIBRARIES += mysql.la
380 mysql_la_SOURCES = mysql.c
381 mysql_la_LDFLAGS = -module -avoid-version
382 mysql_la_CFLAGS =
383 mysql_la_LIBADD =
384 collectd_LDADD += "-dlopen" mysql.la
385 if BUILD_WITH_LIBMYSQL
386 mysql_la_CFLAGS += $(BUILD_WITH_LIBMYSQL_CFLAGS)
387 mysql_la_LIBADD += $(BUILD_WITH_LIBMYSQL_LIBS)
388 endif
389 collectd_DEPENDENCIES += mysql.la
390 endif
392 if BUILD_PLUGIN_NETLINK
393 pkglib_LTLIBRARIES += netlink.la
394 netlink_la_SOURCES = netlink.c
395 netlink_la_LDFLAGS = -module -avoid-version
396 netlink_la_CFLAGS = $(BUILD_WITH_LIBNETLINK_CFLAGS)
397 netlink_la_LIBADD = $(BUILD_WITH_LIBNETLINK_LIBS)
398 collectd_LDADD += "-dlopen" netlink.la
399 collectd_DEPENDENCIES += netlink.la
400 endif
402 if BUILD_PLUGIN_NETWORK
403 pkglib_LTLIBRARIES += network.la
404 network_la_SOURCES = network.c network.h
405 network_la_LDFLAGS = -module -avoid-version
406 if BUILD_WITH_LIBSOCKET
407 network_la_LDFLAGS += -lsocket
408 endif
409 if BUILD_WITH_LIBPTHREAD
410 network_la_LDFLAGS += -lpthread
411 endif
412 collectd_LDADD += "-dlopen" network.la
413 collectd_DEPENDENCIES += network.la
414 endif
416 if BUILD_PLUGIN_NFS
417 pkglib_LTLIBRARIES += nfs.la
418 nfs_la_SOURCES = nfs.c
419 nfs_la_LDFLAGS = -module -avoid-version
420 collectd_LDADD += "-dlopen" nfs.la
421 collectd_DEPENDENCIES += nfs.la
422 endif
424 if BUILD_PLUGIN_NGINX
425 pkglib_LTLIBRARIES += nginx.la
426 nginx_la_SOURCES = nginx.c
427 nginx_la_CFLAGS = $(AM_CFLAGS)
428 nginx_la_LIBADD =
429 nginx_la_LDFLAGS = -module -avoid-version
430 if BUILD_WITH_LIBCURL
431 nginx_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
432 nginx_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
433 endif
434 collectd_LDADD += "-dlopen" nginx.la
435 collectd_DEPENDENCIES += nginx.la
436 endif
438 if BUILD_PLUGIN_NTPD
439 pkglib_LTLIBRARIES += ntpd.la
440 ntpd_la_SOURCES = ntpd.c
441 ntpd_la_LDFLAGS = -module -avoid-version
442 if BUILD_WITH_LIBSOCKET
443 ntpd_la_LDFLAGS += -lsocket
444 endif
445 collectd_LDADD += "-dlopen" ntpd.la
446 collectd_DEPENDENCIES += ntpd.la
447 endif
449 if BUILD_PLUGIN_NUT
450 pkglib_LTLIBRARIES += nut.la
451 nut_la_SOURCES = nut.c
452 nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
453 nut_la_LDFLAGS = -module -avoid-version -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS)
454 collectd_LDADD += "-dlopen" nut.la
455 collectd_DEPENDENCIES += nut.la
456 endif
458 if BUILD_PLUGIN_PERL
459 pkglib_LTLIBRARIES += perl.la
460 perl_la_SOURCES = perl.c
461 perl_la_CFLAGS  = $(AM_CFLAGS) \
462                   $(PERL_CFLAGS) \
463                   -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
464 perl_la_LDFLAGS = -module -avoid-version \
465                   $(PERL_LDFLAGS)
466 collectd_LDADD += "-dlopen" perl.la
467 collectd_DEPENDENCIES += perl.la
468 endif
470 if BUILD_PLUGIN_PING
471 pkglib_LTLIBRARIES += ping.la
472 ping_la_SOURCES = ping.c
473 ping_la_LDFLAGS = -module -avoid-version
474 if BUILD_WITH_OWN_LIBOPING
475 ping_la_LIBADD  = liboping/liboping.la
476 ping_la_DEPENDENCIES = liboping/liboping.la
477 else
478 ping_la_LDFLAGS += -loping
479 endif
480 collectd_LDADD += "-dlopen" ping.la
481 collectd_DEPENDENCIES += ping.la
482 endif
484 if BUILD_PLUGIN_PROCESSES
485 pkglib_LTLIBRARIES += processes.la
486 processes_la_SOURCES = processes.c
487 processes_la_LDFLAGS = -module -avoid-version
488 collectd_LDADD += "-dlopen" processes.la
489 collectd_DEPENDENCIES += processes.la
490 endif
492 if BUILD_PLUGIN_RRDTOOL
493 pkglib_LTLIBRARIES += rrdtool.la
494 rrdtool_la_SOURCES = rrdtool.c
495 rrdtool_la_LDFLAGS = -module -avoid-version
496 rrdtool_la_CFLAGS = $(BUILD_WITH_LIBRRD_CFLAGS)
497 rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
498 collectd_LDADD += "-dlopen" rrdtool.la
499 collectd_DEPENDENCIES += rrdtool.la
500 endif
502 if BUILD_PLUGIN_SENSORS
503 pkglib_LTLIBRARIES += sensors.la
504 sensors_la_SOURCES = sensors.c
505 sensors_la_CFLAGS = $(BUILD_WITH_LIBSENSORS_CFLAGS)
506 sensors_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBSENSORS_LDFLAGS)
507 sensors_la_LIBADD = -lsensors
508 collectd_LDADD += "-dlopen" sensors.la
509 collectd_DEPENDENCIES += sensors.la
510 endif
512 if BUILD_PLUGIN_SERIAL
513 pkglib_LTLIBRARIES += serial.la
514 serial_la_SOURCES = serial.c
515 serial_la_LDFLAGS = -module -avoid-version
516 collectd_LDADD += "-dlopen" serial.la
517 collectd_DEPENDENCIES += serial.la
518 endif
520 if BUILD_PLUGIN_SNMP
521 pkglib_LTLIBRARIES += snmp.la
522 snmp_la_SOURCES = snmp.c
523 snmp_la_LDFLAGS = -module -avoid-version
524 snmp_la_CFLAGS =
525 snmp_la_LIBADD =
526 if BUILD_WITH_LIBNETSNMP
527 snmp_la_CFLAGS += $(BUILD_WITH_LIBSNMP_CFLAGS)
528 snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS)
529 endif
530 if BUILD_WITH_LIBPTHREAD
531 snmp_la_LIBADD += -lpthread
532 endif
533 collectd_LDADD += "-dlopen" snmp.la
534 collectd_DEPENDENCIES += snmp.la
535 endif
537 if BUILD_PLUGIN_SWAP
538 pkglib_LTLIBRARIES += swap.la
539 swap_la_SOURCES = swap.c
540 swap_la_LDFLAGS = -module -avoid-version
541 collectd_LDADD += "-dlopen" swap.la
542 collectd_DEPENDENCIES += swap.la
543 if BUILD_WITH_LIBKSTAT
544 swap_la_LDFLAGS += -lkstat
545 endif
546 if BUILD_WITH_LIBDEVINFO
547 swap_la_LDFLAGS += -ldevinfo
548 endif
549 if BUILD_WITH_LIBKVM
550 swap_la_LDFLAGS += -lkvm
551 endif
552 if BUILD_WITH_LIBSTATGRAB
553 if BUILD_WITH_LIBDEVSTAT
554 swap_la_LDFLAGS += -ldevstat
555 endif
556 swap_la_LDFLAGS += -lstatgrab
557 endif
558 endif
560 if BUILD_PLUGIN_SYSLOG
561 pkglib_LTLIBRARIES += syslog.la
562 syslog_la_SOURCES = syslog.c
563 syslog_la_LDFLAGS = -module -avoid-version
564 collectd_LDADD += "-dlopen" syslog.la
565 collectd_DEPENDENCIES += syslog.la
566 endif
568 if BUILD_PLUGIN_TAPE
569 pkglib_LTLIBRARIES += tape.la
570 tape_la_SOURCES = tape.c
571 tape_la_LDFLAGS = -module -avoid-version -lkstat -ldevinfo
572 collectd_LDADD += "-dlopen" tape.la
573 collectd_DEPENDENCIES += tape.la
574 endif
576 if BUILD_PLUGIN_TCPCONNS
577 pkglib_LTLIBRARIES += tcpconns.la
578 tcpconns_la_SOURCES = tcpconns.c
579 tcpconns_la_LDFLAGS = -module -avoid-version
580 collectd_LDADD += "-dlopen" tcpconns.la
581 collectd_DEPENDENCIES += tcpconns.la
582 endif
584 if BUILD_PLUGIN_UNIXSOCK
585 pkglib_LTLIBRARIES += unixsock.la
586 unixsock_la_SOURCES = unixsock.c utils_cmd_putval.h utils_cmd_putval.c utils_cmd_putnotif.h utils_cmd_putnotif.c
587 unixsock_la_LDFLAGS = -module -avoid-version -lpthread
588 collectd_LDADD += "-dlopen" unixsock.la
589 collectd_DEPENDENCIES += unixsock.la
590 endif
592 if BUILD_PLUGIN_USERS
593 pkglib_LTLIBRARIES += users.la
594 users_la_SOURCES = users.c
595 users_la_LDFLAGS = -module -avoid-version
596 collectd_LDADD += "-dlopen" users.la
597 collectd_DEPENDENCIES += users.la
598 endif
600 if BUILD_PLUGIN_UUID
601 pkglib_LTLIBRARIES += uuid.la
602 uuid_la_SOURCES = uuid.c
603 uuid_la_CFLAGS  = $(BUILD_WITH_LIBHAL_CFLAGS)
604 uuid_la_LIBADD  = $(BUILD_WITH_LIBHAL_LIBS)
605 uuid_la_LDFLAGS = -module -avoid-version
606 collectd_LDADD += "-dlopen" uuid.la
607 collectd_DEPENDENCIES += uuid.la
608 endif
610 if BUILD_PLUGIN_VSERVER
611 pkglib_LTLIBRARIES += vserver.la
612 vserver_la_SOURCES = vserver.c
613 vserver_la_LDFLAGS = -module -avoid-version
614 collectd_LDADD += "-dlopen" vserver.la
615 collectd_DEPENDENCIES += vserver.la
616 endif
618 if BUILD_PLUGIN_WIRELESS
619 pkglib_LTLIBRARIES += wireless.la
620 wireless_la_SOURCES = wireless.c
621 wireless_la_LDFLAGS = -module -avoid-version
622 collectd_LDADD += "-dlopen" wireless.la
623 collectd_DEPENDENCIES += wireless.la
624 endif
626 if BUILD_PLUGIN_XMMS
627 pkglib_LTLIBRARIES += xmms.la
628 xmms_la_SOURCES = xmms.c
629 xmms_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBXMMS_CFLAGS)
630 xmms_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBXMMS_LIBS)
631 collectd_LDADD += "-dlopen" xmms.la
632 collectd_DEPENDENCIES += xmms.la
633 endif
636 dist_man_MANS = collectd.1 collectd-nagios.1 collectd.conf.5 \
637                 collectd-email.5 collectd-exec.5 collectd-perl.5 \
638                 collectd-snmp.5 collectd-unixsock.5 collectdmon.1 \
639                 types.db.5
641 #collectd_1_SOURCES = collectd.pod
643 EXTRA_DIST = types.db
645 EXTRA_DIST += collectd-email.pod collectd-exec.pod collectd-nagios.pod \
646         collectd-perl.pod collectd-snmp.pod collectd-unixsock.pod \
647         collectd.conf.pod collectd.pod collectdmon.pod types.db.pod
649 .pod.1:
650         pod2man --release=$(VERSION) --center=$(PACKAGE) $< >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
652 .pod.5:
653         pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
655 install-exec-hook:
656         $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
657         if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
658         then \
659                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
660         else \
661                 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
662         fi; \
663         cp -f $(srcdir)/types.db $(DESTDIR)$(pkglibdir)/;