netcmd plugin: Implement the "TLSDHBits" config option.
[collectd.git] / configure.ac
index d4e3301..ef251fa 100644 (file)
@@ -589,13 +589,44 @@ AC_CHECK_HEADERS(net/pfvar.h,
 have_termios_h="no"
 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
 
+# For the turbostat plugin
+have_asm_msrindex_h="no"
+AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
+
+if test "x$have_asm_msrindex_h" = "xyes"
+then
+  AC_CACHE_CHECK([whether asm/msr-index.h has MSR_CORE_C3_RESIDENCY],
+                 [c_cv_have_usable_asm_msrindex_h],
+                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
+#include<asm/msr-index.h>
+]]],
+[[[
+int y = MSR_CORE_C3_RESIDENCY;
+return(y);
+]]]
+  )],
+                 [c_cv_have_usable_asm_msrindex_h="yes"],
+                 [c_cv_have_usable_asm_msrindex_h="no"],
+                                  )
+                 )
+fi
+
+have_cpuid_h="no"
+AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
+
+AC_CHECK_HEADERS(sys/capability.h)
 #
 # Checks for typedefs, structures, and compiler characteristics.
 #
 AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
 AC_TYPE_UID_T
+AC_TYPE_UINT32_T
 AC_HEADER_TIME
 
 #
@@ -1989,6 +2020,93 @@ AC_SUBST(GCRYPT_LIBS)
 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
 # }}}
 
+# --with-libgnutls {{{
+with_libgnutls_cflags="$GNUTLS_CFLAGS"
+with_libgnutls_libs="$GNUTLS_LIBS"
+AC_ARG_WITH(libgnutls, [AS_HELP_STRING([--with-libgnutls@<:@=PREFIX@:>@], [Path to GnuTLS.])],
+[
+       if test "x$withval" = "xno"
+       then
+               with_libgnutls="no"
+       else if test "x$withval" = "xyes"
+       then
+               with_libgnutls="use_pkgconfig"
+       else if test -d "$with_libgnutls/lib"
+       then
+               AC_MSG_NOTICE([Not checking for libgnutls: Manually configured])
+               with_libgnutls_cflags="-I$withval/include"
+               with_libgnutls_libs="-L$withval/lib -lgnutls"
+               with_libgnutls="yes"
+       fi; fi; fi
+],
+[with_libgnutls="use_pkgconfig"])
+
+# configure using pkg-config
+if test "x$with_libgnutls" = "xuse_pkgconfig"
+then
+       if test "x$PKG_CONFIG" = "x"
+       then
+               with_libgnutls="no (Don't have pkg-config)"
+       fi
+fi
+if test "x$with_libgnutls" = "xuse_pkgconfig"
+then
+       AC_MSG_NOTICE([Checking for gnutls using $PKG_CONFIG])
+       $PKG_CONFIG --exists 'gnutls' 2>/dev/null
+       if test $? -ne 0
+       then
+               with_libgnutls="no (pkg-config doesn't know gnutls)"
+       fi
+fi
+if test "x$with_libgnutls" = "xuse_pkgconfig"
+then
+       with_libgnutls_cflags="`$PKG_CONFIG --cflags 'gnutls'`"
+       if test $? -ne 0
+       then
+               with_libgnutls="no ($PKG_CONFIG failed)"
+       fi
+       with_libgnutls_libs="`$PKG_CONFIG --libs 'gnutls'`"
+       if test $? -ne 0
+       then
+               with_libgnutls="no ($PKG_CONFIG failed)"
+       fi
+fi
+if test "x$with_libgnutls" = "xuse_pkgconfig"
+then
+       with_libgnutls="yes"
+fi
+
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $with_libgnutls_cflags"
+
+# with_libgnutls_cflags and with_libgnutls_libs are set up now, let's do
+# the actual checks.
+if test "x$with_libgnutls" = "xyes"
+then
+       AC_CHECK_HEADERS(gnutls/gnutls.h, [], [with_libgnutls="no (gnutls/gnutls.h not found)"])
+fi
+if test "x$with_libgnutls" = "xyes"
+then
+       AC_CHECK_HEADERS(gnutls/dtls.h gnutls/openpgp.h)
+fi
+if test "x$with_libgnutls" = "xyes"
+then
+       AC_CHECK_LIB(gnutls, gnutls_global_init,
+                    [with_libgnutls="yes"],
+                    [with_libgnutls="no (symbol gnutls_global_init not found)"],
+                    [$with_libgnutls_libs])
+fi
+if test "x$with_libgnutls" = "xyes"
+then
+       BUILD_WITH_LIBGNUTLS_CFLAGS="$with_libgnutls_cflags"
+       BUILD_WITH_LIBGNUTLS_LIBS="$with_libgnutls_libs"
+       AC_SUBST(BUILD_WITH_LIBGNUTLS_CFLAGS)
+       AC_SUBST(BUILD_WITH_LIBGNUTLS_LIBS)
+fi
+
+CPPFLAGS="$SAVE_CPPFLAGS"
+# }}}
+
 # --with-libiptc {{{
 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
 [
@@ -3729,6 +3847,7 @@ AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Pat
   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"
@@ -3740,6 +3859,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)"])
@@ -3755,7 +3877,12 @@ 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)
@@ -5146,6 +5273,7 @@ plugin_tape="no"
 plugin_tcpconns="no"
 plugin_ted="no"
 plugin_thermal="no"
+plugin_turbostat="no"
 plugin_uptime="no"
 plugin_users="no"
 plugin_virt="no"
@@ -5193,6 +5321,10 @@ then
        then
                plugin_ipvs="yes"
        fi
+       if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
+       then
+               plugin_turbostat="yes"
+       fi
 fi
 
 if test "x$ac_system" = "xOpenBSD"
@@ -5244,6 +5376,7 @@ fi
 if test "x$with_kstat" = "xyes"
 then
        plugin_nfs="yes"
+       plugin_processes="yes"
        plugin_uptime="yes"
        plugin_zfs_arc="yes"
        plugin_zone="yes"
@@ -5507,6 +5640,7 @@ 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],     [yes],                [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])
@@ -5539,6 +5673,7 @@ AC_PLUGIN([modbus],      [$with_libmodbus],    [Modbus plugin])
 AC_PLUGIN([multimeter],  [$plugin_multimeter], [Read multimeter values])
 AC_PLUGIN([mysql],       [$with_libmysql],     [MySQL statistics])
 AC_PLUGIN([netapp],      [$with_libnetapp],    [NetApp plugin])
+AC_PLUGIN([netcmd],      [$with_libgnutls],    [Network control socket])
 AC_PLUGIN([netlink],     [$with_libmnl],       [Enhanced Linux network statistics])
 AC_PLUGIN([network],     [yes],                [Network communication plugin])
 AC_PLUGIN([nfs],         [$plugin_nfs],        [NFS statistics])
@@ -5590,6 +5725,7 @@ AC_PLUGIN([ted],         [$plugin_ted],        [Read The Energy Detective values
 AC_PLUGIN([thermal],     [$plugin_thermal],    [Linux ACPI thermal zone statistics])
 AC_PLUGIN([threshold],   [yes],                [Threshold checking plugin])
 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant],  [TokyoTyrant database statistics])
+AC_PLUGIN([turbostat],   [$plugin_turbostat],  [Advanced statistic on Intel cpu states])
 AC_PLUGIN([unixsock],    [yes],                [Unixsock communication plugin])
 AC_PLUGIN([uptime],      [$plugin_uptime],     [Uptime statistics])
 AC_PLUGIN([users],       [$plugin_users],      [User statistics])
@@ -5801,6 +5937,7 @@ Configuration:
     libesmtp  . . . . . . $with_libesmtp
     libganglia  . . . . . $with_libganglia
     libgcrypt . . . . . . $with_libgcrypt
+    libgnutls . . . . . . $with_libgnutls
     libhal  . . . . . . . $with_libhal
     libhiredis  . . . . . $with_libhiredis
     libi2c-dev  . . . . . $with_libi2c
@@ -5884,6 +6021,7 @@ Configuration:
     entropy . . . . . . . $enable_entropy
     ethstat . . . . . . . $enable_ethstat
     exec  . . . . . . . . $enable_exec
+    fhcount . . . . . . . $enable_fhcount
     filecount . . . . . . $enable_filecount
     fscache . . . . . . . $enable_fscache
     gmond . . . . . . . . $enable_gmond
@@ -5916,6 +6054,7 @@ Configuration:
     multimeter  . . . . . $enable_multimeter
     mysql . . . . . . . . $enable_mysql
     netapp  . . . . . . . $enable_netapp
+    netcmd  . . . . . . . $enable_netcmd
     netlink . . . . . . . $enable_netlink
     network . . . . . . . $enable_network
     nfs . . . . . . . . . $enable_nfs
@@ -5966,6 +6105,7 @@ Configuration:
     thermal . . . . . . . $enable_thermal
     threshold . . . . . . $enable_threshold
     tokyotyrant . . . . . $enable_tokyotyrant
+    turbostat . . . . . . $enable_turbostat
     unixsock  . . . . . . $enable_unixsock
     uptime  . . . . . . . $enable_uptime
     users . . . . . . . . $enable_users