X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=23f0e59e8502fc48d5354e236a042ece8b1f44b2;hb=8583b0d30a4f34a59914f3d1fe8ef82b0e399855;hp=de7dbea590af01ca7172cf541f70116e59127548;hpb=14740db4b415655abc58307352e406442f9933a0;p=collectd.git diff --git a/configure.in b/configure.in index de7dbea5..5b3a54a6 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(collectd, 3.9.2) +AC_INIT(collectd, 4.0.5) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE(dist-bzip2) @@ -7,6 +7,8 @@ AC_LANG(C) AC_PREFIX_DEFAULT("/opt/collectd") +AC_SYS_LARGEFILE + # # Checks for programs. # @@ -24,8 +26,9 @@ AC_SUBST(LTDLINCL) AC_SUBST(LIBLTDL) AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL -#AC_PROG_RANLIB -AC_CONFIG_SUBDIRS(libltdl src/libconfig) +AC_PROG_LEX +AC_PROG_YACC +AC_CONFIG_SUBDIRS(libltdl) # # Checks for header files. @@ -33,32 +36,25 @@ AC_CONFIG_SUBDIRS(libltdl src/libconfig) AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT -AC_CHECK_HEADERS(stdint.h) -AC_CHECK_HEADERS(stdio.h) -AC_CHECK_HEADERS(errno.h) -AC_CHECK_HEADERS(math.h) -AC_CHECK_HEADERS(syslog.h) -AC_CHECK_HEADERS(fcntl.h) -AC_CHECK_HEADERS(signal.h) -AC_CHECK_HEADERS(assert.h) -AC_CHECK_HEADERS(sys/types.h) -AC_CHECK_HEADERS(sys/socket.h) -AC_CHECK_HEADERS(sys/select.h) -AC_CHECK_HEADERS(netdb.h) -AC_CHECK_HEADERS(arpa/inet.h) -AC_CHECK_HEADERS(sys/resource.h) -AC_CHECK_HEADERS(sys/param.h) + +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) # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif ]) AC_CHECK_HEADERS(netinet/in.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -67,6 +63,9 @@ AC_CHECK_HEADERS(netinet/ip.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -78,6 +77,9 @@ AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -92,6 +94,9 @@ AC_CHECK_HEADERS(netinet/ip_var.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -133,34 +138,58 @@ AC_CHECK_HEADERS(netinet/icmp6.h, [], [], # include #endif ]) +AC_CHECK_HEADERS(netinet/tcp.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/udp.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +]) # For cpu modules -AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h) -AC_CHECK_HEADERS(mach/mach_init.h) -AC_CHECK_HEADERS(mach/host_priv.h) -AC_CHECK_HEADERS(mach/mach_error.h) -AC_CHECK_HEADERS(mach/mach_host.h) -AC_CHECK_HEADERS(mach/mach_port.h) -AC_CHECK_HEADERS(mach/mach_types.h) -AC_CHECK_HEADERS(mach/message.h) -AC_CHECK_HEADERS(mach/processor_set.h) -AC_CHECK_HEADERS(mach/processor.h) -AC_CHECK_HEADERS(mach/processor_info.h) -AC_CHECK_HEADERS(mach/task.h) -AC_CHECK_HEADERS(mach/thread_act.h) -AC_CHECK_HEADERS(mach/vm_region.h) -AC_CHECK_HEADERS(mach/vm_map.h) -AC_CHECK_HEADERS(mach/vm_prot.h) -AC_CHECK_HEADERS(mach/vm_statistics.h) -AC_CHECK_HEADERS(mach/kern_return.h) +AC_CHECK_HEADERS(sys/dkstat.h 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) +AC_CHECK_HEADERS(sys/sysctl.h, [], [], +[ +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_PARAM_H +# include +#endif +]) # For hddtemp module -AC_CHECK_HEADERS(linux/major.h) +AC_CHECK_HEADERS(linux/major.h libgen.h) # For the apple_sensors module -AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h) -AC_CHECK_HEADERS(IOKit/IOKitLib.h) -AC_CHECK_HEADERS(IOKit/IOTypes.h) +AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h) # For the battery plugin AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], @@ -172,23 +201,24 @@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], # include #endif ]) -AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h) - -# For the `disk' plugin -AC_CHECK_HEADERS(IOKit/IOBSD.h) -AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h) - -# For load module -AC_CHECK_HEADERS(sys/loadavg.h) # For the swap module -AC_CHECK_HEADERS(sys/swap.h) +AC_CHECK_HEADERS(sys/swap.h, [], [], +[ +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_PARAM_H +# include +#endif +]) +# For load module +# For the processes plugin # For users module -AC_CHECK_HEADERS(utmp.h) -AC_CHECK_HEADERS(utmpx.h) +AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h) -# For traffic plugin +# For interface plugin AC_CHECK_HEADERS(ifaddrs.h) AC_CHECK_HEADERS(net/if.h, [], [], [ @@ -221,36 +251,83 @@ AC_CHECK_HEADERS(linux/netdevice.h, [], [], #endif ]) -# For apache plugin -AC_CHECK_HEADERS(curl/curl.h) - # For quota module -AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h) -AC_CHECK_HEADERS(ctype.h) -AC_CHECK_HEADERS(limits.h) -AC_CHECK_HEADERS(sys/quota.h) -AC_CHECK_HEADERS(xfs/xqm.h) +AC_CHECK_HEADERS(sys/ucred.h, [], [], +[ +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_PARAM_H +# include +#endif +]) # For mount interface -AC_CHECK_HEADERS(fs_info.h) -AC_CHECK_HEADERS(fshelp.h) -AC_CHECK_HEADERS(paths.h) -AC_CHECK_HEADERS(mntent.h) -AC_CHECK_HEADERS(mnttab.h) -AC_CHECK_HEADERS(sys/fstyp.h) -AC_CHECK_HEADERS(sys/fs_types.h) -AC_CHECK_HEADERS(sys/mntent.h) -AC_CHECK_HEADERS(sys/mnttab.h) -AC_CHECK_HEADERS(sys/mount.h) -AC_CHECK_HEADERS(sys/statfs.h) -AC_CHECK_HEADERS(sys/statvfs.h) -AC_CHECK_HEADERS(sys/vfs.h) -AC_CHECK_HEADERS(sys/vfstab.h) - -# For debugging interface (variable number of arguments) -AC_CHECK_HEADERS(stdarg.h) - -dnl Checking for libraries +AC_CHECK_HEADERS(sys/mount.h, [], [], +[ +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_PARAM_H +# include +#endif +]) + +# For the email plugin +AC_CHECK_HEADERS(linux/un.h, [], [], +[ +#if HAVE_SYS_SOCKET_H +# include +#endif +]) + +AC_CHECK_HEADERS(curl/curl.h 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) + +# For the dns plugin +AC_CHECK_HEADERS(arpa/nameser.h) +AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [], +[ +#if HAVE_ARPA_NAMESER_H +# include +#endif +]) + +AC_CHECK_HEADERS(net/if_arp.h, [], [], +[#if HAVE_SYS_SOCKET_H +# include +#endif +]) +AC_CHECK_HEADERS(net/ppp_defs.h) +AC_CHECK_HEADERS(net/if_ppp.h, [], [], +[#if HAVE_NET_PPP_DEFS_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/if_ether.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +]) + +# For the multimeter plugin +have_termios_h="no" +AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"]) + +# +# Checking for libraries +# AC_CHECK_LIB(m, ext) # @@ -266,11 +343,10 @@ AC_HEADER_TIME # Checks for library functions. # AC_PROG_GCC_TRADITIONAL -AC_CHECK_FUNCS(gettimeofday select strdup strtol) -AC_CHECK_FUNCS(getaddrinfo getnameinfo) -AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen) -AC_CHECK_FUNCS(strncasecmp strcasecmp) -AC_CHECK_FUNCS(openlog syslog closelog) +AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog) + +AC_CHECK_FUNCS(getpwnam_r) +AC_CHECK_FUNCS(getgrnam_r) socket_needs_socket="no" AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket))) @@ -280,96 +356,214 @@ nanosleep_needs_rt="no" AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep))) AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") -# For cpu module -AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) +AC_CHECK_FUNCS(regcomp regerror regexec regfree) -# For df module -AC_CHECK_FUNCS(statfs statvfs) +AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) +AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"]) +AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"]) +AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"]) +AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"]) +AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"]) +AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"]) +AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"]) +AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"]) +AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"]) # For load module AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"]) -# For the `processes' plugin -AC_CHECK_FUNCS(thread_info) - -# For users module -AC_CHECK_FUNCS(getutent getutxent) - -# For quota module -AC_CHECK_FUNCS(quotactl) -AC_CHECK_FUNCS(getgrgid getpwuid) +# Check for NAN +AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])], +[ + if test "x$withval" = "xno"; then + nan_type="none" + else if test "x$withval" = "xyes"; then + nan_type="zero" + else + nan_type="$withval" + fi; fi +], +[nan_type="none"]) +if test "x$nan_type" = "xnone"; then + AC_CACHE_CHECK([whether NAN is defined by default], + [have_nan_default], + AC_COMPILE_IFELSE( + AC_LANG_PROGRAM( + [[ +#include +#include +static float foo = NAN; + ]], + [[ + if (isnan (foo)) + return 0; + else + return 1; + ]]), + [have_nan_default="yes"], + [have_nan_default="no"] + ) + ) + if test "x$have_nan_default" = "xyes" + then + nan_type="default" + fi +fi +if test "x$nan_type" = "xnone"; then + AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99], + [have_nan_isoc], + AC_COMPILE_IFELSE( + AC_LANG_PROGRAM( + [[ +#include +#define __USE_ISOC99 1 +#include +static float foo = NAN; + ]], + [[ + if (isnan (foo)) + return 0; + else + return 1; + ]]), + [have_nan_isoc="yes"], + [have_nan_isoc="no"] + ) + ) + if test "x$have_nan_isoc" = "xyes" + then + nan_type="isoc99" + fi +fi +if test "x$nan_type" = "xnone"; then + AC_CACHE_CHECK([whether NAN can be defined by 0/0], + [have_nan_zero], + AC_RUN_IFELSE( + AC_LANG_PROGRAM( + [[ +#include +#include +#ifdef NAN +# undef NAN +#endif +#define NAN (0.0 / 0.0) +#ifndef isnan +# define isnan(f) ((f) != (f)) +#endif +static float foo = NAN; + ]], + [[ + if (isnan (foo)) + return 0; + else + return 1; + ]]), + [have_nan_zero="yes"], + [have_nan_zero="no"] + ) + ) + if test "x$have_nan_zero" = "xyes" + then + nan_type="zero" + fi +fi -# For traffic module -AC_CHECK_FUNCS(getifaddrs) +if test "x$nan_type" = "xdefault"; then + AC_DEFINE(NAN_STATIC_DEFAULT, 1, + [Define if NAN is defined by default and can initialize static variables.]) +else if test "x$nan_type" = "xisoc99"; then + AC_DEFINE(NAN_STATIC_ISOC, 1, + [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.]) +else if test "x$nan_type" = "xzero"; then + AC_DEFINE(NAN_ZERO_ZERO, 1, + [Define if NAN can be defined as (0.0 / 0.0)]) +else + AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.]) +fi; fi; fi # For mount interface -AC_CHECK_FUNCS(getfsent getvfsent listmntent) -AC_CHECK_FUNCS(getfsstat) +#AC_CHECK_FUNCS(getfsent getvfsent) -# Check for different versions of `getmntent' here.. -AC_FUNC_GETMNTENT -if test "x$ac_cv_lib_sun_getmntent" = "xyes" -then - AC_DEFINE(HAVE_SUN_GETMNTENT, 1, - [Define if the function getmntent exists. It's the version from libsun.]) +have_getfsstat="no" +AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"]) +have_getvfsstat="no" +AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"]) +have_listmntent="no" +AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"]) + +have_getmntent="no" +AC_CHECK_FUNCS(getmntent, [have_getmntent="c"]) +if test "x$have_getmntent" = "xno"; then + AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"]) fi -if test "x$ac_cv_lib_seq_getmntent" = "xyes" -then - AC_DEFINE(HAVE_SEQ_GETMNTENT, 1, - [Define if the function getmntent exists. It's the version from libseq.]) +if test "x$have_getmntent" = "xno"; then + AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"]) fi -if test "x$ac_cv_lib_gen_getmntent" = "xyes" -then - AC_DEFINE(HAVE_GEN_GETMNTENT, 1, - [Define if the function getmntent exists. It's the version from libgen.]) +if test "x$have_getmntent" = "xno"; then + AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"]) fi -if test "x$ac_cv_func_getmntent" = "xyes"; then - saveCFLAGS="$CFLAGS" - CFLAGS="-Wall -Werror $CFLAGS" +if test "x$have_getmntent" = "xc"; then AC_CACHE_CHECK([whether getmntent takes one argument], - [fu_cv_getmntent1], + [have_one_getmntent], AC_COMPILE_IFELSE( AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT +#include #include "$srcdir/src/utils_mount.h"]], - [[(void)getmntent((FILE *)NULL);]] + [[ + FILE *fh; + struct mntent *me; + fh = setmntent ("/etc/mtab", "r"); + me = getmntent (fh); + ]] ), - [fu_cv_getmntent1=yes], - [fu_cv_getmntent1=no] + [have_one_getmntent="yes"], + [have_one_getmntent="no"] ) ) - if test "x$fu_cv_getmntent1" = "xno"; then - AC_CACHE_CHECK([whether getmntent takes two arguments], - [fu_cv_getmntent2], - AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT + AC_CACHE_CHECK([whether getmntent takes two arguments], + [have_two_getmntent], + AC_COMPILE_IFELSE( + AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT +#include #include "$srcdir/src/utils_mount.h"]], - [[(void)getmntent((FILE *)NULL, - (struct mnttab *)NULL);]] - ), - [fu_cv_getmntent2=yes], - [fu_cv_getmntent2=no] - ) + [[ + FILE *fh; + struct mnttab mt; + int status; + fh = fopen ("/etc/mnttab", "r"); + status = getmntent (fh, &mt); + ]] + ), + [have_two_getmntent="yes"], + [have_two_getmntent="no"] ) + ) +fi + +# Check for different versions of `getmntent' here.. + +if test "x$have_getmntent" = "xc"; then + if test "x$have_one_getmntent" = "xyes"; then + AC_DEFINE(HAVE_ONE_GETMNTENT, 1, + [Define if the function getmntent exists and takes one argument.]) + fi + if test "x$have_two_getmntent" = "xyes"; then + AC_DEFINE(HAVE_TWO_GETMNTENT, 1, + [Define if the function getmntent exists and takes two arguments.]) fi - CFLAGS="$saveCFLAGS" -fi -if test "x$fu_cv_getmntent1" = "xyes"; then - AC_DEFINE(HAVE_GETMNTENT1, - 1, - [Define if there is a function named getmntent - for reading the list of mounted filesystems, and - that function takes a single argument. (4.3BSD, - SunOS, HP-UX, Dynix, Irix, Linux)] - ) fi -if test "x$fu_cv_getmntent2" = "xyes"; then - AC_DEFINE(HAVE_GETMNTENT2, - 1, - [Define if there is a function named getmntent - for reading the list of mounted filesystems, and - that function takes two arguments. (SVR4)] - ) +if test "x$have_getmntent" = "xsun"; then + AC_DEFINE(HAVE_SUN_GETMNTENT, 1, + [Define if the function getmntent exists. It's the version from libsun.]) +fi +if test "x$have_getmntent" = "xseq"; then + AC_DEFINE(HAVE_SEQ_GETMNTENT, 1, + [Define if the function getmntent exists. It's the version from libseq.]) +fi +if test "x$have_getmntent" = "xgen"; then + AC_DEFINE(HAVE_GEN_GETMNTENT, 1, + [Define if the function getmntent exists. It's the version from libgen.]) fi # Check for structures @@ -391,6 +585,56 @@ AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_p #include ]) +AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +#if HAVE_NETINET_UDP_H +# include +#endif +]) +AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +#if HAVE_NETINET_UDP_H +# include +#endif +]) + +AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime], + [], + [], + [ +#if HAVE_KSTAT_H +# include +#endif + ]) + AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in *linux*) @@ -449,31 +693,36 @@ AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool], [Wether or not to use rrdtool library]) AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes") -#AC_ARG_WITH(pth, [AS_HELP_STRING([--with-pth=@<:@=PREFIX@:>@], [Path to pth (experimental).]), -#[ if test "x$withval" != "xno" && test "x$withval" != "xyes" -# then -# LDFLAGS="$LDFLAGS -L$withval/lib" -# CPPFLAGS="$CPPFLAGS -I$withval/include" -# with_pth="yes" -# fi -#], [with_pth="no"]) -#if test "x$with_pth" = "xyes" -#then -# AC_CHECK_LIB(pth, pth_init,, [with_pth="no (libpth not found)"], []) -#fi -#if test "x$with_pth" = "xyes" -#then -# AC_CHECK_HEADERS(pth.h,, [with_pth="no (pth.h not found)"]) -#fi -#if test "x$with_pth" = "xyes" -#then -# collect_pth=1 -#else -# collect_pth=0 -#fi -#AC_DEFINE_UNQUOTED(COLLECT_PTH, [$collect_pth], -# [Wether or not to use pth (portable threads) library]) -#AM_CONDITIONAL(BUILD_WITH_PTH, test "x$with_pth" = "xyes") +AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])], +[ if test "x$withval" != "xno" -a "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libpthread="yes" + else + if test "x$withval" = "xno" + then + with_libpthread="no (disabled)" + fi + fi +], [with_libpthread="yes"]) +if test "x$with_libpthread" = "xyes" +then + AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], []) +fi +if test "x$with_libpthread" = "xyes" +then + AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"]) +fi +if test "x$with_libpthread" = "xyes" +then + collect_pthread=1 +else + collect_pthread=0 +fi +AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], + [Wether or not to use pthread (POSIX threads) library]) +AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") if test "$ac_system" = "Solaris" then @@ -486,21 +735,18 @@ fi if test "x$with_kstat" = "xyes" then - AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"]) + AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], []) fi if test "x$with_kstat" = "xyes" then - AC_CHECK_LIB(devinfo, di_init,, [with_devinfo="no (not found)"]) + AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], []) AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"]) fi if test "x$with_kstat" = "xyes" then - collect_kstat=1 -else - collect_kstat=0 + AC_DEFINE(HAVE_LIBKSTAT, 1, + [Define to 1 if you have the 'kstat' library (-lkstat)]) fi -AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat], - [Wether or not to use kstat library (Solaris)]) AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes") AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes") @@ -589,7 +835,6 @@ AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes") with_libstatgrab="yes" with_libdevstat="no" -with_libkvm="no" AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])], [ if test "x$withval" != "xno" -a "x$withval" != "xyes" @@ -618,7 +863,6 @@ fi if test "x$with_libstatgrab" = "xyes" then AC_CHECK_LIB(devstat, getdevs, [with_libdevstat="yes"], [with_libdevstat="no"]) - AC_CHECK_LIB(kvm, kvm_getargv, [with_libkvm="yes"], [with_libkvm="no"]) fi if test "x$with_libstatgrab" = "xyes" then @@ -630,7 +874,13 @@ AC_DEFINE_UNQUOTED(COLLECT_LIBSTATGRAB, [$collect_libstatgrab], [Wether or not to use statgrab library]) AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes") AM_CONDITIONAL(BUILD_WITH_LIBDEVSTAT, test "x$with_libdevstat" = "xyes") -AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes") + +AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"]) +if test "x$with_libkvm" = "xyes" +then + AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)]) +fi +AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes") AC_ARG_WITH(lm-sensors, [AS_HELP_STRING([--with-lm-sensors@<:@=PREFIX@:>@], [Path to lm_sensors.])], [ @@ -711,43 +961,390 @@ AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql], [Wether or not to use mysql library]) AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes") -# Define `step' and `hearbeat' values.. -declare -i collectd_step=10 -declare -i collectd_heartbeat=25 -AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])], +with_own_liboconfig="no" +liboconfig_LDFLAGS="$LDFLAGS" +liboconfig_CPPFLAGS="$CPPFLAGS" +AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])], [ - if test "x$withval" != "xno" -a "x$withval" != "xyes" + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + if test -d "$withval/lib" + then + liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib" + fi + if test -d "$withval/include" + then + liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include" + fi + fi + if test "x$withval" = "xno" + then + AC_MSG_ERROR("liboconfig is required") + fi +], +[ + with_liboconfig="yes" +]) + +save_LDFLAGS="$LDFLAGS" +save_CPPFLAGS="$CPPFLAGS" +LDFLAGS="$liboconfig_LDFLAGS" +CPPFLAGS="$liboconfig_CPPFLAGS" +AC_CHECK_LIB(oconfig, oconfig_parse_fh, +[ + with_liboconfig="yes" + with_own_liboconfig="no" +], +[ + with_liboconfig="yes" + with_own_liboconfig="yes" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" +]) + +AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes") +if test "x$with_own_liboconfig" = "xyes" +then + with_liboconfig="yes (shipped version)" +fi + +#with_liboping="yes" +with_own_liboping="no" +liboping_LDFLAGS="$LDFLAGS" +liboping_CPPFLAGS="$CPPFLAGS" +AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" then - declare -i tmp_collectd_step="$withval" - if test $tmp_collectd_step -gt 0 + if test -d "$withval/lib" then - collectd_step=$tmp_collectd_step - let "collectd_heartbeat=$collectd_step*2" + liboping_LDFLAGS="$LDFLAGS -L$withval/lib" fi + if test -d "$withval/include" + then + liboping_CPPFLAGS="$CPPFLAGS -I$withval/include" + fi + fi + if test "x$withval" = "xno" + then + with_liboping="no" + with_own_liboping="no" + fi +], +[ + #753 + with_liboping="yes" +]) + +if test "x$with_liboping" = "xyes" +then + save_LDFLAGS="$LDFLAGS" + save_CPPFLAGS="$CPPFLAGS" + LDFLAGS="$liboping_LDFLAGS" + CPPFLAGS="$liboping_CPPFLAGS" + AC_CHECK_LIB(oping, ping_construct, + [ + with_liboping="yes" + with_own_liboping="no" + ], + [ + with_liboping="yes" + with_own_liboping="yes" + LDFLAGS="$save_LDFLAGS" + CPPFLAGS="$save_CPPFLAGS" + ]) +fi +AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes") +AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes") + +AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libpcap="yes" fi -], []) -AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])], +], +[ + with_libpcap="yes" +]) +if test "x$with_libpcap" = "xyes" +then + AC_CHECK_LIB(pcap, pcap_open_live, + [ + AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).]) + ], [with_libpcap="no (libpcap not found)"]) +fi +if test "x$with_libpcap" = "xyes" +then + AC_CHECK_HEADERS(pcap.h, + [ + AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the header file.]) + ], [with_libpcap="no (pcap.h not found)"]) +fi +if test "x$with_libpcap" = "xyes" +then + collect_libpcap=1 +else + collect_libpcap=0 +fi +AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap], + [Wether or not to use the pcap library]) +AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes") + +perl_interpreter="perl" +AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + perl_interpreter="$withval/bin/perl" + with_libperl="yes" + fi +], +[ + with_libperl="yes" +]) +if test "x$with_libperl" = "xyes" +then + SAVE_CFLAGS=$CFLAGS + SAVE_LDFLAGS=$LDFLAGS + PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts` + PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts` + CFLAGS="$CFLAGS $PERL_CFLAGS" + LDFLAGS="$LDFLAGS $PERL_LDFLAGS" + + AC_CACHE_CHECK([for libperl], + [have_libperl], + AC_LINK_IFELSE( + AC_LANG_PROGRAM( + [[ +#include +#include +#include + ]], + [[ + PerlInterpreter *perl = NULL; + Perl_load_module (perl, PERL_LOADMOD_NOIMPORT, + newSVpv ("Collectd::Plugin::FooBar", 24), + Nullsv); + ]]), + [have_libperl="yes"], + [have_libperl="no"] + ) + ) + + if test "x$have_libperl" = "xyes" + then + AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.]) + AC_SUBST(PERL_CFLAGS) + AC_SUBST(PERL_LDFLAGS) + else + with_libperl="no" + fi + + CFLAGS=$SAVE_CFLAGS + LDFLAGS=$SAVE_LDFLAGS +fi +AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes") + +AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libiptc="yes" + fi +], +[ + if test "x$ac_system" = "xLinux" + then + with_libiptc="yes" + else + with_libiptc="no (Linux only)" + fi +]) +if test "x$with_libiptc" = "xyes" +then + AC_CHECK_LIB(iptc, iptc_init, + [ + AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).]) + ], [with_libiptc="no (libiptc not found)"]) +fi +if test "x$with_libiptc" = "xyes" +then + AC_CHECK_HEADERS(libiptc/libiptc.h, + [ + AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the header file.]) + ], [with_libiptc="no (libiptc/libiptc.h not found)"]) +fi +if test "x$with_libiptc" = "xyes" +then + collect_libiptc=1 +else + collect_libiptc=0 +fi +AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") + +AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libnetsnmp="yes" + fi +], +[with_libnetsnmp="yes"]) +if test "x$with_libnetsnmp" = "xyes" +then + AC_CHECK_LIB(netsnmp, init_snmp, + [ + AC_DEFINE(HAVE_LIBSNMP, 1, [Define to 1 if you have the Net-SNMP library (-lnetsnmp).]) + ], [with_libnetsnmp="no (libnetsnmp not found)"]) +fi +if test "x$with_libnetsnmp" = "xyes" +then + AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, + [ + AC_DEFINE(HAVE_NET_SNMP_NET_SNMP_CONFIG_H, 1, [Define to 1 if you have the header file.]) + ], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]) +fi +AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes") + +with_upsclient_config="libupsclient-config" +with_upsclient_cflags="" +with_upsclient_libs="" +AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])], +[ + if test "x$withval" = "xno" + then + with_libupsclient="no" + else + with_libupsclient="yes" + if "x$withval" != "xyes" + then + with_upsclient_config="$withval/bin/libupsclient-config" + fi + fi +], +[ + with_libupsclient="yes" +]) +if test "x$with_libupsclient" = "xyes" +then + with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null` + upsclient_config_status=$? + + if test $upsclient_config_status -ne 0 + then + with_libupsclient="no" + fi +fi +if test "x$with_libupsclient" = "xyes" +then + with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null` + upsclient_config_status=$? + + if test $upsclient_config_status -ne 0 + then + with_libupsclient="no" + fi +fi +if test "x$with_libupsclient" = "xyes" +then + CFLAGS_ORIG=$CFLAGS + CFLAGS="$CFLAGS $with_upsclient_cflags" + LDFLAGS_ORIG=$LDFLAGS + LDFLAGS="$LDFLAGS $with_upsclient_libs" + AC_CHECK_LIB(upsclient, upscli_connect, + [ + BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags" + BUILD_WITH_LIBUPSCLIENT_LIBS="$with_upsclient_libs" + AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS) + AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS) + ], + [ + with_libupsclient="no" + ]) + CFLAGS=$CFLAGS_ORIG + LDFLAGS=$LDFLAGS_ORIG +fi +if test "x$with_libupsclient" = "xyes" +then + AC_DEFINE(HAVE_LIBUPSCLIENT, 1, [Define to 1 if you have the upsclient library (-lupsclient).]) +fi +AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes") + +### BEGIN of check for libxmms ### +with_xmms_config="xmms-config" +with_xmms_cflags="" +with_xmms_libs="" +AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])], [ if test "x$withval" != "xno" -a "x$withval" != "xyes" then - declare -i tmp_collectd_heartbeat="$withval" - if test $tmp_collectd_heartbeat -gt 0 + if test -x "$withval/bin/xmms-config" then - collectd_heartbeat=$tmp_collectd_heartbeat + with_xmms_config="$withval/bin/xmms-config" fi fi -], []) + if test "x$withval" = "xno" + then + with_libxmms="no" + else + with_libxmms="yes" + fi +], +[ + with_libxmms="yes" +]) +if test "x$with_libxmms" = "xyes" +then + with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null` + xmms_config_status=$? + + if test $xmms_config_status -ne 0 + then + with_libxmms="no" + fi +fi +if test "x$with_libxmms" = "xyes" +then + with_xmms_libs=`$with_xmms_config --libs 2>/dev/null` + xmms_config_status=$? -if test $collectd_step -ne 10 + if test $xmms_config_status -ne 0 + then + with_libxmms="no" + fi +fi +if test "x$with_libxmms" = "xyes" then - AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.]) + AC_CHECK_LIB(xmms, xmms_remote_get_info, + [ + BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags" + BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs" + AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS) + AC_SUBST(BUILD_WITH_LIBXMMS_LIBS) + ], + [ + with_libxmms="no" + ], + [$with_xmms_libs]) fi -if test $collectd_heartbeat -ne 25 +with_libxmms_numeric=0 +if test "x$with_libxmms" = "xyes" then - AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.]) + with_libxmms_numeric=1 fi +AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).]) +AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes") +### END of check for libxmms ### -# # Check for enabled/disabled features # @@ -811,40 +1408,233 @@ fi ]dnl )# AC_COLLECTD(name, enable/disable, info-text, feature/module) +# AC_PLUGIN(name, default, info) +# ------------------------------------------------------------ +dnl +AC_DEFUN( + [AC_PLUGIN], + [ + enable_plugin="no" + AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]), + [ + if test "x$enableval" = "xyes" + then + enable_plugin="yes" + else + enable_plugin="no" + fi + ], + [ + if test "x$2" = "xyes" + then + enable_plugin="yes" + else + enable_plugin="no" + fi + ]) + if test "x$enable_plugin" = "xyes" + then + AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.]) + fi + AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes") + enable_$1="$enable_plugin" + ] +)# AC_PLUGIN(name, default, info) + m4_divert_once([HELP_ENABLE], [ collectd features:]) +# FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro. AC_COLLECTD([debug], [enable], [feature], [debugging]) AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux]) +plugin_battery="no" +plugin_cpu="no" +plugin_cpufreq="no" +plugin_df="no" +plugin_disk="no" +plugin_entropy="no" +plugin_interface="no" +plugin_irq="no" +plugin_load="no" +plugin_memory="no" +plugin_multimeter="no" +plugin_nfs="no" +plugin_processes="no" +plugin_serial="no" +plugin_swap="no" +plugin_tape="no" +plugin_users="no" +plugin_vserver="no" +plugin_wireless="no" + +# Linux +if test "x$ac_system" = "xLinux" +then + plugin_battery="yes" + plugin_cpu="yes" + plugin_cpufreq="yes" + plugin_disk="yes" + plugin_entropy="yes" + plugin_interface="yes" + plugin_irq="yes" + plugin_load="yes" + plugin_memory="yes" + plugin_nfs="yes" + plugin_processes="yes" + plugin_serial="yes" + plugin_swap="yes" + plugin_vserver="yes" + plugin_wireless="yes" +fi + +# Mac OS X devices +if test "x$with_libiokit" = "xyes" +then + plugin_battery="yes" + plugin_disk="yes" +fi + +# Solaris +if test "x$with_devinfo$with_kstat" = "xyesyes" +then + plugin_cpu="yes" + plugin_disk="yes" + plugin_interface="yes" + plugin_memory="yes" + plugin_swap="yes" + plugin_tape="yes" +fi + +# libstatgrab +if test "x$with_libstatgrab" = "xyes" +then + plugin_interface="yes" + plugin_load="yes" + plugin_memory="yes" + plugin_swap="yes" +fi + +if test "x$have_processor_info" = "xyes" +then + plugin_cpu="yes" +fi +if test "x$have_sysctlbyname" = "xyes" +then + plugin_cpu="yes" + plugin_memory="yes" +fi + +if test "x$have_statfs" = "xyes" +then + plugin_df="yes" +fi +if test "x$have_statvfs" = "xyes" +then + plugin_df="yes" +fi + +if test "x$have_getifaddrs" = "xyes" +then + plugin_interface="yes" +fi + +if test "x$have_getloadavg" = "xyes" +then + plugin_load="yes" +fi + +# Mac OS X memory interface +if test "x$have_host_statistics" = "xyes" +then + plugin_memory="yes" +fi + +if test "x$have_termios_h" = "xyes" +then + plugin_multimeter="yes" +fi + +if test "x$have_thread_info" = "xyes" +then + plugin_processes="yes" +fi + +if test "x$with_libkvm" = "xyes" +then + plugin_swap="yes" +fi + +if test "x$have_getutent" = "xyes" +then + plugin_users="yes" +fi +if test "x$have_getutxent" = "xyes" +then + plugin_users="yes" +fi + +# FIXME: sysctl for swap plugin + m4_divert_once([HELP_ENABLE], [ -collectd modules:]) -AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics]) -AC_COLLECTD([apcups], [disable], [module], [Statistics of UPSes by APC]) -AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors]) -AC_COLLECTD([battery], [disable], [module], [battery statistics]) -AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics]) -AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics]) -AC_COLLECTD([disk], [disable], [module], [disk/partition statistics]) -AC_COLLECTD([df], [disable], [module], [df statistics]) -AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)]) -AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics]) -AC_COLLECTD([load], [disable], [module], [system load statistics]) -AC_COLLECTD([memory], [disable], [module], [memory statistics]) -AC_COLLECTD([mysql], [disable], [module], [mysql statistics]) -AC_COLLECTD([nfs], [disable], [module], [nfs statistics]) -AC_COLLECTD([ping], [disable], [module], [ping statistics]) -AC_COLLECTD([processes], [disable], [module], [processes statistics]) -AC_COLLECTD([sensors], [disable], [module], [lm_sensors statistics]) -AC_COLLECTD([serial], [disable], [module], [serial statistics]) -AC_COLLECTD([swap], [disable], [module], [swap statistics]) -AC_COLLECTD([tape], [disable], [module], [tape statistics]) -AC_COLLECTD([traffic], [disable], [module], [system traffic statistics]) -AC_COLLECTD([users], [disable], [module], [user count statistics]) -AC_COLLECTD([vserver], [disable], [module], [vserver statistics]) -AC_COLLECTD([wireless], [disable], [module], [wireless link statistics]) - -AC_OUTPUT(Makefile src/libconfig/Makefile src/liboping/Makefile src/Makefile) +collectd plugins:]) + +AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics]) +AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC]) +AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors]) +AC_PLUGIN([battery], [$plugin_battery], [Battery statistics]) +AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics]) +AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics]) +AC_PLUGIN([csv], [yes], [CSV output plugin]) +AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics]) +AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics]) +AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis]) +AC_PLUGIN([email], [yes], [EMail statistics]) +AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics]) +AC_PLUGIN([exec], [yes], [Execution of external programs]) +AC_PLUGIN([hddtemp], [yes], [Query hddtempd]) +AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics]) +AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters]) +AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics]) +AC_PLUGIN([load], [$plugin_load], [System load]) +AC_PLUGIN([logfile], [yes], [File logging plugin]) +AC_PLUGIN([mbmon], [yes], [Query mbmond]) +AC_PLUGIN([memory], [$plugin_memory], [Memory usage]) +AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values]) +AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics]) +AC_PLUGIN([network], [yes], [Network communication plugin]) +AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics]) +AC_PLUGIN([ntpd], [yes], [NTPd statistics]) +AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics]) +AC_PLUGIN([perl], [$with_libperl], [Embed a Perl interpreter]) +AC_PLUGIN([ping], [$with_liboping], [Network latency statistics]) +AC_PLUGIN([processes], [$plugin_processes], [Process statistics]) +AC_PLUGIN([rrdtool], [$with_rrdtool], [RRDTool output plugin]) +AC_PLUGIN([sensors], [$with_lm_sensors], [lm_sensors statistics]) +AC_PLUGIN([serial], [$plugin_serial], [serial port traffic]) +AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin]) +AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics]) +AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin]) +AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics]) +AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin]) +AC_PLUGIN([users], [$plugin_users], [User statistics]) +AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics]) +AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics]) +AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics]) + +AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile) + +if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes" +then + with_liboping="yes (shipped version)" +fi + +if test "x$with_libperl" = "xyes" +then + with_libperl="yes (version `perl -MConfig -e 'print $Config{version};'`)" +else + enable_perl="no (needs libperl)" +fi cat <