1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
8 AC_PREFIX_DEFAULT("/opt/collectd")
13 # Checks for programs.
20 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
24 AC_LIBLTDL_CONVENIENCE
31 AC_CONFIG_SUBDIRS(libltdl)
33 AC_MSG_CHECKING([for kernel type ($host_os)])
36 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
40 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
49 AC_MSG_RESULT([$ac_system])
52 # Checks for header files.
58 AC_CHECK_HEADERS(stdint.h stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h)
61 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
66 # include <sys/types.h>
69 AC_CHECK_HEADERS(netinet/in.h, [], [],
74 # include <sys/types.h>
76 #if HAVE_NETINET_IN_SYSTM_H
77 # include <netinet/in_systm.h>
80 AC_CHECK_HEADERS(netinet/ip.h, [], [],
85 # include <sys/types.h>
87 #if HAVE_NETINET_IN_SYSTM_H
88 # include <netinet/in_systm.h>
91 # include <netinet/in.h>
94 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
99 # include <sys/types.h>
101 #if HAVE_NETINET_IN_SYSTM_H
102 # include <netinet/in_systm.h>
104 #if HAVE_NETINET_IN_H
105 # include <netinet/in.h>
107 #if HAVE_NETINET_IP_H
108 # include <netinet/ip.h>
111 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
116 # include <sys/types.h>
118 #if HAVE_NETINET_IN_SYSTM_H
119 # include <netinet/in_systm.h>
121 #if HAVE_NETINET_IN_H
122 # include <netinet/in.h>
124 #if HAVE_NETINET_IP_H
125 # include <netinet/ip.h>
128 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
133 # include <sys/types.h>
135 #if HAVE_NETINET_IN_SYSTM_H
136 # include <netinet/in_systm.h>
138 #if HAVE_NETINET_IN_H
139 # include <netinet/in.h>
142 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
147 # include <sys/types.h>
149 #if HAVE_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
152 #if HAVE_NETINET_IN_H
153 # include <netinet/in.h>
155 #if HAVE_NETINET_IP6_H
156 # include <netinet/ip6.h>
159 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
164 # include <sys/types.h>
166 #if HAVE_NETINET_IN_SYSTM_H
167 # include <netinet/in_systm.h>
169 #if HAVE_NETINET_IN_H
170 # include <netinet/in.h>
172 #if HAVE_NETINET_IP_H
173 # include <netinet/ip.h>
176 AC_CHECK_HEADERS(netinet/udp.h, [], [],
181 # include <sys/types.h>
183 #if HAVE_NETINET_IN_SYSTM_H
184 # include <netinet/in_systm.h>
186 #if HAVE_NETINET_IN_H
187 # include <netinet/in.h>
189 #if HAVE_NETINET_IP_H
190 # include <netinet/ip.h>
195 AC_CHECK_HEADERS(sys/dkstat.h)
196 if test "x$ac_system" = "xDarwin"
198 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
199 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
201 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
204 # include <sys/types.h>
207 # include <sys/param.h>
212 AC_CHECK_HEADERS(linux/major.h libgen.h)
214 # For the battery plugin
215 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
217 #if HAVE_IOKIT_IOKITLIB_H
218 # include <IOKit/IOKitLib.h>
220 #if HAVE_IOKIT_IOTYPES_H
221 # include <IOKit/IOTypes.h>
225 # For the swap module
226 AC_CHECK_HEADERS(sys/swap.h, [], [],
229 # include <sys/types.h>
232 # include <sys/param.h>
237 # For the processes plugin
239 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
241 # For interface plugin
242 AC_CHECK_HEADERS(ifaddrs.h)
243 AC_CHECK_HEADERS(net/if.h, [], [],
246 # include <sys/types.h>
248 #if HAVE_SYS_SOCKET_H
249 # include <sys/socket.h>
252 AC_CHECK_HEADERS(linux/if.h, [], [],
255 # include <sys/types.h>
257 #if HAVE_SYS_SOCKET_H
258 # include <sys/socket.h>
261 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
264 # include <sys/types.h>
266 #if HAVE_SYS_SOCKET_H
267 # include <sys/socket.h>
270 # include <linux/if.h>
275 AC_CHECK_HEADERS(sys/ucred.h, [], [],
278 # include <sys/types.h>
281 # include <sys/param.h>
285 # For mount interface
286 AC_CHECK_HEADERS(sys/mount.h, [], [],
289 # include <sys/types.h>
292 # include <sys/param.h>
296 # For the email plugin
297 AC_CHECK_HEADERS(linux/un.h, [], [],
299 #if HAVE_SYS_SOCKET_H
300 # include <sys/socket.h>
304 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h)
307 AC_CHECK_HEADERS(arpa/nameser.h)
308 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
310 #if HAVE_ARPA_NAMESER_H
311 # include <arpa/nameser.h>
315 AC_CHECK_HEADERS(net/if_arp.h, [], [],
316 [#if HAVE_SYS_SOCKET_H
317 # include <sys/socket.h>
320 AC_CHECK_HEADERS(net/ppp_defs.h)
321 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
322 [#if HAVE_NET_PPP_DEFS_H
323 # include <net/ppp_defs.h>
326 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
331 # include <sys/types.h>
333 #if HAVE_SYS_SOCKET_H
334 # include <sys/socket.h>
339 #if HAVE_NETINET_IN_H
340 # include <netinet/in.h>
344 # For the multimeter plugin
346 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
349 # Checking for libraries
354 # Checks for typedefs, structures, and compiler characteristics.
363 # Checks for library functions.
365 AC_PROG_GCC_TRADITIONAL
366 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog)
370 AC_CHECK_FUNCS(getpwnam_r)
371 AC_CHECK_FUNCS(getgrnam_r)
373 socket_needs_socket="no"
374 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
375 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
377 nanosleep_needs_rt="no"
378 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
379 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
381 AC_CHECK_FUNCS(regcomp regerror regexec regfree)
383 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
384 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
385 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
386 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
387 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
388 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
389 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
390 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
391 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
392 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
395 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
398 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
400 if test "x$withval" = "xno"; then
402 else if test "x$withval" = "xyes"; then
409 if test "x$nan_type" = "xnone"; then
410 AC_CACHE_CHECK([whether NAN is defined by default],
417 static float foo = NAN;
425 [have_nan_default="yes"],
426 [have_nan_default="no"]
429 if test "x$have_nan_default" = "xyes"
434 if test "x$nan_type" = "xnone"; then
435 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
441 #define __USE_ISOC99 1
443 static float foo = NAN;
451 [have_nan_isoc="yes"],
455 if test "x$have_nan_isoc" = "xyes"
460 if test "x$nan_type" = "xnone"; then
461 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
471 #define NAN (0.0 / 0.0)
473 # define isnan(f) ((f) != (f))
475 static float foo = NAN;
483 [have_nan_zero="yes"],
487 if test "x$have_nan_zero" = "xyes"
493 if test "x$nan_type" = "xdefault"; then
494 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
495 [Define if NAN is defined by default and can initialize static variables.])
496 else if test "x$nan_type" = "xisoc99"; then
497 AC_DEFINE(NAN_STATIC_ISOC, 1,
498 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
499 else if test "x$nan_type" = "xzero"; then
500 AC_DEFINE(NAN_ZERO_ZERO, 1,
501 [Define if NAN can be defined as (0.0 / 0.0)])
503 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
506 # For mount interface
507 #AC_CHECK_FUNCS(getfsent getvfsent)
510 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
512 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
514 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
517 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
518 if test "x$have_getmntent" = "xno"; then
519 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
521 if test "x$have_getmntent" = "xno"; then
522 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
524 if test "x$have_getmntent" = "xno"; then
525 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
528 if test "x$have_getmntent" = "xc"; then
529 AC_CACHE_CHECK([whether getmntent takes one argument],
530 [have_one_getmntent],
532 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
534 #include "$srcdir/src/utils_mount.h"]],
538 fh = setmntent ("/etc/mtab", "r");
542 [have_one_getmntent="yes"],
543 [have_one_getmntent="no"]
546 AC_CACHE_CHECK([whether getmntent takes two arguments],
547 [have_two_getmntent],
549 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
550 #include <sys/mnttab.h>
551 #include "$srcdir/src/utils_mount.h"]],
556 fh = fopen ("/etc/mnttab", "r");
557 status = getmntent (fh, &mt);
560 [have_two_getmntent="yes"],
561 [have_two_getmntent="no"]
566 # Check for different versions of `getmntent' here..
568 if test "x$have_getmntent" = "xc"; then
569 if test "x$have_one_getmntent" = "xyes"; then
570 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
571 [Define if the function getmntent exists and takes one argument.])
573 if test "x$have_two_getmntent" = "xyes"; then
574 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
575 [Define if the function getmntent exists and takes two arguments.])
578 if test "x$have_getmntent" = "xsun"; then
579 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
580 [Define if the function getmntent exists. It's the version from libsun.])
582 if test "x$have_getmntent" = "xseq"; then
583 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
584 [Define if the function getmntent exists. It's the version from libseq.])
586 if test "x$have_getmntent" = "xgen"; then
587 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
588 [Define if the function getmntent exists. It's the version from libgen.])
591 # Check for structures
592 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
593 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
596 #include <sys/types.h>
597 #include <sys/socket.h>
600 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
601 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
604 #include <sys/types.h>
605 #include <sys/socket.h>
606 #include <linux/if.h>
607 #include <linux/netdevice.h>
610 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
615 # include <sys/types.h>
617 #if HAVE_NETINET_IN_SYSTM_H
618 # include <netinet/in_systm.h>
620 #if HAVE_NETINET_IN_H
621 # include <netinet/in.h>
623 #if HAVE_NETINET_IP_H
624 # include <netinet/ip.h>
626 #if HAVE_NETINET_UDP_H
627 # include <netinet/udp.h>
630 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
635 # include <sys/types.h>
637 #if HAVE_NETINET_IN_SYSTM_H
638 # include <netinet/in_systm.h>
640 #if HAVE_NETINET_IN_H
641 # include <netinet/in.h>
643 #if HAVE_NETINET_IP_H
644 # include <netinet/ip.h>
646 #if HAVE_NETINET_UDP_H
647 # include <netinet/udp.h>
651 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
661 AC_CHECK_LIB(resolv, res_search,
663 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
665 [with_libresolv="no"])
666 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
669 m4_divert_once([HELP_WITH], [
670 collectd additional packages:])
672 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
673 AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to rrdtool.])],
674 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
676 LDFLAGS="$LDFLAGS -L$withval/lib"
677 CPPFLAGS="$CPPFLAGS -I$withval/include"
680 ], [with_rrdtool="yes"])
681 if test "x$with_rrdtool" = "xyes"
683 AC_CHECK_LIB(rrd, rrd_update,
685 AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
687 [with_rrdtool="no (librrd not found)"], [-lm])
689 if test "x$with_rrdtool" = "xyes"
691 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
693 if test "x$with_rrdtool" = "xyes"
699 AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool],
700 [Wether or not to use rrdtool library])
701 AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes")
703 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
704 [ if test "x$withval" != "xno" -a "x$withval" != "xyes"
706 LDFLAGS="$LDFLAGS -L$withval/lib"
707 CPPFLAGS="$CPPFLAGS -I$withval/include"
708 with_libpthread="yes"
710 if test "x$withval" = "xno"
712 with_libpthread="no (disabled)"
715 ], [with_libpthread="yes"])
716 if test "x$with_libpthread" = "xyes"
718 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
720 if test "x$with_libpthread" = "xyes"
722 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
724 if test "x$with_libpthread" = "xyes"
730 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
731 [Wether or not to use pthread (POSIX threads) library])
732 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
734 if test "x$ac_system" = "xSolaris"
739 with_kstat="no (Solaris only)"
740 with_devinfo="no (Solaris only)"
743 if test "x$with_kstat" = "xyes"
745 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
747 if test "x$with_kstat" = "xyes"
749 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
750 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
752 if test "x$with_kstat" = "xyes"
754 AC_DEFINE(HAVE_LIBKSTAT, 1,
755 [Define to 1 if you have the 'kstat' library (-lkstat)])
757 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
758 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
760 ### BEGIN of check for libcurl ###
761 with_curl_config="curl-config"
764 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
766 if test "x$withval" = "xno"
769 else if test "x$withval" = "xyes"
773 if test -f "$withval" && test -x "$withval"
775 with_curl_config="$withval"
777 else if test -x "$withval/bin/curl-config"
779 with_curl_config="$withval/bin/curl-config"
788 if test "x$with_libcurl" = "xyes"
790 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
791 curl_config_status=$?
793 if test $curl_config_status -ne 0
795 with_libcurl="no ($with_curl_config failed)"
798 CFLAGS="$CFLAGS $with_curl_cflags"
800 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
802 CFLAGS="$SAVE_CFLAGS"
805 if test "x$with_libcurl" = "xyes"
807 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
808 curl_config_status=$?
810 if test $curl_config_status -ne 0
812 with_libcurl="no ($with_curl_config failed)"
814 AC_CHECK_LIB(curl, curl_easy_init,
815 [with_libcurl="yes"],
816 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
820 if test "x$with_libcurl" = "xyes"
822 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
823 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
824 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
825 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
827 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
828 ### END of check for libcurl ###
832 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
841 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
842 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
844 with_libstatgrab="yes"
846 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
848 if test "x$withval" != "xno" -a "x$withval" != "xyes"
850 LDFLAGS="$LDFLAGS -L$withval/lib"
851 CPPFLAGS="$CPPFLAGS -I$withval/include"
852 with_libstatgrab="yes"
856 if test "x$ac_system" == "xunknown"
858 with_libstatgrab="yes"
860 with_libstatgrab="no"
863 if test "x$with_libstatgrab" = "xyes"
865 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
867 if test "x$with_libstatgrab" = "xyes"
869 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
871 if test "x$with_libstatgrab" = "xyes"
873 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
875 if test "x$with_libstatgrab" = "xyes"
877 collect_libstatgrab=1
879 collect_libstatgrab=0
881 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
882 [Wether or not to use statgrab library])
883 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
884 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
886 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
887 if test "x$with_libkvm" = "xyes"
889 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
891 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
893 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
895 if test "x$withval" != "xno" && test "x$withval" != "xyes"
897 LDFLAGS="$LDFLAGS -L$withval/lib"
898 CPPFLAGS="$CPPFLAGS -I$withval/include"
899 with_lm_sensors="yes"
903 if test "x$ac_system" = "xLinux"
905 with_lm_sensors="yes"
907 with_lm_sensors="no (Linux only library)"
910 if test "x$with_lm_sensors" = "xyes"
912 AC_CHECK_LIB(sensors, sensors_init,
914 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
916 [with_lm_sensors="no (libsensors not found)"])
918 if test "x$with_lm_sensors" = "xyes"
920 AC_CHECK_HEADERS(sensors/sensors.h,
922 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
924 [with_lm_sensors="no (sensors/sensors.h not found)"])
926 if test "x$with_lm_sensors" = "xyes"
932 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
933 [Wether or not to use sensors library])
934 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
936 with_mysql_config="mysql_config"
939 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
941 if test "x$withval" = "xno"
944 else if test "x$withval" = "xyes"
948 if test -f "$withval" && test -x "$withval";
950 with_mysql_config="$withval"
951 else if test -x "$withval/bin/mysql_config"
953 with_mysql_config="$withval/bin/mysql_config"
961 if test "x$with_libmysql" = "xyes"
963 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
964 mysql_config_status=$?
966 if test $mysql_config_status -ne 0
971 CFLAGS="$CFLAGS $with_mysql_cflags"
973 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
975 CFLAGS="$SAVE_CFLAGS"
978 if test "x$with_libmysql" = "xyes"
980 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
981 mysql_config_status=$?
983 if test $mysql_config_status -ne 0
987 AC_CHECK_LIB(mysqlclient, mysql_init,
988 [with_libmysql="yes"],
989 [with_libmysql="no (symbol 'mysql_init' not found)"],
993 if test "x$with_libmysql" = "xyes"
995 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
996 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
997 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
998 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1000 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1002 with_own_liboconfig="no"
1003 liboconfig_LDFLAGS="$LDFLAGS"
1004 liboconfig_CPPFLAGS="$CPPFLAGS"
1005 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1007 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1009 if test -d "$withval/lib"
1011 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1013 if test -d "$withval/include"
1015 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1018 if test "x$withval" = "xno"
1020 AC_MSG_ERROR("liboconfig is required")
1024 with_liboconfig="yes"
1027 save_LDFLAGS="$LDFLAGS"
1028 save_CPPFLAGS="$CPPFLAGS"
1029 LDFLAGS="$liboconfig_LDFLAGS"
1030 CPPFLAGS="$liboconfig_CPPFLAGS"
1031 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1033 with_liboconfig="yes"
1034 with_own_liboconfig="no"
1037 with_liboconfig="yes"
1038 with_own_liboconfig="yes"
1039 LDFLAGS="$save_LDFLAGS"
1040 CPPFLAGS="$save_CPPFLAGS"
1043 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1044 if test "x$with_own_liboconfig" = "xyes"
1046 with_liboconfig="yes (shipped version)"
1049 #with_liboping="yes"
1050 with_own_liboping="no"
1051 liboping_LDFLAGS="$LDFLAGS"
1052 liboping_CPPFLAGS="$CPPFLAGS"
1053 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1055 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1057 if test -d "$withval/lib"
1059 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1061 if test -d "$withval/include"
1063 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1066 if test "x$withval" = "xno"
1069 with_own_liboping="no"
1077 if test "x$with_liboping" = "xyes"
1079 save_LDFLAGS="$LDFLAGS"
1080 save_CPPFLAGS="$CPPFLAGS"
1081 LDFLAGS="$liboping_LDFLAGS"
1082 CPPFLAGS="$liboping_CPPFLAGS"
1083 AC_CHECK_LIB(oping, ping_construct,
1086 with_own_liboping="no"
1090 with_own_liboping="yes"
1091 LDFLAGS="$save_LDFLAGS"
1092 CPPFLAGS="$save_CPPFLAGS"
1095 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1096 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1098 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1100 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1102 LDFLAGS="$LDFLAGS -L$withval/lib"
1103 CPPFLAGS="$CPPFLAGS -I$withval/include"
1110 if test "x$with_libpcap" = "xyes"
1112 AC_CHECK_LIB(pcap, pcap_open_live,
1114 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1115 ], [with_libpcap="no (libpcap not found)"])
1117 if test "x$with_libpcap" = "xyes"
1119 AC_CHECK_HEADERS(pcap.h,
1121 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1122 ], [with_libpcap="no (pcap.h not found)"])
1124 if test "x$with_libpcap" = "xyes"
1130 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1131 [Wether or not to use the pcap library])
1132 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1134 perl_interpreter="perl"
1135 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1137 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1139 LDFLAGS="$LDFLAGS -L$withval/lib"
1140 CPPFLAGS="$CPPFLAGS -I$withval/include"
1141 perl_interpreter="$withval/bin/perl"
1149 AC_SUBST(PERL, "$perl_interpreter")
1151 if test "x$with_libperl" = "xyes"
1154 SAVE_LDFLAGS=$LDFLAGS
1155 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1156 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1157 CFLAGS="$CFLAGS $PERL_CFLAGS"
1158 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1160 AC_CACHE_CHECK([for libperl],
1170 PerlInterpreter *perl = NULL;
1171 Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1172 newSVpv ("Collectd::Plugin::FooBar", 24),
1175 [have_libperl="yes"],
1180 if test "x$have_libperl" = "xyes"
1182 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1183 AC_SUBST(PERL_CFLAGS)
1184 AC_SUBST(PERL_LDFLAGS)
1190 LDFLAGS=$SAVE_LDFLAGS
1192 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1194 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1196 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1198 LDFLAGS="$LDFLAGS -L$withval/lib"
1199 CPPFLAGS="$CPPFLAGS -I$withval/include"
1204 if test "x$ac_system" = "xLinux"
1208 with_libiptc="no (Linux only)"
1211 if test "x$with_libiptc" = "xyes"
1213 AC_CHECK_LIB(iptc, iptc_init,
1215 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1216 ], [with_libiptc="no (libiptc not found)"])
1218 if test "x$with_libiptc" = "xyes"
1220 AC_CHECK_HEADERS(libiptc/libiptc.h,
1222 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1223 ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1225 if test "x$with_libiptc" = "xyes"
1231 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1233 with_snmp_config="net-snmp-config"
1236 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1238 if test "x$withval" = "xno"
1240 with_libnetsnmp="no"
1241 else if "x$withval" = "xyes"
1243 with_libnetsnmp="yes"
1245 if test -x "$withval"
1247 with_snmp_config="$withval"
1248 with_libnetsnmp="yes"
1250 with_snmp_config="$withval/bin/net-snmp-config"
1251 with_libnetsnmp="yes"
1255 [with_libnetsnmp="yes"])
1256 if test "x$with_libnetsnmp" = "xyes"
1258 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1259 snmp_config_status=$?
1261 if test $snmp_config_status -ne 0
1263 with_libnetsnmp="no ($with_snmp_config failed)"
1266 CFLAGS="$CFLAGS $with_snmp_cflags"
1268 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1270 CFLAGS="$SAVE_CFLAGS"
1273 if test "x$with_libnetsnmp" = "xyes"
1275 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1276 snmp_config_status=$?
1278 if test $snmp_config_status -ne 0
1280 with_libnetsnmp="no ($with_snmp_config failed)"
1282 AC_CHECK_LIB(netsnmp, init_snmp,
1283 [with_libnetsnmp="yes"],
1284 [with_libnetsnmp="no (libnetsnmp not found)"],
1288 if test "x$with_libnetsnmp" = "xyes"
1290 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1291 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1292 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1293 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1295 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1297 with_upsclient_config="libupsclient-config"
1298 with_upsclient_cflags=""
1299 with_upsclient_libs=""
1300 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1302 if test "x$withval" = "xno"
1304 with_libupsclient="no"
1306 if test "x$withval" != "xyes"
1308 if test -f "$withval" && test -x "$withval";
1310 with_upsclient_config="$withval"
1312 with_upsclient_config="$withval/bin/libupsclient-config"
1315 with_libupsclient="yes"
1319 with_libupsclient="yes"
1321 if test "x$with_libupsclient" = "xyes"
1323 with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1324 upsclient_config_status=$?
1326 if test $upsclient_config_status -ne 0
1328 with_libupsclient="no ($with_upsclient_config failed)"
1331 if test "x$with_libupsclient" = "xyes"
1333 SAVE_CFLAGS="$CFLAGS"
1334 CFLAGS="$CFLAGS $with_upsclient_cflags"
1336 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1338 CFLAGS="$SAVE_CFLAGS"
1340 if test "x$with_libupsclient" = "xyes"
1342 with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1343 upsclient_config_status=$?
1345 if test $upsclient_config_status -ne 0
1347 with_libupsclient="no ($with_upsclient_config failed)"
1350 if test "x$with_libupsclient" = "xyes"
1352 AC_CHECK_LIB(upsclient, upscli_connect,
1354 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1355 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1356 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1357 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1360 with_libupsclient="no (symbol 'upscli_connect' not found)"
1361 ], [$with_upsclient_libs])
1363 if test "x$with_libupsclient" = "xyes"
1365 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1366 [#include <stdlib.h>
1368 #include <upsclient.h>])
1370 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1372 ### BEGIN of check for libxmms ###
1373 with_xmms_config="xmms-config"
1376 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1378 if test "x$withval" != "xno" -a "x$withval" != "xyes"
1380 if test -f "$withval" && test -x "$withval";
1382 with_xmms_config="$withval"
1383 else if test -x "$withval/bin/xmms-config"
1385 with_xmms_config="$withval/bin/xmms-config"
1388 else if test "x$withval" = "xno"
1398 if test "x$with_libxmms" = "xyes"
1400 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1401 xmms_config_status=$?
1403 if test $xmms_config_status -ne 0
1408 if test "x$with_libxmms" = "xyes"
1410 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1411 xmms_config_status=$?
1413 if test $xmms_config_status -ne 0
1418 if test "x$with_libxmms" = "xyes"
1420 AC_CHECK_LIB(xmms, xmms_remote_get_info,
1422 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1423 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1424 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1425 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1432 with_libxmms_numeric=0
1433 if test "x$with_libxmms" = "xyes"
1435 with_libxmms_numeric=1
1437 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1438 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1439 ### END of check for libxmms ###
1441 with_libnetlink_cflags=""
1442 with_libnetlink_libs="-lnetlink"
1443 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1445 echo "libnetlink: withval = $withval"
1446 if test "x$withval" = "xyes"
1448 with_libnetlink="yes"
1449 else if test "x$withval" = "xno"
1451 with_libnetlink="no"
1453 if test -d "$withval/include"
1455 with_libnetlink_cflags="-I$withval/include"
1456 with_libnetlink_libs="-L$withval/lib -lnetlink"
1457 with_libnetlink="yes"
1459 AC_MSG_ERROR("no such directory: $withval/include")
1464 if test "x$ac_system" = "xLinux"
1466 with_libnetlink="yes"
1468 with_libnetlink="no (Linux only library)"
1471 if test "x$with_libnetlink" = "xyes"
1474 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1476 with_libnetlink="no (libnetlink.h not found)"
1478 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1480 with_libnetlink="yes"
1484 #include <sys/types.h>
1485 #include <asm/types.h>
1486 #include <sys/socket.h>
1487 #include <linux/netlink.h>
1488 #include <linux/rtnetlink.h>])
1489 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1491 #include <sys/types.h>
1492 #include <asm/types.h>
1493 #include <sys/socket.h>])
1497 #include <sys/types.h>
1498 #include <asm/types.h>
1499 #include <sys/socket.h>
1500 #include <linux/netlink.h>
1501 #include <linux/rtnetlink.h>
1505 int retval = TCA_STATS2;
1508 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1513 #include <sys/types.h>
1514 #include <asm/types.h>
1515 #include <sys/socket.h>
1516 #include <linux/netlink.h>
1517 #include <linux/rtnetlink.h>
1521 int retval = TCA_STATS;
1524 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1527 CFLAGS="$SAVE_CFLAGS"
1529 if test "x$with_libnetlink" = "xyes"
1531 AC_CHECK_LIB(netlink, rtnl_open,
1532 [with_libnetlink="yes"],
1533 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1534 [$with_libnetlink_libs])
1536 if test "x$with_libnetlink" = "xyes"
1538 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1539 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1540 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1541 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1543 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1545 # Check for enabled/disabled features
1548 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1549 # ------------------------------------------------------------
1551 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1556 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1561 m4_define([EnDis],[disabled])dnl
1562 m4_define([YesNo],[no])dnl
1568 m4_define([EnDis],[enabled])dnl
1569 m4_define([YesNo],[yes])dnl
1572 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1576 m4_if([$3], [feature], [],
1580 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1586 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1588 enable_$1='[YesNo]'dnl
1590 if test "x$enable_$1" = "xno"
1594 if test "x$enable_$1" = "xyes"
1598 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1603 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1604 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1606 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1608 # AC_PLUGIN(name, default, info)
1609 # ------------------------------------------------------------
1615 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
1617 if test "x$enableval" = "xyes"
1625 if test "x$2" = "xyes"
1632 if test "x$enable_plugin" = "xyes"
1634 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
1636 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
1637 enable_$1="$enable_plugin"
1639 )# AC_PLUGIN(name, default, info)
1641 m4_divert_once([HELP_ENABLE], [
1642 collectd features:])
1643 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
1644 AC_COLLECTD([debug], [enable], [feature], [debugging])
1645 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
1646 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
1654 plugin_interface="no"
1658 plugin_multimeter="no"
1660 plugin_processes="no"
1666 plugin_wireless="no"
1669 if test "x$ac_system" = "xLinux"
1671 plugin_battery="yes"
1673 plugin_cpufreq="yes"
1675 plugin_entropy="yes"
1676 plugin_interface="yes"
1681 plugin_processes="yes"
1684 plugin_vserver="yes"
1685 plugin_wireless="yes"
1689 if test "x$with_libiokit" = "xyes"
1691 plugin_battery="yes"
1696 if test "x$with_devinfo$with_kstat" = "xyesyes"
1700 plugin_interface="yes"
1707 if test "x$with_libstatgrab" = "xyes"
1709 plugin_interface="yes"
1715 if test "x$have_processor_info" = "xyes"
1719 if test "x$have_sysctlbyname" = "xyes"
1725 if test "x$have_statfs" = "xyes"
1729 if test "x$have_statvfs" = "xyes"
1734 if test "x$have_getifaddrs" = "xyes"
1736 plugin_interface="yes"
1739 if test "x$have_getloadavg" = "xyes"
1744 # Mac OS X memory interface
1745 if test "x$have_host_statistics" = "xyes"
1750 if test "x$have_termios_h" = "xyes"
1752 plugin_multimeter="yes"
1755 if test "x$have_thread_info" = "xyes"
1757 plugin_processes="yes"
1760 if test "x$with_libkvm" = "xyes"
1765 if test "x$have_getutent" = "xyes"
1769 if test "x$have_getutxent" = "xyes"
1774 # FIXME: sysctl for swap plugin
1776 m4_divert_once([HELP_ENABLE], [
1779 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
1780 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
1781 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
1782 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
1783 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
1784 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
1785 AC_PLUGIN([csv], [yes], [CSV output plugin])
1786 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
1787 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
1788 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
1789 AC_PLUGIN([email], [yes], [EMail statistics])
1790 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
1791 AC_PLUGIN([exec], [yes], [Execution of external programs])
1792 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
1793 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
1794 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
1795 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
1796 AC_PLUGIN([load], [$plugin_load], [System load])
1797 AC_PLUGIN([logfile], [yes], [File logging plugin])
1798 AC_PLUGIN([mbmon], [yes], [Query mbmond])
1799 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
1800 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
1801 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
1802 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
1803 AC_PLUGIN([network], [yes], [Network communication plugin])
1804 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
1805 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
1806 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
1807 AC_PLUGIN([perl], [$with_libperl], [Embed a Perl interpreter])
1808 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
1809 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
1810 AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
1811 AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
1812 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
1813 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
1814 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
1815 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
1816 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
1817 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
1818 AC_PLUGIN([users], [$plugin_users], [User statistics])
1819 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
1820 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
1821 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
1824 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
1826 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1828 PERL_BINDINGS_OPTIONS="$withval"
1829 with_perl_bindings="yes"
1833 PERL_BINDINGS_OPTIONS=""
1834 with_perl_bindings="yes"
1836 if test "x$with_perl_bindings" = "xyes"
1838 PERL_BINDINGS="perl"
1842 AC_SUBST(PERL_BINDINGS)
1843 AC_SUBST(PERL_BINDINGS_OPTIONS)
1845 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
1847 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
1849 with_liboping="yes (shipped version)"
1852 if test "x$with_libperl" = "xyes"
1854 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
1856 enable_perl="no (needs libperl)"
1859 if test "x$with_perl_bindings" = "xyes" -a "x$PERL_BINDINGS_OPTIONS" != "x"
1861 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
1868 libcurl . . . . . . $with_libcurl
1869 libiokit . . . . . $with_libiokit
1870 libiptc . . . . . . $with_libiptc
1871 libkstat . . . . . $with_kstat
1872 libkvm . . . . . . $with_libkvm
1873 libmysql . . . . . $with_libmysql
1874 libnetlink . . . . $with_libnetlink
1875 libnetsnmp . . . . $with_libnetsnmp
1876 liboconfig . . . . $with_liboconfig
1877 liboping . . . . . $with_liboping
1878 libpcap . . . . . . $with_libpcap
1879 libperl . . . . . . $with_libperl
1880 libpthread . . . . $with_libpthread
1881 librrd . . . . . . $with_rrdtool
1882 libsensors . . . . $with_lm_sensors
1883 libstatgrab . . . . $with_libstatgrab
1884 libupsclient . . . $with_libupsclient
1885 libxmms . . . . . . $with_libxmms
1888 daemon mode . . . . $enable_daemon
1889 debug . . . . . . . $enable_debug
1892 perl . . . . . . . $with_perl_bindings
1895 apache . . . . . . $enable_apache
1896 apcups . . . . . . $enable_apcups
1897 apple_sensors . . . $enable_apple_sensors
1898 battery . . . . . . $enable_battery
1899 cpu . . . . . . . . $enable_cpu
1900 cpufreq . . . . . . $enable_cpufreq
1901 csv . . . . . . . . $enable_csv
1902 df . . . . . . . . $enable_df
1903 disk . . . . . . . $enable_disk
1904 dns . . . . . . . . $enable_dns
1905 email . . . . . . . $enable_email
1906 entropy . . . . . . $enable_entropy
1907 exec . . . . . . . $enable_exec
1908 hddtemp . . . . . . $enable_hddtemp
1909 interface . . . . . $enable_interface
1910 iptables . . . . . $enable_iptables
1911 irq . . . . . . . . $enable_irq
1912 load . . . . . . . $enable_load
1913 logfile . . . . . . $enable_logfile
1914 mbmon . . . . . . . $enable_mbmon
1915 memory . . . . . . $enable_memory
1916 multimeter . . . . $enable_multimeter
1917 mysql . . . . . . . $enable_mysql
1918 netlink . . . . . . $enable_netlink
1919 network . . . . . . $enable_network
1920 nfs . . . . . . . . $enable_nfs
1921 ntpd . . . . . . . $enable_ntpd
1922 nut . . . . . . . . $enable_nut
1923 perl . . . . . . . $enable_perl
1924 ping . . . . . . . $enable_ping
1925 processes . . . . . $enable_processes
1926 sensors . . . . . . $enable_sensors
1927 serial . . . . . . $enable_serial
1928 snmp . . . . . . . $enable_snmp
1929 swap . . . . . . . $enable_swap
1930 syslog . . . . . . $enable_syslog
1931 tape . . . . . . . $enable_tape
1932 unixsock . . . . . $enable_unixsock
1933 users . . . . . . . $enable_users
1934 vserver . . . . . . $enable_vserver
1935 wireless . . . . . $enable_wireless
1936 xmms . . . . . . . $enable_xmms