Code

collectd-threshold(5): Correct the description of the "Interesting" config option.
[collectd.git] / configure.in
index bdcb084f3dec0a6faaf924f2369cb1f44b1b40f9..7212f02f9bea985771de5e3e344f80ec1032048b 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
+AC_INIT(collectd, [m4_esyscmd(./version-gen.sh)])
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AC_CONFIG_AUX_DIR([libltdl/config])
@@ -24,7 +24,7 @@ m4_ifdef([LT_PACKAGE_VERSION],
        ]
 )
 
-AM_INIT_AUTOMAKE(dist-bzip2)
+AM_INIT_AUTOMAKE([tar-pax dist-bzip2])
 AC_LANG(C)
 
 AC_PREFIX_DEFAULT("/opt/collectd")
@@ -300,6 +300,21 @@ fi
 # For hddtemp module
 AC_CHECK_HEADERS(linux/major.h libgen.h)
 
+# For md module (Linux only)
+if test "x$ac_system" = "xLinux"
+then
+       AC_CHECK_HEADERS(linux/raid/md_u.h,
+                        [have_linux_raid_md_u_h="yes"],
+                        [have_linux_raid_md_u_h="no"],
+[
+#include <sys/ioctl.h>
+#include <linux/major.h>
+#include <linux/types.h>
+])
+else
+       have_linux_raid_md_u_h="no"
+fi
+
 # For the battery plugin
 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
 [
@@ -389,6 +404,33 @@ AC_CHECK_HEADERS(linux/netdevice.h, [], [],
 #endif
 ])
 
+# For ethstat module
+AC_CHECK_HEADERS(linux/sockios.h,
+    [have_linux_sockios_h="yes"],
+    [have_linux_sockios_h="no"],
+    [
+#if HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#if HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+    ])
+AC_CHECK_HEADERS(linux/ethtool.h,
+    [have_linux_ethtool_h="yes"],
+    [have_linux_ethtool_h="no"],
+    [
+#if HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#if HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+#if HAVE_LINUX_SOCKIOS_H
+# include <linux/sockios.h>
+#endif
+    ])
+
 # For ipvs module
 have_linux_ip_vs_h="no"
 have_net_ip_vs_h="no"
@@ -493,6 +535,22 @@ AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
 
 AC_CHECK_HEADERS(netinet/ip_compat.h)
 
+have_net_pfvar_h="no"
+AC_CHECK_HEADERS(net/pfvar.h,
+               [have_net_pfvar_h="yes"],
+               [have_net_pfvar_h="no"],
+[
+#if HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+])
+
 # For the multimeter plugin
 have_termios_h="no"
 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
@@ -524,13 +582,13 @@ fi
 AC_CACHE_CHECK([for strtok_r],
   [c_cv_have_strtok_r_default],
   AC_LINK_IFELSE(
-    AC_LANG_PROGRAM(
-    [[[[
+    [AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-    ]]]],
-    [[[[
+]]],
+[[[
       char buffer[] = "foo,bar,baz";
       char *token;
       char *dummy;
@@ -540,10 +598,11 @@ AC_CACHE_CHECK([for strtok_r],
       saveptr = NULL;
       while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
       {
-       dummy = NULL;
+        dummy = NULL;
         printf ("token = %s;\n", token);
       }
-    ]]]]),
+]]]
+    )],
     [c_cv_have_strtok_r_default="yes"],
     [c_cv_have_strtok_r_default="no"]
   )
@@ -556,13 +615,13 @@ then
   AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
     [c_cv_have_strtok_r_reentrant],
     AC_LINK_IFELSE(
-      AC_LANG_PROGRAM(
-      [[[[
+      [AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-      ]]]],
-      [[[[
+]]],
+[[[
         char buffer[] = "foo,bar,baz";
         char *token;
         char *dummy;
@@ -572,10 +631,11 @@ then
         saveptr = NULL;
         while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
         {
-         dummy = NULL;
+          dummy = NULL;
           printf ("token = %s;\n", token);
         }
-      ]]]]),
+]]]
+      )],
       [c_cv_have_strtok_r_reentrant="yes"],
       [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
     )
@@ -653,16 +713,15 @@ if test "x$have_strptime" = "xyes"
 then
        AC_CACHE_CHECK([whether strptime is exported by default],
                       [c_cv_have_strptime_default],
-                      AC_COMPILE_IFELSE(
-AC_LANG_PROGRAM(
-[[
-AC_INCLUDES_DEFAULT
+                      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <time.h>
-]],
-[[
+]]],
+[[[
  struct tm stm;
  (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
-]]),
+]]]
+                      )],
                       [c_cv_have_strptime_default="yes"],
                       [c_cv_have_strptime_default="no"]))
 fi
@@ -670,9 +729,8 @@ if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno
 then
        AC_CACHE_CHECK([whether strptime needs standards mode],
                       [c_cv_have_strptime_standards],
-                      AC_COMPILE_IFELSE(
-AC_LANG_PROGRAM(
-[[
+                      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
 #ifndef _ISOC99_SOURCE
 # define _ISOC99_SOURCE 1
 #endif
@@ -682,13 +740,13 @@ AC_LANG_PROGRAM(
 #ifndef _XOPEN_SOURCE
 # define _XOPEN_SOURCE 500
 #endif
-AC_INCLUDES_DEFAULT
 #include <time.h>
-]],
-[[
+]]],
+[[[
  struct tm stm;
  (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
-]]),
+]]]
+                      )],
                       [c_cv_have_strptime_standards="yes"],
                       [c_cv_have_strptime_standards="no"]))
 
@@ -704,25 +762,25 @@ if test "x$GCC" = "xyes"
 then
        CFLAGS="$SAVE_CFLAGS"
 fi
-
 # }}} Check for strptime
 
 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
 if test "x$have_swapctl" = "xyes"; then
         AC_CACHE_CHECK([whether swapctl takes two arguments],
                 [c_cv_have_swapctl_two_args],
-                AC_COMPILE_IFELSE(
-                        AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
 #  undef _FILE_OFFSET_BITS
 #  undef _LARGEFILE64_SOURCE
 #endif
 #include <sys/stat.h>
-#include <sys/swap.h>]],
-                                [[
-                                int num = swapctl(0, NULL);
-                                ]]
-                        ),
+#include <sys/swap.h>
+]]],
+[[[
+int num = swapctl(0, NULL);
+]]]
+                        )],
                         [c_cv_have_swapctl_two_args="yes"],
                         [c_cv_have_swapctl_two_args="no"]
                 )
@@ -730,17 +788,19 @@ if test "x$have_swapctl" = "xyes"; then
         AC_CACHE_CHECK([whether swapctl takes three arguments],
                 [c_cv_have_swapctl_three_args],
                 AC_COMPILE_IFELSE(
-                        AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
+                        [AC_LANG_PROGRAM(
+[[[
 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
 #  undef _FILE_OFFSET_BITS
 #  undef _LARGEFILE64_SOURCE
 #endif
 #include <sys/stat.h>
-#include <sys/swap.h>]],
-                                [[
-                                int num = swapctl(0, NULL,0);
-                                ]]
-                        ),
+#include <sys/swap.h>
+]]],
+[[[
+int num = swapctl(0, NULL, 0);
+]]]
+                        )],
                         [c_cv_have_swapctl_three_args="yes"],
                         [c_cv_have_swapctl_three_args="no"]
                 )
@@ -773,19 +833,19 @@ AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated
 if test "x$nan_type" = "xnone"; then
   AC_CACHE_CHECK([whether NAN is defined by default],
     [c_cv_have_nan_default],
-    AC_COMPILE_IFELSE(
-      AC_LANG_PROGRAM(
-      [[
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <math.h>
 static double foo = NAN;
-      ]],
-      [[
+]]],
+[[[
        if (isnan (foo))
         return 0;
        else
        return 1;
-      ]]),
+]]]
+      )],
       [c_cv_have_nan_default="yes"],
       [c_cv_have_nan_default="no"]
     )
@@ -798,20 +858,20 @@ fi
 if test "x$nan_type" = "xnone"; then
   AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
     [c_cv_have_nan_isoc],
-    AC_COMPILE_IFELSE(
-      AC_LANG_PROGRAM(
-      [[
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #define __USE_ISOC99 1
 #include <math.h>
 static double foo = NAN;
-      ]],
-      [[
+]]],
+[[[
        if (isnan (foo))
         return 0;
        else
        return 1;
-      ]]),
+]]]
+      )],
       [c_cv_have_nan_isoc="yes"],
       [c_cv_have_nan_isoc="no"]
     )
@@ -826,9 +886,8 @@ if test "x$nan_type" = "xnone"; then
   LDFLAGS="$LDFLAGS -lm"
   AC_CACHE_CHECK([whether NAN can be defined by 0/0],
     [c_cv_have_nan_zero],
-    AC_RUN_IFELSE(
-      AC_LANG_PROGRAM(
-      [[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <math.h>
 #ifdef NAN
@@ -839,13 +898,14 @@ if test "x$nan_type" = "xnone"; then
 # define isnan(f) ((f) != (f))
 #endif
 static double foo = NAN;
-      ]],
-      [[
+]]],
+[[[
        if (isnan (foo))
         return 0;
        else
        return 1;
-      ]]),
+]]]
+      )],
       [c_cv_have_nan_zero="yes"],
       [c_cv_have_nan_zero="no"]
     )
@@ -887,9 +947,8 @@ fi; fi; fi
 if test "x$fp_layout_type" = "xunknown"; then
   AC_CACHE_CHECK([if doubles are stored in x86 representation],
     [c_cv_fp_layout_need_nothing],
-    AC_RUN_IFELSE(
-      AC_LANG_PROGRAM(
-      [[[[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -902,8 +961,8 @@ if test "x$fp_layout_type" = "xunknown"; then
 #if HAVE_STDBOOL_H
 # include <stdbool.h>
 #endif
-      ]]]],
-      [[[[
+]]],
+[[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
@@ -922,7 +981,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                return (0);
        else
                return (1);
-      ]]]]),
+]]]
+      )],
       [c_cv_fp_layout_need_nothing="yes"],
       [c_cv_fp_layout_need_nothing="no"]
     )
@@ -934,9 +994,8 @@ fi
 if test "x$fp_layout_type" = "xunknown"; then
   AC_CACHE_CHECK([if endianflip converts to x86 representation],
     [c_cv_fp_layout_need_endianflip],
-    AC_RUN_IFELSE(
-      AC_LANG_PROGRAM(
-      [[[[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -957,8 +1016,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                        (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
                        (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
                        (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
-      ]]]],
-      [[[[
+]]],
+[[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
@@ -977,7 +1036,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                return (0);
        else
                return (1);
-      ]]]]),
+]]]
+      )],
       [c_cv_fp_layout_need_endianflip="yes"],
       [c_cv_fp_layout_need_endianflip="no"]
     )
@@ -989,9 +1049,8 @@ fi
 if test "x$fp_layout_type" = "xunknown"; then
   AC_CACHE_CHECK([if intswap converts to x86 representation],
     [c_cv_fp_layout_need_intswap],
-    AC_RUN_IFELSE(
-      AC_LANG_PROGRAM(
-      [[[[
+    AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -1006,8 +1065,8 @@ if test "x$fp_layout_type" = "xunknown"; then
 #endif
 #define intswap(A)    ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
                        (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
-      ]]]],
-      [[[[
+]]],
+[[[
        uint64_t i0;
        uint64_t i1;
        uint8_t c[8];
@@ -1026,7 +1085,8 @@ if test "x$fp_layout_type" = "xunknown"; then
                return (0);
        else
                return (1);
-      ]]]]),
+]]]
+      )],
       [c_cv_fp_layout_need_intswap="yes"],
       [c_cv_fp_layout_need_intswap="no"]
     )
@@ -1072,15 +1132,17 @@ if test "x$have_getmntent" = "xc"; then
        AC_CACHE_CHECK([whether getmntent takes one argument],
                [c_cv_have_one_getmntent],
                AC_COMPILE_IFELSE(
-                       AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
-#include "$srcdir/src/utils_mount.h"]],
-                               [[
-                                FILE *fh;
-                                struct mntent *me;
-                                fh = setmntent ("/etc/mtab", "r");
-                                me = getmntent (fh);
-                               ]]
-                       ),
+                       [AC_LANG_PROGRAM(
+[[[
+#include "$srcdir/src/utils_mount.h"
+]]],
+[[[
+FILE *fh;
+struct mntent *me;
+fh = setmntent ("/etc/mtab", "r");
+me = getmntent (fh);
+]]]
+                       )],
                        [c_cv_have_one_getmntent="yes"],
                        [c_cv_have_one_getmntent="no"]
                )
@@ -1088,16 +1150,18 @@ if test "x$have_getmntent" = "xc"; then
        AC_CACHE_CHECK([whether getmntent takes two arguments],
                [c_cv_have_two_getmntent],
                AC_COMPILE_IFELSE(
-                       AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
-#include "$srcdir/src/utils_mount.h"]],
-                               [[
+                       [AC_LANG_PROGRAM(
+[[[
+#include "$srcdir/src/utils_mount.h"
+]]],
+[[[
                                 FILE *fh;
                                 struct mnttab mt;
                                 int status;
                                 fh = fopen ("/etc/mnttab", "r");
                                 status = getmntent (fh, &mt);
-                               ]]
-                       ),
+]]]
+                       )],
                        [c_cv_have_two_getmntent="yes"],
                        [c_cv_have_two_getmntent="no"]
                )
@@ -1133,17 +1197,19 @@ fi
 AC_MSG_CHECKING([if have htonll defined])
 
     have_htonll="no"
-    AC_LINK_IFELSE([
-       AC_LANG_PROGRAM([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <sys/types.h>
 #include <netinet/in.h>
 #if HAVE_INTTYPES_H
 # include <inttypes.h>
 #endif
-       ], [
+]]],
+[[[
           return htonll(0);
-       ])
-    ], [
+]]]
+    )],
+    [
       have_htonll="yes"
       AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
     ])
@@ -1186,7 +1252,6 @@ AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct
                have_struct_kinfo_proc_freebsd="no"
        ],
        [
-AC_INCLUDES_DEFAULT
 #include <kvm.h>
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -1203,7 +1268,6 @@ AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
                have_struct_kinfo_proc_openbsd="no"
        ],
        [
-AC_INCLUDES_DEFAULT
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <kvm.h>
@@ -1264,6 +1328,7 @@ AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, ks
 #
 # Checks for libraries begin here
 #
+
 with_libresolv="yes"
 AC_CHECK_LIB(resolv, res_search,
 [
@@ -1934,31 +1999,31 @@ then
        if test -d "$with_java_home"
        then
                AC_MSG_CHECKING([for jni.h])
-               TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
-               if test "x$TMPDIR" != "x"
+               TMPVAR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               if test "x$TMPVAR" != "x"
                then
-                       AC_MSG_RESULT([found in $TMPDIR])
-                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
+                       AC_MSG_RESULT([found in $TMPVAR])
+                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
                else
                        AC_MSG_RESULT([not found])
                fi
 
                AC_MSG_CHECKING([for jni_md.h])
-               TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
-               if test "x$TMPDIR" != "x"
+               TMPVAR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               if test "x$TMPVAR" != "x"
                then
-                       AC_MSG_RESULT([found in $TMPDIR])
-                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
+                       AC_MSG_RESULT([found in $TMPVAR])
+                       JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
                else
                        AC_MSG_RESULT([not found])
                fi
 
                AC_MSG_CHECKING([for libjvm.so])
-               TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
-               if test "x$TMPDIR" != "x"
+               TMPVAR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               if test "x$TMPVAR" != "x"
                then
-                       AC_MSG_RESULT([found in $TMPDIR])
-                       JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
+                       AC_MSG_RESULT([found in $TMPVAR])
+                       JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
                else
                        AC_MSG_RESULT([not found])
                fi
@@ -1966,10 +2031,10 @@ then
                if test "x$JAVAC" = "x"
                then
                        AC_MSG_CHECKING([for javac])
-                       TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
-                       if test "x$TMPDIR" != "x"
+                       TMPVAR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
+                       if test "x$TMPVAR" != "x"
                        then
-                               JAVAC="$TMPDIR"
+                               JAVAC="$TMPVAR"
                                AC_MSG_RESULT([$JAVAC])
                        else
                                AC_MSG_RESULT([not found])
@@ -1978,10 +2043,10 @@ then
                if test "x$JAR" = "x"
                then
                        AC_MSG_CHECKING([for jar])
-                       TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
-                       if test "x$TMPDIR" != "x"
+                       TMPVAR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
+                       if test "x$TMPVAR" != "x"
                        then
-                               JAR="$TMPDIR"
+                               JAR="$TMPVAR"
                                AC_MSG_RESULT([$JAR])
                        else
                                AC_MSG_RESULT([not found])
@@ -2160,21 +2225,21 @@ then
 fi
 if test "x$with_libmodbus" = "xuse_pkgconfig"
 then
-       AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
-       $PKG_CONFIG --exists 'modbus' 2>/dev/null
+       AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
+       $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
        if test $? -ne 0
        then
-               with_libmodbus="no (pkg-config doesn't know modbus)"
+               with_libmodbus="no (pkg-config doesn't know libmodbus)"
        fi
 fi
 if test "x$with_libmodbus" = "xuse_pkgconfig"
 then
-       with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
+       with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
        if test $? -ne 0
        then
                with_libmodbus="no ($PKG_CONFIG failed)"
        fi
-       with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
+       with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
        if test $? -ne 0
        then
                with_libmodbus="no ($PKG_CONFIG failed)"
@@ -2220,6 +2285,69 @@ then
 fi
 # }}}
 
+# --with-libmongoc {{{
+AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
+[
+ if test "x$withval" = "xyes"
+ then
+        with_libmongoc="yes"
+ else if test "x$withval" = "xno"
+ then
+        with_libmongoc="no"
+ else
+        with_libmongoc="yes"
+        LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
+        LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
+ fi; fi
+],
+[with_libmongoc="yes"])
+
+SAVE_CPPFLAGS="$CPPFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+
+CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
+LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
+
+if test "x$with_libmongoc" = "xyes"
+then
+       if test "x$LIBMONGOC_CPPFLAGS" != "x"
+       then
+               AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
+       fi
+       AC_CHECK_HEADERS(mongo.h,
+       [with_libmongoc="yes"],
+       [with_libmongoc="no ('mongo.h' not found)"],
+[#if HAVE_STDINT_H
+# define MONGO_HAVE_STDINT 1
+#else
+# define MONGO_USE_LONG_LONG_INT 1
+#endif
+])
+fi
+if test "x$with_libmongoc" = "xyes"
+then
+       if test "x$LIBMONGOC_LDFLAGS" != "x"
+       then
+               AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
+       fi
+       AC_CHECK_LIB(mongoc, mongo_run_command,
+       [with_libmongoc="yes"],
+       [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
+fi
+
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
+
+if test "x$with_libmongoc" = "xyes"
+then
+       BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
+       BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
+       AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
+       AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
+# }}}
+
 # --with-libmysql {{{
 with_mysql_config="mysql_config"
 with_mysql_cflags=""
@@ -2360,37 +2488,37 @@ then
 #include <asm/types.h>
 #include <sys/socket.h>])
 
-       AC_COMPILE_IFELSE(
-[#include <stdio.h>
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
+#include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
-
-int main (void)
-{
-       int retval = TCA_STATS2;
-       return (retval);
-}],
-       [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
-       []);
-
-       AC_COMPILE_IFELSE(
-[#include <stdio.h>
+]]],
+[[[
+int retval = TCA_STATS2;
+return (retval);
+]]]
+       )],
+       [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
+
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
+#include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
-
-int main (void)
-{
-       int retval = TCA_STATS;
-       return (retval);
-}],
-       [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
-       []);
+]]],
+[[[
+int retval = TCA_STATS;
+return (retval);
+]]]
+       )],
+       [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
 
        CFLAGS="$SAVE_CFLAGS"
 fi
@@ -2410,8 +2538,9 @@ then
                [if function 'rtnl_dump_filter' expects five arguments],
                [c_cv_rtnl_dump_filter_five_args],
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-                               [
-AC_INCLUDES_DEFAULT
+[[[
+#include <stdio.h>
+#include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #if HAVE_LIBNETLINK_H
@@ -2421,24 +2550,25 @@ AC_INCLUDES_DEFAULT
 #elif HAVE_LINUX_LIBNETLINK_H
 # include <linux/libnetlink.h>
 #endif
-                               ],
-                               [
+]]],
+[[[
 if (rtnl_dump_filter(NULL, NULL, NULL, NULL, NULL))
        return 1;
 return 0;
-                               ]
-                       )],
-                       [c_cv_rtnl_dump_filter_five_args="yes"],
-                       [c_cv_rtnl_dump_filter_five_args="no"]
-               )
+]]]
+       )],
+       [c_cv_rtnl_dump_filter_five_args="yes"],
+       [c_cv_rtnl_dump_filter_five_args="no"]
        )
+)
 
        AC_CACHE_CHECK(
                [if function 'rtnl_dump_filter' expects three arguments],
                [c_cv_rtnl_dump_filter_three_args],
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-                               [
-AC_INCLUDES_DEFAULT
+[[[
+#include <stdio.h>
+#include <sys/types.h>
 #include <asm/types.h>
 #include <sys/socket.h>
 #if HAVE_LIBNETLINK_H
@@ -2448,17 +2578,17 @@ AC_INCLUDES_DEFAULT
 #elif HAVE_LINUX_LIBNETLINK_H
 # include <linux/libnetlink.h>
 #endif
-                               ],
-                               [
+]]],
+[[[
 if (rtnl_dump_filter(NULL, NULL, NULL))
        return 1;
 return 0;
-                               ]
-                       )],
-                       [c_cv_rtnl_dump_filter_three_args="yes"],
-                       [c_cv_rtnl_dump_filter_three_args="no"]
-               )
+]]]
+       )],
+       [c_cv_rtnl_dump_filter_three_args="yes"],
+       [c_cv_rtnl_dump_filter_three_args="no"]
        )
+)
 
        CFLAGS="$SAVE_CFLAGS"
 
@@ -2923,20 +3053,20 @@ dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string
 
   AC_CACHE_CHECK([for libperl],
     [c_cv_have_libperl],
-    AC_LINK_IFELSE(
-      AC_LANG_PROGRAM(
-      [[
+    AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #define PERL_NO_GET_CONTEXT
 #include <EXTERN.h>
 #include <perl.h>
 #include <XSUB.h>
-      ]],
-      [[
+]]],
+[[[
        dTHX;
        load_module (PERL_LOADMOD_NOIMPORT,
                         newSVpv ("Collectd::Plugin::FooBar", 24),
                         Nullsv);
-      ]]),
+]]]
+      )],
       [c_cv_have_libperl="yes"],
       [c_cv_have_libperl="no"]
     )
@@ -2968,9 +3098,8 @@ then
 
        AC_CACHE_CHECK([if perl supports ithreads],
                [c_cv_have_perl_ithreads],
-               AC_LINK_IFELSE(
-                       AC_LANG_PROGRAM(
-                       [[
+               AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #include <EXTERN.h>
 #include <perl.h>
 #include <XSUB.h>
@@ -2978,8 +3107,9 @@ then
 #if !defined(USE_ITHREADS)
 # error "Perl does not support ithreads!"
 #endif /* !defined(USE_ITHREADS) */
-                       ]],
-                       [[ ]]),
+]]],
+[[[ ]]]
+                       )],
                        [c_cv_have_perl_ithreads="yes"],
                        [c_cv_have_perl_ithreads="no"]
                )
@@ -3005,20 +3135,20 @@ then
 
        AC_CACHE_CHECK([for broken Perl_load_module()],
                [c_cv_have_broken_perl_load_module],
-               AC_LINK_IFELSE(
-                       AC_LANG_PROGRAM(
-                       [[
+               AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[[
 #define PERL_NO_GET_CONTEXT
 #include <EXTERN.h>
 #include <perl.h>
 #include <XSUB.h>
-                       ]],
-                       [[
+]]],
+[[[
                         dTHX;
                         load_module (PERL_LOADMOD_NOIMPORT,
                             newSVpv ("Collectd::Plugin::FooBar", 24),
                             Nullsv);
-                       ]]),
+]]]
+                       )],
                        [c_cv_have_broken_perl_load_module="no"],
                        [c_cv_have_broken_perl_load_module="yes"]
                )
@@ -4087,10 +4217,9 @@ then
        CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
        #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
 
-       AC_CHECK_LIB(varnishapi, VSL_OpenStats,
-                    [with_libvarnish="yes"],
-                    [with_libvarnish="no (symbol VSL_OpenStats not found)"],
-                    [$with_libvarnish_libs])
+    AC_CHECK_HEADERS(varnish/vsc.h,
+        [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
+        [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
 
        CPPFLAGS="$SAVE_CPPFLAGS"
        #LDFLAGS="$SAVE_LDFLAGS"
@@ -4448,6 +4577,8 @@ plugin_curl_xml="no"
 plugin_df="no"
 plugin_disk="no"
 plugin_entropy="no"
+plugin_ethstat="no"
+plugin_fscache="no"
 plugin_interface="no"
 plugin_ipmi="no"
 plugin_ipvs="no"
@@ -4457,7 +4588,7 @@ plugin_load="no"
 plugin_memory="no"
 plugin_multimeter="no"
 plugin_nfs="no"
-plugin_fscache="no"
+plugin_numa="no"
 plugin_perl="no"
 plugin_processes="no"
 plugin_protocols="no"
@@ -4484,12 +4615,13 @@ then
        plugin_cpufreq="yes"
        plugin_disk="yes"
        plugin_entropy="yes"
+       plugin_fscache="yes"
        plugin_interface="yes"
        plugin_irq="yes"
        plugin_load="yes"
        plugin_memory="yes"
        plugin_nfs="yes"
-       plugin_fscache="yes"
+       plugin_numa="yes"
        plugin_processes="yes"
        plugin_protocols="yes"
        plugin_serial="yes"
@@ -4520,14 +4652,22 @@ then
 fi
 
 # AIX
+
+if test "x$ac_system" = "xAIX"
+then
+        plugin_tcpconns="yes"
+fi
+
 if test "x$with_perfstat" = "xyes"
 then
        plugin_cpu="yes"
+       plugin_contextswitch="yes"
        plugin_disk="yes"
        plugin_memory="yes"
        plugin_swap="yes"
        plugin_interface="yes"
        plugin_load="yes"
+       plugin_uptime="yes"
 fi
 
 if test "x$with_procinfo" = "xyes"
@@ -4538,6 +4678,7 @@ fi
 # Solaris
 if test "x$with_kstat" = "xyes"
 then
+       plugin_nfs="yes"
        plugin_uptime="yes"
        plugin_zfs_arc="yes"
 fi
@@ -4644,6 +4785,11 @@ then
        fi
 fi
 
+if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
+then
+       plugin_ethstat="yes"
+fi
+
 if test "x$have_getifaddrs" = "xyes"
 then
        plugin_interface="yes"
@@ -4731,6 +4877,7 @@ AC_ARG_ENABLE([all-plugins],
 
 m4_divert_once([HELP_ENABLE], [])
 
+AC_PLUGIN([aggregation], [yes],                [Aggregation plugin])
 AC_PLUGIN([amqp],        [$with_librabbitmq],  [AMQP output plugin])
 AC_PLUGIN([apache],      [$with_libcurl],      [Apache httpd statistics])
 AC_PLUGIN([apcups],      [yes],                [Statistics of UPSes by APC])
@@ -4752,6 +4899,7 @@ 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([ethstat],     [$plugin_ethstat],    [Stats from NIC driver])
 AC_PLUGIN([exec],        [yes],                [Execution of external programs])
 AC_PLUGIN([filecount],   [yes],                [Count files in directories])
 AC_PLUGIN([fscache],     [$plugin_fscache],    [fscache statistics])
@@ -4774,6 +4922,7 @@ AC_PLUGIN([match_regex], [yes],                [The regex match])
 AC_PLUGIN([match_timediff], [yes],             [The timediff match])
 AC_PLUGIN([match_value], [yes],                [The value match])
 AC_PLUGIN([mbmon],       [yes],                [Query mbmond])
+AC_PLUGIN([md],          [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
 AC_PLUGIN([memcachec],   [$with_libmemcached], [memcachec statistics])
 AC_PLUGIN([memcached],   [yes],                [memcached statistics])
 AC_PLUGIN([memory],      [$plugin_memory],     [Memory usage])
@@ -4788,12 +4937,14 @@ AC_PLUGIN([nginx],       [$with_libcurl],      [nginx statistics])
 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
 AC_PLUGIN([notify_email], [$with_libesmtp],    [Email notifier])
 AC_PLUGIN([ntpd],        [yes],                [NTPd statistics])
+AC_PLUGIN([numa],        [$plugin_numa],       [NUMA virtual memory statistics])
 AC_PLUGIN([nut],         [$with_libupsclient], [Network UPS tools statistics])
 AC_PLUGIN([olsrd],       [yes],                [olsrd statistics])
 AC_PLUGIN([onewire],     [$with_libowcapi],    [OneWire sensor statistics])
 AC_PLUGIN([openvpn],     [yes],                [OpenVPN client statistics])
 AC_PLUGIN([oracle],      [$with_oracle],       [Oracle plugin])
 AC_PLUGIN([perl],        [$plugin_perl],       [Embed a Perl interpreter])
+AC_PLUGIN([pf],          [$have_net_pfvar_h],  [BSD packet filter (PF) statistics])
 # FIXME: Check for libevent, too.
 AC_PLUGIN([pinba],       [$have_protoc_c],     [Pinba statistics])
 AC_PLUGIN([ping],        [$with_liboping],     [Network latency statistics])
@@ -4833,8 +4984,10 @@ AC_PLUGIN([varnish],     [$with_libvarnish],   [Varnish cache statistics])
 AC_PLUGIN([vmem],        [$plugin_vmem],       [Virtual memory statistics])
 AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
 AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
+AC_PLUGIN([write_graphite], [yes],             [Graphite / Carbon output plugin])
 AC_PLUGIN([write_http],  [$with_libcurl],      [HTTP output plugin])
 AC_PLUGIN([write_redis], [$with_libcredis],    [Redis output plugin])
+AC_PLUGIN([write_mongodb], [$with_libmongoc],  [MongoDB output plugin])
 AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
 AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
 
@@ -4931,6 +5084,7 @@ then
 fi
 
 dnl Perl bindings
+PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
 [
        if test "x$withval" != "xno" && test "x$withval" != "xyes"
@@ -4938,12 +5092,10 @@ AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@
                PERL_BINDINGS_OPTIONS="$withval"
                with_perl_bindings="yes"
        else
-               PERL_BINDINGS_OPTIONS=""
                with_perl_bindings="$withval"
        fi
 ],
 [
-       PERL_BINDINGS_OPTIONS=""
        if test -n "$perl_interpreter"
        then
                with_perl_bindings="yes"
@@ -4975,9 +5127,9 @@ AC_SUBST(LCC_VERSION_PATCH)
 AC_SUBST(LCC_VERSION_EXTRA)
 AC_SUBST(LCC_VERSION_STRING)
 
-AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
+AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
 
-AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
+AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
 
 if test "x$with_librrd" = "xyes" \
        && test "x$librrd_threadsafe" != "xyes"
@@ -5058,6 +5210,7 @@ Configuration:
     perl  . . . . . . . . $with_perl_bindings
 
   Modules:
+    aggregation . . . . . $enable_aggregation
     amqp    . . . . . . . $enable_amqp
     apache  . . . . . . . $enable_apache
     apcups  . . . . . . . $enable_apcups
@@ -5079,6 +5232,7 @@ Configuration:
     dns . . . . . . . . . $enable_dns
     email . . . . . . . . $enable_email
     entropy . . . . . . . $enable_entropy
+    ethstat . . . . . . . $enable_ethstat
     exec  . . . . . . . . $enable_exec
     filecount . . . . . . $enable_filecount
     fscache . . . . . . . $enable_fscache
@@ -5101,6 +5255,7 @@ Configuration:
     match_timediff  . . . $enable_match_timediff
     match_value . . . . . $enable_match_value
     mbmon . . . . . . . . $enable_mbmon
+    md  . . . . . . . . . $enable_md
     memcachec . . . . . . $enable_memcachec
     memcached . . . . . . $enable_memcached
     memory  . . . . . . . $enable_memory
@@ -5115,12 +5270,14 @@ Configuration:
     notify_desktop  . . . $enable_notify_desktop
     notify_email  . . . . $enable_notify_email
     ntpd  . . . . . . . . $enable_ntpd
+    numa  . . . . . . . . $enable_numa
     nut . . . . . . . . . $enable_nut
     olsrd . . . . . . . . $enable_olsrd
     onewire . . . . . . . $enable_onewire
     openvpn . . . . . . . $enable_openvpn
     oracle  . . . . . . . $enable_oracle
     perl  . . . . . . . . $enable_perl
+    pf  . . . . . . . . . $enable_pf
     pinba . . . . . . . . $enable_pinba
     ping  . . . . . . . . $enable_ping
     postgresql  . . . . . $enable_postgresql
@@ -5159,8 +5316,10 @@ Configuration:
     vmem  . . . . . . . . $enable_vmem
     vserver . . . . . . . $enable_vserver
     wireless  . . . . . . $enable_wireless
+    write_graphite  . . . $enable_write_graphite
     write_http  . . . . . $enable_write_http
     write_redis . . . . . $enable_write_redis
+    write_mongodb . . . . $enable_write_mongodb
     xmms  . . . . . . . . $enable_xmms
     zfs_arc . . . . . . . $enable_zfs_arc