Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git] / configure.ac
index 2ef82ee..9112a91 100644 (file)
@@ -4,6 +4,11 @@ AC_CONFIG_SRCDIR(src/)
 AC_CONFIG_HEADERS(src/config.h)
 AC_CONFIG_AUX_DIR([libltdl/config])
 
+dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
+dnl we don't really need the 'u' even in older toolchains.  Then there is
+dnl older libtool, which spelled it AR_FLAGS
+m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
+
 m4_ifdef([LT_PACKAGE_VERSION],
        # libtool >= 2.2
        [
@@ -24,6 +29,8 @@ m4_ifdef([LT_PACKAGE_VERSION],
        ]
 )
 
+AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
+
 AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_LANG(C)
@@ -37,6 +44,7 @@ AC_SYS_LARGEFILE
 #
 AC_PROG_CC
 AC_PROG_CPP
+AC_PROG_EGREP
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
@@ -47,15 +55,42 @@ AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 AC_PROG_LEX
 AC_PROG_YACC
+
+# Warn when pkg.m4 is missing
+m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
+
 PKG_PROG_PKG_CONFIG
 
+AC_CACHE_CHECK([if bison is the parser generator],
+       [collectd_cv_prog_bison],
+       [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
+               [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
+       )]
+)
+
+if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
+then
+       AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
+fi
+
 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
-AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
-                 [have_protobuf_c_h="yes"],
-                 [have_protobuf_c_h="no"])
-if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
+if test "x$have_protoc_c" = "xno"
 then
-       have_protoc_c="no (unable to find <google/protobuf-c/protobuf-c.h>)"
+       have_protoc_c="no (protoc-c compiler not found)"
+fi
+
+if test "x$have_protoc_c" = "xyes"
+then
+       AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
+                        [have_protoc_c="yes"; break],
+                        [have_protoc_c="no (<google/protobuf-c/protobuf-c.h> not found)"])
+fi
+if test "x$have_protoc_c" = "xyes"
+then
+       AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
+                    [have_protoc_c="yes"],
+                    [have_protoc_c="no (libprotobuf-c not found)"])
+
 fi
 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
 
@@ -90,12 +125,12 @@ case $host_os in
 esac
 AC_MSG_RESULT([$ac_system])
 
-AM_CONDITIONAL([BUILD_LINUX],[test "x$x$ac_system" = "xLinux"])
-AM_CONDITIONAL([BUILD_SOLARIS],[test "x$x$ac_system" = "xSolaris"])
-AM_CONDITIONAL([BUILD_DARWIN],[test "x$x$ac_system" = "xDarwin"])
-AM_CONDITIONAL([BUILD_OPENBSD],[test "x$x$ac_system" = "xOpenBSD"])
-AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
-AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
+AM_CONDITIONAL([BUILD_LINUX],[test "x$ac_system" = "xLinux"])
+AM_CONDITIONAL([BUILD_SOLARIS],[test "x$ac_system" = "xSolaris"])
+AM_CONDITIONAL([BUILD_DARWIN],[test "x$ac_system" = "xDarwin"])
+AM_CONDITIONAL([BUILD_OPENBSD],[test "x$ac_system" = "xOpenBSD"])
+AM_CONDITIONAL([BUILD_AIX],[test "x$ac_system" = "xAIX"])
+AM_CONDITIONAL([BUILD_FREEBSD],[test "x$ac_system" = "xFreeBSD"])
 
 if test "x$ac_system" = "xLinux"
 then
@@ -113,7 +148,20 @@ if test "x$ac_system" = "xSolaris"
 then
        AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
        AC_DEFINE(_REENTRANT,               1, [Define to enable reentrancy interfaces.])
+
+       AC_MSG_CHECKING([whether compiler builds 64bit binaries])
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+                          #ifndef _LP64
+                          # error "Compiler not in 64bit mode."
+                          #endif
+                          ])],
+                          [AC_MSG_RESULT([yes])],
+                          [
+                           AC_MSG_RESULT([no])
+                           AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
+                          ])
 fi
+
 if test "x$ac_system" = "xAIX"
 then
        AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
@@ -285,6 +333,54 @@ AC_CHECK_HEADERS(netinet/udp.h, [], [],
 #endif
 ])
 
+have_ip6_ext="no"
+AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+# include <netinet/ip6.h>
+#endif
+])
+
+if test "x$have_ip6_ext" = "xno"; then
+       SAVE_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -DSOLARIS2=8"
+
+       AC_CHECK_TYPES([struct ip6_ext],
+                      [have_ip6_ext="yes, with -DSOLARIS2=8"],
+                      [have_ip6_ext="no"],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+# include <netinet/ip6.h>
+#endif
+])
+
+       if test "x$have_ip6_ext" = "xno"; then
+               CFLAGS="$SAVE_CFLAGS"
+       fi
+fi
+
 # For cpu modules
 AC_CHECK_HEADERS(sys/dkstat.h)
 if test "x$ac_system" = "xDarwin"
@@ -376,18 +472,6 @@ AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
 #endif
 ])
 
-if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
-then
-       hint_64=""
-       if test "x$GCC" = "xyes"
-       then
-               hint_64="CFLAGS='-m64'"
-       else
-               hint_64="CFLAGS='-xarch=v9'"
-       fi
-       AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
-fi
-
 # For load module
 # For the processes plugin
 # For users module
@@ -583,6 +667,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
 #if HAVE_NET_IF_H
 # include <net/if.h>
 #endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 ])
 
 # For the multimeter plugin
@@ -593,10 +680,23 @@ AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
 have_asm_msrindex_h="no"
 AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
 
-have_usable_asm_msrindex_h="no"
 if test "x$have_asm_msrindex_h" = "xyes"
 then
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include<asm/msr-index.h>]],[[int y = MSR_CORE_C3_RESIDENCY;]])], [have_usable_asm_msrindex_h="yes"])
+  AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY],
+                 [c_cv_have_usable_asm_msrindex_h],
+                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
+#include<asm/msr-index.h>
+]]],
+[[[
+int y = MSR_PKG_C10_RESIDENCY;
+return(y);
+]]]
+  )],
+                 [c_cv_have_usable_asm_msrindex_h="yes"],
+                 [c_cv_have_usable_asm_msrindex_h="no"],
+                                  )
+                 )
 fi
 
 have_cpuid_h="no"
@@ -1182,6 +1282,8 @@ have_getvfsstat="no"
 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
 have_listmntent="no"
 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
+have_getmntent_r="no"
+AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
 
 have_getmntent="no"
 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
@@ -1208,6 +1310,7 @@ FILE *fh;
 struct mntent *me;
 fh = setmntent ("/etc/mtab", "r");
 me = getmntent (fh);
+return(me->mnt_passno);
 ]]]
                        )],
                        [c_cv_have_one_getmntent="yes"],
@@ -1227,6 +1330,7 @@ me = getmntent (fh);
                                 int status;
                                 fh = fopen ("/etc/mnttab", "r");
                                 status = getmntent (fh, &mt);
+                                return(status);
 ]]]
                        )],
                        [c_cv_have_two_getmntent="yes"],
@@ -1718,6 +1822,10 @@ then
                 [have_curlopt_username="yes"],
                 [have_curlopt_username="no"],
                 [[#include <curl/curl.h>]])
+               AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
+                [have_curlopt_timeout="yes"],
+                [have_curlopt_timeout="no"],
+                [[#include <curl/curl.h>]])
        fi
 fi
 if test "x$with_libcurl" = "xyes"
@@ -1731,6 +1839,11 @@ then
        then
                AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
        fi
+
+       if test "x$have_curlopt_timeout" = "xyes"
+       then
+               AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
+       fi
 fi
 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
 # }}}
@@ -1769,7 +1882,6 @@ then
        LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
 
        AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
-       AC_CHECK_LIB(dbi, dbi_driver_open_r, [with_libdbi_r="yes"], [with_libdbi_r="no"])
 
        CPPFLAGS="$SAVE_CPPFLAGS"
        LDFLAGS="$SAVE_LDFLAGS"
@@ -1782,11 +1894,6 @@ then
        AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
        AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
        AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
-
-  if test "x$with_libdbi_r" = "xyes"
-  then
-               AC_DEFINE(HAVE_LIBDBI_R, 1, [Define if reentrant dbi facility is present and usable.])
-  fi
 fi
 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
 # }}}
@@ -1848,30 +1955,33 @@ AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Pat
         GANGLIA_LDFLAGS="-L$withval/lib"
         with_libganglia="yes"
  else
-        with_libganglia_config="ganglia-config"
         with_libganglia="$withval"
  fi; fi; fi
 ],
 [
- with_libganglia_config="ganglia-config"
  with_libganglia="yes"
 ])
 
-if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
+if test "x$with_libganglia" = "xyes"
 then
-       if test "x$GANGLIA_CPPFLAGS" = "x"
+       if test "x$with_libganglia_config" != "x"
        then
-               GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
-       fi
+               if test "x$GANGLIA_CPPFLAGS" = "x"
+               then
+                       GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
+               fi
 
-       if test "x$GANGLIA_LDFLAGS" = "x"
-       then
-               GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
-       fi
+               if test "x$GANGLIA_LDFLAGS" = "x"
+               then
+                       GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
+               fi
 
-       if test "x$GANGLIA_LIBS" = "x"
-       then
-               GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
+               if test "x$GANGLIA_LIBS" = "x"
+               then
+                       GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
+               fi
+       else
+               GANGLIA_LIBS="-lganglia"
        fi
 fi
 
@@ -1943,12 +2053,6 @@ then
                GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
        fi
 
-       if test "x$GCRYPT_LDFLAGS" = "x"
-       then
-               gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
-               GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
-       fi
-
        if test "x$GCRYPT_LIBS" = "x"
        then
                GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
@@ -1957,8 +2061,10 @@ fi
 
 SAVE_CPPFLAGS="$CPPFLAGS"
 SAVE_LDFLAGS="$LDFLAGS"
+SAVE_LIBS="$LIBS"
 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
+LIBS="$LIBS $GCRYPT_LIBS"
 
 if test "x$with_libgcrypt" = "xyes"
 then
@@ -1973,10 +2079,6 @@ fi
 
 if test "x$with_libgcrypt" = "xyes"
 then
-       if test "x$GCRYPT_LDFLAGS" != "x"
-       then
-               AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
-       fi
        AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
                [with_libgcrypt="yes"],
                [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
@@ -1990,6 +2092,7 @@ fi
 
 CPPFLAGS="$SAVE_CPPFLAGS"
 LDFLAGS="$SAVE_LDFLAGS"
+LIBS="$SAVE_LIBS"
 
 if test "x$with_libgcrypt" = "xyes"
 then
@@ -2099,6 +2202,10 @@ fi
 
 # --with-java {{{
 with_java_home="$JAVA_HOME"
+if test "x$with_java_home" = "x"
+then
+       with_java_home="/usr/lib/jvm"
+fi
 with_java_vmtype="client"
 with_java_cflags=""
 with_java_libs=""
@@ -2123,7 +2230,7 @@ then
        if test -d "$with_java_home"
        then
                AC_MSG_CHECKING([for jni.h])
-               TMPVAR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               TMPVAR=`find -L "$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 $TMPVAR])
@@ -2133,7 +2240,7 @@ then
                fi
 
                AC_MSG_CHECKING([for jni_md.h])
-               TMPVAR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               TMPVAR=`find -L "$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 $TMPVAR])
@@ -2143,7 +2250,7 @@ then
                fi
 
                AC_MSG_CHECKING([for libjvm.so])
-               TMPVAR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+               TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
                if test "x$TMPVAR" != "x"
                then
                        AC_MSG_RESULT([found in $TMPVAR])
@@ -2155,7 +2262,7 @@ then
                if test "x$JAVAC" = "x"
                then
                        AC_MSG_CHECKING([for javac])
-                       TMPVAR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
+                       TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
                        if test "x$TMPVAR" != "x"
                        then
                                JAVAC="$TMPVAR"
@@ -2167,7 +2274,7 @@ then
                if test "x$JAR" = "x"
                then
                        AC_MSG_CHECKING([for jar])
-                       TMPVAR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
+                       TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
                        if test "x$TMPVAR" != "x"
                        then
                                JAR="$TMPVAR"
@@ -2491,7 +2598,7 @@ then
        SAVE_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
 
-       AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
+       AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
 
        CPPFLAGS="$SAVE_CPPFLAGS"
 fi
@@ -2610,7 +2717,7 @@ AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to
 ])
 if test "x$with_libmysql" = "xyes"
 then
-       with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
+       with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
        mysql_config_status=$?
 
        if test $mysql_config_status -ne 0
@@ -2646,15 +2753,17 @@ then
        then
                with_libmysql="no ($with_mysql_config failed)"
        else
-               AC_CHECK_LIB(mysqlclient, mysql_init,
-                [with_libmysql="yes"],
-                [with_libmysql="no (symbol 'mysql_init' not found)"],
-                [$with_mysql_libs])
-
-               AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
+               SAVE_CPPFLAGS="$CPPFLAGS"
+               CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
+               SAVE_LIBS="$LIBS"
+               LIBS="$with_mysql_libs"
+               AC_SEARCH_LIBS([mysql_get_server_version],
+                [],
                 [with_libmysql="yes"],
                 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
-                [$with_mysql_libs])
+                [])
+               CPPFLAGS="$SAVE_CPPFLAGS"
+               LIBS="$SAVE_LIBS"
        fi
 fi
 if test "x$with_libmysql" = "xyes"
@@ -3174,11 +3283,6 @@ then
 fi
 if test "x$with_libpcap" = "xyes"
 then
-       AC_CHECK_HEADERS(pcap-bpf.h,,
-                        [with_libpcap="no (pcap-bpf.h not found)"])
-fi
-if test "x$with_libpcap" = "xyes"
-then
        AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
                       [c_cv_libpcap_have_pcap_error_iface_not_up],
                       AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
@@ -3187,6 +3291,7 @@ then
 ]]],
 [[[
   int val = PCAP_ERROR_IFACE_NOT_UP;
+  return(val);
 ]]]
                       )],
                       [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
@@ -3733,10 +3838,11 @@ fi
 # --with-librdkafka {{{
 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
 [
-  if test "x$withval" = "xno" && test "x$withval" != "xyes"
+  if test "x$withval" != "xno" && test "x$withval" != "xyes"
   then
     with_librdkafka_cppflags="-I$withval/include"
     with_librdkafka_ldflags="-L$withval/lib"
+    with_librdkafka_rpath="$withval/lib"
     with_librdkafka="yes"
   else
     with_librdkafka="$withval"
@@ -3748,6 +3854,9 @@ AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Pat
 SAVE_CPPFLAGS="$CPPFLAGS"
 SAVE_LDFLAGS="$LDFLAGS"
 
+CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
+LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
+
 if test "x$with_librdkafka" = "xyes"
 then
        AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
@@ -3757,13 +3866,18 @@ if test "x$with_librdkafka" = "xyes"
 then
        AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
   AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
-  AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
+  AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
 fi
 if test "x$with_librdkafka" = "xyes"
 then
        BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
        BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
-       BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
+       if test "x$with_librdkafka_rpath" != "x"
+       then
+               BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
+       else
+               BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
+       fi
        AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
        AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
        AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
@@ -4710,11 +4824,11 @@ then
 
        CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
 
-       AC_CHECK_HEADERS(varnish/vapi/vsc.h,
+       AC_CHECK_HEADERS(vapi/vsc.h,
                [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
-               [AC_CHECK_HEADERS(varnish/vsc.h,
+               [AC_CHECK_HEADERS(vsc.h,
                        [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
-                       [AC_CHECK_HEADERS(varnish/varnishapi.h,
+                       [AC_CHECK_HEADERS(varnishapi.h,
                                [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
                                [with_libvarnish="no (found none of the varnish header files)"])])])
 
@@ -5121,6 +5235,7 @@ plugin_ascent="no"
 plugin_barometer="no"
 plugin_battery="no"
 plugin_bind="no"
+plugin_ceph="no"
 plugin_cgroups="no"
 plugin_conntrack="no"
 plugin_contextswitch="no"
@@ -5133,6 +5248,7 @@ plugin_disk="no"
 plugin_drbd="no"
 plugin_entropy="no"
 plugin_ethstat="no"
+plugin_fhcount="no"
 plugin_fscache="no"
 plugin_interface="no"
 plugin_ipmi="no"
@@ -5175,8 +5291,10 @@ then
        plugin_disk="yes"
        plugin_drbd="yes"
        plugin_entropy="yes"
+       plugin_fhcount="yes"
        plugin_fscache="yes"
        plugin_interface="yes"
+       plugin_ipc="yes"
        plugin_irq="yes"
        plugin_load="yes"
        plugin_lvm="yes"
@@ -5199,7 +5317,7 @@ then
        then
                plugin_ipvs="yes"
        fi
-       if test "x$have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
+       if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
        then
                plugin_turbostat="yes"
        fi
@@ -5221,14 +5339,15 @@ fi
 
 if test "x$ac_system" = "xAIX"
 then
-        plugin_tcpconns="yes"
+       plugin_tcpconns="yes"
+       plugin_ipc="yes"
 fi
 
 # FreeBSD
 
 if test "x$ac_system" = "xFreeBSD"
 then
-        plugin_zfs_arc="yes"
+       plugin_zfs_arc="yes"
 fi
 
 
@@ -5253,6 +5372,7 @@ fi
 if test "x$with_kstat" = "xyes"
 then
        plugin_nfs="yes"
+       plugin_processes="yes"
        plugin_uptime="yes"
        plugin_zfs_arc="yes"
 fi
@@ -5319,6 +5439,11 @@ then
        plugin_curl_xml="yes"
 fi
 
+if test "x$with_libyajl" = "xyes"
+then
+       plugin_ceph="yes"
+fi
+
 if test "x$have_processor_info" = "xyes"
 then
        plugin_cpu="yes"
@@ -5362,6 +5487,11 @@ then
        plugin_df="yes"
 fi
 
+if test "x$c_cv_have_getmntent_r" = "xyes"
+then
+       plugin_df="yes"
+fi
+
 # Df plugin: Check if we have either `statfs' or `statvfs' second.
 if test "x$plugin_df" = "xyes"
 then
@@ -5491,6 +5621,7 @@ AC_PLUGIN([ascent],      [$plugin_ascent],     [AscentEmu player statistics])
 AC_PLUGIN([barometer],   [$plugin_barometer],  [Barometer sensor on I2C])
 AC_PLUGIN([battery],     [$plugin_battery],    [Battery statistics])
 AC_PLUGIN([bind],        [$plugin_bind],       [ISC Bind nameserver statistics])
+AC_PLUGIN([ceph],        [$plugin_ceph],       [Ceph daemon statistics])
 AC_PLUGIN([conntrack],   [$plugin_conntrack],  [nf_conntrack statistics])
 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
 AC_PLUGIN([cpufreq],     [$plugin_cpufreq],    [CPU frequency statistics])
@@ -5509,11 +5640,13 @@ 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([fhcount],     [$plugin_fhcount],    [File handles statistics])
 AC_PLUGIN([filecount],   [yes],                [Count files in directories])
 AC_PLUGIN([fscache],     [$plugin_fscache],    [fscache statistics])
 AC_PLUGIN([gmond],       [$with_libganglia],   [Ganglia plugin])
 AC_PLUGIN([hddtemp],     [yes],                [Query hddtempd])
 AC_PLUGIN([interface],   [$plugin_interface],  [Interface traffic statistics])
+AC_PLUGIN([ipc],         [$plugin_ipc],        [IPC statistics])
 AC_PLUGIN([ipmi],        [$plugin_ipmi],       [IPMI sensor statistics])
 AC_PLUGIN([iptables],    [$with_libiptc],      [IPTables rule counters])
 AC_PLUGIN([ipvs],        [$plugin_ipvs],       [IPVS connection statistics])
@@ -5608,6 +5741,7 @@ AC_PLUGIN([write_log], [yes],                  [Log output plugin])
 AC_PLUGIN([write_mongodb], [$with_libmongoc],  [MongoDB output plugin])
 AC_PLUGIN([write_redis], [$with_libhiredis],    [Redis output plugin])
 AC_PLUGIN([write_riemann], [$have_protoc_c],   [Riemann output plugin])
+AC_PLUGIN([write_sensu], [yes],                [Sensu output plugin])
 AC_PLUGIN([write_tsdb],  [yes],                [TSDB output plugin])
 AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
 AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
@@ -5798,10 +5932,11 @@ Configuration:
     libatasmart . . . . . $with_libatasmart
     libcurl . . . . . . . $with_libcurl
     libdbi  . . . . . . . $with_libdbi
-    libhiredis  . . . . . $with_libhiredis
     libesmtp  . . . . . . $with_libesmtp
     libganglia  . . . . . $with_libganglia
     libgcrypt . . . . . . $with_libgcrypt
+    libhal  . . . . . . . $with_libhal
+    libhiredis  . . . . . $with_libhiredis
     libi2c-dev  . . . . . $with_libi2c
     libiokit  . . . . . . $with_libiokit
     libiptc . . . . . . . $with_libiptc
@@ -5813,6 +5948,7 @@ Configuration:
     libmemcached  . . . . $with_libmemcached
     libmnl  . . . . . . . $with_libmnl
     libmodbus . . . . . . $with_libmodbus
+    libmongoc . . . . . . $with_libmongoc
     libmysql  . . . . . . $with_libmysql
     libnetapp . . . . . . $with_libnetapp
     libnetsnmp  . . . . . $with_libnetsnmp
@@ -5820,6 +5956,7 @@ Configuration:
     liboconfig  . . . . . $with_liboconfig
     libopenipmi . . . . . $with_libopenipmipthread
     liboping  . . . . . . $with_liboping
+    libowcapi . . . . . . $with_libowcapi
     libpcap . . . . . . . $with_libpcap
     libperfstat . . . . . $with_perfstat
     libperl . . . . . . . $with_libperl
@@ -5840,9 +5977,8 @@ Configuration:
     libxml2 . . . . . . . $with_libxml2
     libxmms . . . . . . . $with_libxmms
     libyajl . . . . . . . $with_libyajl
-    libevent  . . . . . . $with_libevent
-    protobuf-c  . . . . . $have_protoc_c
     oracle  . . . . . . . $with_oracle
+    protobuf-c  . . . . . $have_protoc_c
     python  . . . . . . . $with_python
 
   Features:
@@ -5857,15 +5993,16 @@ Configuration:
     amqp    . . . . . . . $enable_amqp
     apache  . . . . . . . $enable_apache
     apcups  . . . . . . . $enable_apcups
-    aquaero . . . . . . . $enable_aquaero
     apple_sensors . . . . $enable_apple_sensors
+    aquaero . . . . . . . $enable_aquaero
     ascent  . . . . . . . $enable_ascent
     barometer . . . . . . $enable_barometer
     battery . . . . . . . $enable_battery
     bind  . . . . . . . . $enable_bind
+    ceph  . . . . . . . . $enable_ceph
+    cgroups . . . . . . . $enable_cgroups
     conntrack . . . . . . $enable_conntrack
     contextswitch . . . . $enable_contextswitch
-    cgroups . . . . . . . $enable_cgroups
     cpu . . . . . . . . . $enable_cpu
     cpufreq . . . . . . . $enable_cpufreq
     csv . . . . . . . . . $enable_csv
@@ -5881,11 +6018,13 @@ Configuration:
     entropy . . . . . . . $enable_entropy
     ethstat . . . . . . . $enable_ethstat
     exec  . . . . . . . . $enable_exec
+    fhcount . . . . . . . $enable_fhcount
     filecount . . . . . . $enable_filecount
     fscache . . . . . . . $enable_fscache
     gmond . . . . . . . . $enable_gmond
     hddtemp . . . . . . . $enable_hddtemp
     interface . . . . . . $enable_interface
+    ipc . . . . . . . . . $enable_ipc
     ipmi  . . . . . . . . $enable_ipmi
     iptables  . . . . . . $enable_iptables
     ipvs  . . . . . . . . $enable_ipvs
@@ -5893,8 +6032,8 @@ Configuration:
     java  . . . . . . . . $enable_java
     load  . . . . . . . . $enable_load
     logfile . . . . . . . $enable_logfile
-    lpar  . . . . . . . . $enable_lpar
     log_logstash  . . . . $enable_log_logstash
+    lpar  . . . . . . . . $enable_lpar
     lvm . . . . . . . . . $enable_lvm
     madwifi . . . . . . . $enable_madwifi
     match_empty_counter . $enable_match_empty_counter
@@ -5948,8 +6087,8 @@ Configuration:
     swap  . . . . . . . . $enable_swap
     syslog  . . . . . . . $enable_syslog
     table . . . . . . . . $enable_table
-    tail  . . . . . . . . $enable_tail
     tail_csv  . . . . . . $enable_tail_csv
+    tail  . . . . . . . . $enable_tail
     tape  . . . . . . . . $enable_tape
     target_notification . $enable_target_notification
     target_replace  . . . $enable_target_replace
@@ -5979,6 +6118,7 @@ Configuration:
     write_mongodb . . . . $enable_write_mongodb
     write_redis . . . . . $enable_write_redis
     write_riemann . . . . $enable_write_riemann
+    write_sensu . . . . . $enable_write_sensu
     write_tsdb  . . . . . $enable_write_tsdb
     xmms  . . . . . . . . $enable_xmms
     zfs_arc . . . . . . . $enable_zfs_arc