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 getgrnam_r setgroups regcomp regerror regexec regfree)
372 socket_needs_socket="no"
373 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
374 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
376 nanosleep_needs_rt="no"
377 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
378 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
380 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
381 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
382 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
383 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
384 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
385 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
386 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
387 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
388 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
389 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
392 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
395 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
397 if test "x$withval" = "xno"; then
399 else if test "x$withval" = "xyes"; then
406 if test "x$nan_type" = "xnone"; then
407 AC_CACHE_CHECK([whether NAN is defined by default],
414 static float foo = NAN;
422 [have_nan_default="yes"],
423 [have_nan_default="no"]
426 if test "x$have_nan_default" = "xyes"
431 if test "x$nan_type" = "xnone"; then
432 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
438 #define __USE_ISOC99 1
440 static float foo = NAN;
448 [have_nan_isoc="yes"],
452 if test "x$have_nan_isoc" = "xyes"
457 if test "x$nan_type" = "xnone"; then
458 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
468 #define NAN (0.0 / 0.0)
470 # define isnan(f) ((f) != (f))
472 static float foo = NAN;
480 [have_nan_zero="yes"],
484 if test "x$have_nan_zero" = "xyes"
490 if test "x$nan_type" = "xdefault"; then
491 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
492 [Define if NAN is defined by default and can initialize static variables.])
493 else if test "x$nan_type" = "xisoc99"; then
494 AC_DEFINE(NAN_STATIC_ISOC, 1,
495 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
496 else if test "x$nan_type" = "xzero"; then
497 AC_DEFINE(NAN_ZERO_ZERO, 1,
498 [Define if NAN can be defined as (0.0 / 0.0)])
500 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
503 # For mount interface
504 #AC_CHECK_FUNCS(getfsent getvfsent)
507 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
509 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
511 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
514 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
515 if test "x$have_getmntent" = "xno"; then
516 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
518 if test "x$have_getmntent" = "xno"; then
519 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
521 if test "x$have_getmntent" = "xno"; then
522 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
525 if test "x$have_getmntent" = "xc"; then
526 AC_CACHE_CHECK([whether getmntent takes one argument],
527 [have_one_getmntent],
529 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
531 #include "$srcdir/src/utils_mount.h"]],
535 fh = setmntent ("/etc/mtab", "r");
539 [have_one_getmntent="yes"],
540 [have_one_getmntent="no"]
543 AC_CACHE_CHECK([whether getmntent takes two arguments],
544 [have_two_getmntent],
546 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
547 #include <sys/mnttab.h>
548 #include "$srcdir/src/utils_mount.h"]],
553 fh = fopen ("/etc/mnttab", "r");
554 status = getmntent (fh, &mt);
557 [have_two_getmntent="yes"],
558 [have_two_getmntent="no"]
563 # Check for different versions of `getmntent' here..
565 if test "x$have_getmntent" = "xc"; then
566 if test "x$have_one_getmntent" = "xyes"; then
567 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
568 [Define if the function getmntent exists and takes one argument.])
570 if test "x$have_two_getmntent" = "xyes"; then
571 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
572 [Define if the function getmntent exists and takes two arguments.])
575 if test "x$have_getmntent" = "xsun"; then
576 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
577 [Define if the function getmntent exists. It's the version from libsun.])
579 if test "x$have_getmntent" = "xseq"; then
580 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
581 [Define if the function getmntent exists. It's the version from libseq.])
583 if test "x$have_getmntent" = "xgen"; then
584 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
585 [Define if the function getmntent exists. It's the version from libgen.])
588 # Check for structures
589 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
590 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
593 #include <sys/types.h>
594 #include <sys/socket.h>
597 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
598 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
601 #include <sys/types.h>
602 #include <sys/socket.h>
603 #include <linux/if.h>
604 #include <linux/netdevice.h>
607 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
612 # include <sys/types.h>
614 #if HAVE_NETINET_IN_SYSTM_H
615 # include <netinet/in_systm.h>
617 #if HAVE_NETINET_IN_H
618 # include <netinet/in.h>
620 #if HAVE_NETINET_IP_H
621 # include <netinet/ip.h>
623 #if HAVE_NETINET_UDP_H
624 # include <netinet/udp.h>
627 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
632 # include <sys/types.h>
634 #if HAVE_NETINET_IN_SYSTM_H
635 # include <netinet/in_systm.h>
637 #if HAVE_NETINET_IN_H
638 # include <netinet/in.h>
640 #if HAVE_NETINET_IP_H
641 # include <netinet/ip.h>
643 #if HAVE_NETINET_UDP_H
644 # include <netinet/udp.h>
648 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
658 AC_CHECK_LIB(resolv, res_search,
660 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
662 [with_libresolv="no"])
663 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
666 m4_divert_once([HELP_WITH], [
667 collectd additional packages:])
669 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
672 librrd_threadsafe="yes"
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 librrd_cflags="-I$withval/include"
677 librrd_ldflags="-L$withval/lib"
680 ], [with_rrdtool="yes"])
681 if test "x$with_rrdtool" = "xyes"
683 SAVE_CPPFLAGS="$CPPFLAGS"
684 SAVE_LDFLAGS="$LDFLAGS"
686 CPPFLAGS="$CPPFLAGS $librrd_cflags"
687 LDFLAGS="$LDFLAGS $librrd_ldflags"
689 AC_CHECK_HEADERS(rrd.h,, [with_rrdtool="no (rrd.h not found)"])
691 CPPFLAGS="$SAVE_CPPFLAGS"
692 LDFLAGS="$SAVE_LDFLAGS"
694 if test "x$with_rrdtool" = "xyes"
696 SAVE_CPPFLAGS="$CPPFLAGS"
697 SAVE_LDFLAGS="$LDFLAGS"
699 CPPFLAGS="$CPPFLAGS $librrd_cflags"
700 LDFLAGS="$LDFLAGS $librrd_ldflags"
702 AC_CHECK_LIB(rrd_th, rrd_update_r,
704 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
706 [librrd_threadsafe="no"
707 AC_CHECK_LIB(rrd, rrd_update,
709 librrd_ldflags="$librrd_ldflags -lrrd -lm"
711 [with_rrdtool="no (symbol 'rrd_update' not found)"],
716 CPPFLAGS="$SAVE_CPPFLAGS"
717 LDFLAGS="$SAVE_LDFLAGS"
719 if test "x$with_rrdtool" = "xyes"
721 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
722 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
723 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
724 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
726 if test "x$librrd_threadsafe" = "xyes"
728 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
731 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
732 [ if test "x$withval" != "xno" -a "x$withval" != "xyes"
734 LDFLAGS="$LDFLAGS -L$withval/lib"
735 CPPFLAGS="$CPPFLAGS -I$withval/include"
736 with_libpthread="yes"
738 if test "x$withval" = "xno"
740 with_libpthread="no (disabled)"
743 ], [with_libpthread="yes"])
744 if test "x$with_libpthread" = "xyes"
746 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
748 if test "x$with_libpthread" = "xyes"
750 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
752 if test "x$with_libpthread" = "xyes"
758 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
759 [Wether or not to use pthread (POSIX threads) library])
760 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
762 if test "x$ac_system" = "xSolaris"
767 with_kstat="no (Solaris only)"
768 with_devinfo="no (Solaris only)"
771 if test "x$with_kstat" = "xyes"
773 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
775 if test "x$with_kstat" = "xyes"
777 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
778 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
780 if test "x$with_kstat" = "xyes"
782 AC_DEFINE(HAVE_LIBKSTAT, 1,
783 [Define to 1 if you have the 'kstat' library (-lkstat)])
785 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
786 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
788 ### BEGIN of check for libcurl ###
789 with_curl_config="curl-config"
792 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
794 if test "x$withval" = "xno"
797 else if test "x$withval" = "xyes"
801 if test -f "$withval" && test -x "$withval"
803 with_curl_config="$withval"
805 else if test -x "$withval/bin/curl-config"
807 with_curl_config="$withval/bin/curl-config"
816 if test "x$with_libcurl" = "xyes"
818 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
819 curl_config_status=$?
821 if test $curl_config_status -ne 0
823 with_libcurl="no ($with_curl_config failed)"
826 CFLAGS="$CFLAGS $with_curl_cflags"
828 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
830 CFLAGS="$SAVE_CFLAGS"
833 if test "x$with_libcurl" = "xyes"
835 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
836 curl_config_status=$?
838 if test $curl_config_status -ne 0
840 with_libcurl="no ($with_curl_config failed)"
842 AC_CHECK_LIB(curl, curl_easy_init,
843 [with_libcurl="yes"],
844 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
848 if test "x$with_libcurl" = "xyes"
850 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
851 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
852 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
853 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
855 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
856 ### END of check for libcurl ###
860 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
869 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
870 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
872 with_libstatgrab="yes"
874 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
876 if test "x$withval" != "xno" -a "x$withval" != "xyes"
878 LDFLAGS="$LDFLAGS -L$withval/lib"
879 CPPFLAGS="$CPPFLAGS -I$withval/include"
880 with_libstatgrab="yes"
884 if test "x$ac_system" == "xunknown"
886 with_libstatgrab="yes"
888 with_libstatgrab="no"
891 if test "x$with_libstatgrab" = "xyes"
893 AC_CHECK_LIB(statgrab, sg_init, [with_libstatgrab="yes"], [with_libstatgrab="no (libstatgrab not found)"])
895 if test "x$with_libstatgrab" = "xyes"
897 AC_CHECK_HEADERS(statgrab.h,, [with_libstatgrab="no (statgrab.h not found)"])
899 if test "x$with_libstatgrab" = "xyes"
901 AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"])
903 if test "x$with_libstatgrab" = "xyes"
905 collect_libstatgrab=1
907 collect_libstatgrab=0
909 AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab],
910 [Wether or not to use statgrab library])
911 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
912 AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes")
914 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
915 if test "x$with_libkvm" = "xyes"
917 AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
919 AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
921 AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
923 if test "x$withval" != "xno" && test "x$withval" != "xyes"
925 LDFLAGS="$LDFLAGS -L$withval/lib"
926 CPPFLAGS="$CPPFLAGS -I$withval/include"
927 with_lm_sensors="yes"
931 if test "x$ac_system" = "xLinux"
933 with_lm_sensors="yes"
935 with_lm_sensors="no (Linux only library)"
938 if test "x$with_lm_sensors" = "xyes"
940 AC_CHECK_LIB(sensors, sensors_init,
942 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
944 [with_lm_sensors="no (libsensors not found)"])
946 if test "x$with_lm_sensors" = "xyes"
948 AC_CHECK_HEADERS(sensors/sensors.h,
950 AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
952 [with_lm_sensors="no (sensors/sensors.h not found)"])
954 if test "x$with_lm_sensors" = "xyes"
960 AC_DEFINE_UNQUOTED(COLLECT_LM_SENSORS, [$collect_lm_sensors],
961 [Wether or not to use sensors library])
962 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
964 with_mysql_config="mysql_config"
967 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
969 if test "x$withval" = "xno"
972 else if test "x$withval" = "xyes"
976 if test -f "$withval" && test -x "$withval";
978 with_mysql_config="$withval"
979 else if test -x "$withval/bin/mysql_config"
981 with_mysql_config="$withval/bin/mysql_config"
989 if test "x$with_libmysql" = "xyes"
991 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
992 mysql_config_status=$?
994 if test $mysql_config_status -ne 0
999 CFLAGS="$CFLAGS $with_mysql_cflags"
1001 AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
1003 CFLAGS="$SAVE_CFLAGS"
1006 if test "x$with_libmysql" = "xyes"
1008 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1009 mysql_config_status=$?
1011 if test $mysql_config_status -ne 0
1015 AC_CHECK_LIB(mysqlclient, mysql_init,
1016 [with_libmysql="yes"],
1017 [with_libmysql="no (symbol 'mysql_init' not found)"],
1021 if test "x$with_libmysql" = "xyes"
1023 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1024 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1025 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1026 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1028 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1030 with_own_liboconfig="no"
1031 liboconfig_LDFLAGS="$LDFLAGS"
1032 liboconfig_CPPFLAGS="$CPPFLAGS"
1033 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1035 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1037 if test -d "$withval/lib"
1039 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1041 if test -d "$withval/include"
1043 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1046 if test "x$withval" = "xno"
1048 AC_MSG_ERROR("liboconfig is required")
1052 with_liboconfig="yes"
1055 save_LDFLAGS="$LDFLAGS"
1056 save_CPPFLAGS="$CPPFLAGS"
1057 LDFLAGS="$liboconfig_LDFLAGS"
1058 CPPFLAGS="$liboconfig_CPPFLAGS"
1059 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1061 with_liboconfig="yes"
1062 with_own_liboconfig="no"
1065 with_liboconfig="yes"
1066 with_own_liboconfig="yes"
1067 LDFLAGS="$save_LDFLAGS"
1068 CPPFLAGS="$save_CPPFLAGS"
1071 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1072 if test "x$with_own_liboconfig" = "xyes"
1074 with_liboconfig="yes (shipped version)"
1077 #with_liboping="yes"
1078 with_own_liboping="no"
1079 liboping_LDFLAGS="$LDFLAGS"
1080 liboping_CPPFLAGS="$CPPFLAGS"
1081 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1083 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1085 if test -d "$withval/lib"
1087 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1089 if test -d "$withval/include"
1091 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1094 if test "x$withval" = "xno"
1097 with_own_liboping="no"
1105 if test "x$with_liboping" = "xyes"
1107 save_LDFLAGS="$LDFLAGS"
1108 save_CPPFLAGS="$CPPFLAGS"
1109 LDFLAGS="$liboping_LDFLAGS"
1110 CPPFLAGS="$liboping_CPPFLAGS"
1111 AC_CHECK_LIB(oping, ping_construct,
1114 with_own_liboping="no"
1118 with_own_liboping="yes"
1119 LDFLAGS="$save_LDFLAGS"
1120 CPPFLAGS="$save_CPPFLAGS"
1123 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1124 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1126 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1128 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1130 LDFLAGS="$LDFLAGS -L$withval/lib"
1131 CPPFLAGS="$CPPFLAGS -I$withval/include"
1138 if test "x$with_libpcap" = "xyes"
1140 AC_CHECK_LIB(pcap, pcap_open_live,
1142 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1143 ], [with_libpcap="no (libpcap not found)"])
1145 if test "x$with_libpcap" = "xyes"
1147 AC_CHECK_HEADERS(pcap.h,
1149 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1150 ], [with_libpcap="no (pcap.h not found)"])
1152 if test "x$with_libpcap" = "xyes"
1158 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1159 [Wether or not to use the pcap library])
1160 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1162 perl_interpreter="perl"
1163 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1165 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1167 LDFLAGS="$LDFLAGS -L$withval/lib"
1168 CPPFLAGS="$CPPFLAGS -I$withval/include"
1169 perl_interpreter="$withval/bin/perl"
1176 if test "x$with_libperl" = "xyes"
1179 SAVE_LDFLAGS=$LDFLAGS
1180 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1181 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1182 CFLAGS="$CFLAGS $PERL_CFLAGS"
1183 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1185 AC_CACHE_CHECK([for libperl],
1195 PerlInterpreter *perl = NULL;
1196 Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
1197 newSVpv ("Collectd::Plugin::FooBar", 24),
1200 [have_libperl="yes"],
1205 if test "x$have_libperl" = "xyes"
1207 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1208 AC_SUBST(PERL_CFLAGS)
1209 AC_SUBST(PERL_LDFLAGS)
1215 LDFLAGS=$SAVE_LDFLAGS
1217 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1219 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1221 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1223 LDFLAGS="$LDFLAGS -L$withval/lib"
1224 CPPFLAGS="$CPPFLAGS -I$withval/include"
1229 if test "x$ac_system" = "xLinux"
1233 with_libiptc="no (Linux only)"
1236 if test "x$with_libiptc" = "xyes"
1238 AC_CHECK_LIB(iptc, iptc_init,
1240 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1241 ], [with_libiptc="no (libiptc not found)"])
1243 if test "x$with_libiptc" = "xyes"
1245 AC_CHECK_HEADERS(libiptc/libiptc.h,
1247 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1248 ], [with_libiptc="no (libiptc/libiptc.h not found)"])
1250 if test "x$with_libiptc" = "xyes"
1256 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1258 with_snmp_config="net-snmp-config"
1261 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1263 if test "x$withval" = "xno"
1265 with_libnetsnmp="no"
1266 else if test "x$withval" = "xyes"
1268 with_libnetsnmp="yes"
1270 if test -x "$withval"
1272 with_snmp_config="$withval"
1273 with_libnetsnmp="yes"
1275 with_snmp_config="$withval/bin/net-snmp-config"
1276 with_libnetsnmp="yes"
1280 [with_libnetsnmp="yes"])
1281 if test "x$with_libnetsnmp" = "xyes"
1283 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1284 snmp_config_status=$?
1286 if test $snmp_config_status -ne 0
1288 with_libnetsnmp="no ($with_snmp_config failed)"
1291 CFLAGS="$CFLAGS $with_snmp_cflags"
1293 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1295 CFLAGS="$SAVE_CFLAGS"
1298 if test "x$with_libnetsnmp" = "xyes"
1300 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1301 snmp_config_status=$?
1303 if test $snmp_config_status -ne 0
1305 with_libnetsnmp="no ($with_snmp_config failed)"
1307 AC_CHECK_LIB(netsnmp, init_snmp,
1308 [with_libnetsnmp="yes"],
1309 [with_libnetsnmp="no (libnetsnmp not found)"],
1313 if test "x$with_libnetsnmp" = "xyes"
1315 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1316 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1317 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1318 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1320 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1322 with_upsclient_config="libupsclient-config"
1323 with_upsclient_cflags=""
1324 with_upsclient_libs=""
1325 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
1327 if test "x$withval" = "xno"
1329 with_libupsclient="no"
1331 if test "x$withval" != "xyes"
1333 if test -f "$withval" && test -x "$withval";
1335 with_upsclient_config="$withval"
1337 with_upsclient_config="$withval/bin/libupsclient-config"
1340 with_libupsclient="yes"
1344 with_libupsclient="yes"
1346 if test "x$with_libupsclient" = "xyes"
1348 with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
1349 upsclient_config_status=$?
1351 if test $upsclient_config_status -ne 0
1353 with_libupsclient="no ($with_upsclient_config failed)"
1356 if test "x$with_libupsclient" = "xyes"
1358 SAVE_CFLAGS="$CFLAGS"
1359 CFLAGS="$CFLAGS $with_upsclient_cflags"
1361 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
1363 CFLAGS="$SAVE_CFLAGS"
1365 if test "x$with_libupsclient" = "xyes"
1367 with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
1368 upsclient_config_status=$?
1370 if test $upsclient_config_status -ne 0
1372 with_libupsclient="no ($with_upsclient_config failed)"
1375 if test "x$with_libupsclient" = "xyes"
1377 AC_CHECK_LIB(upsclient, upscli_connect,
1379 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
1380 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs"
1381 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
1382 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
1385 with_libupsclient="no (symbol 'upscli_connect' not found)"
1386 ], [$with_upsclient_libs])
1388 if test "x$with_libupsclient" = "xyes"
1390 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
1391 [#include <stdlib.h>
1393 #include <upsclient.h>])
1395 AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
1397 ### BEGIN of check for libxmms ###
1398 with_xmms_config="xmms-config"
1401 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
1403 if test "x$withval" != "xno" -a "x$withval" != "xyes"
1405 if test -f "$withval" && test -x "$withval";
1407 with_xmms_config="$withval"
1408 else if test -x "$withval/bin/xmms-config"
1410 with_xmms_config="$withval/bin/xmms-config"
1413 else if test "x$withval" = "xno"
1423 if test "x$with_libxmms" = "xyes"
1425 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
1426 xmms_config_status=$?
1428 if test $xmms_config_status -ne 0
1433 if test "x$with_libxmms" = "xyes"
1435 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
1436 xmms_config_status=$?
1438 if test $xmms_config_status -ne 0
1443 if test "x$with_libxmms" = "xyes"
1445 AC_CHECK_LIB(xmms, xmms_remote_get_info,
1447 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
1448 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
1449 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
1450 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
1457 with_libxmms_numeric=0
1458 if test "x$with_libxmms" = "xyes"
1460 with_libxmms_numeric=1
1462 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
1463 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
1464 ### END of check for libxmms ###
1466 with_libnetlink_cflags=""
1467 with_libnetlink_libs="-lnetlink"
1468 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1470 echo "libnetlink: withval = $withval"
1471 if test "x$withval" = "xyes"
1473 with_libnetlink="yes"
1474 else if test "x$withval" = "xno"
1476 with_libnetlink="no"
1478 if test -d "$withval/include"
1480 with_libnetlink_cflags="-I$withval/include"
1481 with_libnetlink_libs="-L$withval/lib -lnetlink"
1482 with_libnetlink="yes"
1484 AC_MSG_ERROR("no such directory: $withval/include")
1489 if test "x$ac_system" = "xLinux"
1491 with_libnetlink="yes"
1493 with_libnetlink="no (Linux only library)"
1496 if test "x$with_libnetlink" = "xyes"
1499 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1501 with_libnetlink="no (libnetlink.h not found)"
1503 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1505 with_libnetlink="yes"
1509 #include <sys/types.h>
1510 #include <asm/types.h>
1511 #include <sys/socket.h>
1512 #include <linux/netlink.h>
1513 #include <linux/rtnetlink.h>])
1514 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1516 #include <sys/types.h>
1517 #include <asm/types.h>
1518 #include <sys/socket.h>])
1522 #include <sys/types.h>
1523 #include <asm/types.h>
1524 #include <sys/socket.h>
1525 #include <linux/netlink.h>
1526 #include <linux/rtnetlink.h>
1530 int retval = TCA_STATS2;
1533 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1538 #include <sys/types.h>
1539 #include <asm/types.h>
1540 #include <sys/socket.h>
1541 #include <linux/netlink.h>
1542 #include <linux/rtnetlink.h>
1546 int retval = TCA_STATS;
1549 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1552 CFLAGS="$SAVE_CFLAGS"
1554 if test "x$with_libnetlink" = "xyes"
1556 AC_CHECK_LIB(netlink, rtnl_open,
1557 [with_libnetlink="yes"],
1558 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1559 [$with_libnetlink_libs])
1561 if test "x$with_libnetlink" = "xyes"
1563 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1564 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1565 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1566 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1568 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1570 # Check for enabled/disabled features
1573 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
1574 # ------------------------------------------------------------
1576 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
1581 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
1586 m4_define([EnDis],[disabled])dnl
1587 m4_define([YesNo],[no])dnl
1593 m4_define([EnDis],[enabled])dnl
1594 m4_define([YesNo],[yes])dnl
1597 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
1601 m4_if([$3], [feature], [],
1605 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
1611 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
1613 enable_$1='[YesNo]'dnl
1615 if test "x$enable_$1" = "xno"
1619 if test "x$enable_$1" = "xyes"
1623 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
1628 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
1629 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
1631 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
1633 # AC_PLUGIN(name, default, info)
1634 # ------------------------------------------------------------
1640 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
1642 if test "x$enableval" = "xyes"
1650 if test "x$2" = "xyes"
1657 if test "x$enable_plugin" = "xyes"
1659 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
1661 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
1662 enable_$1="$enable_plugin"
1664 )# AC_PLUGIN(name, default, info)
1666 m4_divert_once([HELP_ENABLE], [
1667 collectd features:])
1668 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
1669 AC_COLLECTD([debug], [enable], [feature], [debugging])
1670 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
1671 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
1679 plugin_interface="no"
1683 plugin_multimeter="no"
1685 plugin_processes="no"
1691 plugin_wireless="no"
1694 if test "x$ac_system" = "xLinux"
1696 plugin_battery="yes"
1698 plugin_cpufreq="yes"
1700 plugin_entropy="yes"
1701 plugin_interface="yes"
1706 plugin_processes="yes"
1709 plugin_vserver="yes"
1710 plugin_wireless="yes"
1714 if test "x$with_libiokit" = "xyes"
1716 plugin_battery="yes"
1721 if test "x$with_devinfo$with_kstat" = "xyesyes"
1725 plugin_interface="yes"
1732 if test "x$with_libstatgrab" = "xyes"
1734 plugin_interface="yes"
1740 if test "x$have_processor_info" = "xyes"
1744 if test "x$have_sysctlbyname" = "xyes"
1750 if test "x$have_statfs" = "xyes"
1754 if test "x$have_statvfs" = "xyes"
1759 if test "x$have_getifaddrs" = "xyes"
1761 plugin_interface="yes"
1764 if test "x$have_getloadavg" = "xyes"
1769 # Mac OS X memory interface
1770 if test "x$have_host_statistics" = "xyes"
1775 if test "x$have_termios_h" = "xyes"
1777 plugin_multimeter="yes"
1780 if test "x$have_thread_info" = "xyes"
1782 plugin_processes="yes"
1785 if test "x$with_libkvm" = "xyes"
1790 if test "x$have_getutent" = "xyes"
1794 if test "x$have_getutxent" = "xyes"
1799 # FIXME: sysctl for swap plugin
1801 m4_divert_once([HELP_ENABLE], [
1804 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
1805 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
1806 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
1807 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
1808 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
1809 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
1810 AC_PLUGIN([csv], [yes], [CSV output plugin])
1811 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
1812 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
1813 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
1814 AC_PLUGIN([email], [yes], [EMail statistics])
1815 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
1816 AC_PLUGIN([exec], [yes], [Execution of external programs])
1817 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
1818 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
1819 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
1820 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
1821 AC_PLUGIN([load], [$plugin_load], [System load])
1822 AC_PLUGIN([logfile], [yes], [File logging plugin])
1823 AC_PLUGIN([mbmon], [yes], [Query mbmond])
1824 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
1825 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
1826 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
1827 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
1828 AC_PLUGIN([network], [yes], [Network communication plugin])
1829 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
1830 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
1831 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
1832 AC_PLUGIN([perl], [$with_libperl], [Embed a Perl interpreter])
1833 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
1834 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
1835 AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin])
1836 AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics])
1837 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
1838 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
1839 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
1840 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
1841 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
1842 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
1843 AC_PLUGIN([users], [$plugin_users], [User statistics])
1844 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
1845 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
1846 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
1848 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
1850 if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
1852 with_liboping="yes (shipped version)"
1855 if test "x$with_libperl" = "xyes"
1857 with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)"
1859 enable_perl="no (needs libperl)"
1866 libcurl . . . . . . $with_libcurl
1867 libiokit . . . . . $with_libiokit
1868 libiptc . . . . . . $with_libiptc
1869 libkstat . . . . . $with_kstat
1870 libkvm . . . . . . $with_libkvm
1871 libmysql . . . . . $with_libmysql
1872 libnetlink . . . . $with_libnetlink
1873 libnetsnmp . . . . $with_libnetsnmp
1874 liboconfig . . . . $with_liboconfig
1875 liboping . . . . . $with_liboping
1876 libpcap . . . . . . $with_libpcap
1877 libperl . . . . . . $with_libperl
1878 libpthread . . . . $with_libpthread
1879 librrd . . . . . . $with_rrdtool
1880 libsensors . . . . $with_lm_sensors
1881 libstatgrab . . . . $with_libstatgrab
1882 libupsclient . . . $with_libupsclient
1883 libxmms . . . . . . $with_libxmms
1886 daemon mode . . . . $enable_daemon
1887 debug . . . . . . . $enable_debug
1890 apache . . . . . . $enable_apache
1891 apcups . . . . . . $enable_apcups
1892 apple_sensors . . . $enable_apple_sensors
1893 battery . . . . . . $enable_battery
1894 cpu . . . . . . . . $enable_cpu
1895 cpufreq . . . . . . $enable_cpufreq
1896 csv . . . . . . . . $enable_csv
1897 df . . . . . . . . $enable_df
1898 disk . . . . . . . $enable_disk
1899 dns . . . . . . . . $enable_dns
1900 email . . . . . . . $enable_email
1901 entropy . . . . . . $enable_entropy
1902 exec . . . . . . . $enable_exec
1903 hddtemp . . . . . . $enable_hddtemp
1904 interface . . . . . $enable_interface
1905 iptables . . . . . $enable_iptables
1906 irq . . . . . . . . $enable_irq
1907 load . . . . . . . $enable_load
1908 logfile . . . . . . $enable_logfile
1909 mbmon . . . . . . . $enable_mbmon
1910 memory . . . . . . $enable_memory
1911 multimeter . . . . $enable_multimeter
1912 mysql . . . . . . . $enable_mysql
1913 netlink . . . . . . $enable_netlink
1914 network . . . . . . $enable_network
1915 nfs . . . . . . . . $enable_nfs
1916 ntpd . . . . . . . $enable_ntpd
1917 nut . . . . . . . . $enable_nut
1918 perl . . . . . . . $enable_perl
1919 ping . . . . . . . $enable_ping
1920 processes . . . . . $enable_processes
1921 rrdtool . . . . . . $enable_rrdtool
1922 sensors . . . . . . $enable_sensors
1923 serial . . . . . . $enable_serial
1924 snmp . . . . . . . $enable_snmp
1925 swap . . . . . . . $enable_swap
1926 syslog . . . . . . $enable_syslog
1927 tape . . . . . . . $enable_tape
1928 unixsock . . . . . $enable_unixsock
1929 users . . . . . . . $enable_users
1930 vserver . . . . . . $enable_vserver
1931 wireless . . . . . $enable_wireless
1932 xmms . . . . . . . $enable_xmms