+ # For ipvs module
+ AC_CHECK_HEADERS([linux/ip_vs.h], [have_linux_ip_vs_h="yes"], [have_linux_ip_vs="no"])
+ AC_CHECK_HEADERS([net/ip_vs.h], [have_net_ip_vs_h="yes"], [have_net_ip_vs_h="no"])
+ AC_CHECK_HEADERS([ip_vs.h], [have_ip_vs_h="yes"], [have_ip_vs_h="no"])
+
+ ip_vs_h_needs_kernel_cflags="no"
+
+ if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"; then
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $KERNEL_CFLAGS"
+
+ AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
+
+ AC_CHECK_HEADERS([linux/ip_vs.h], [have_linux_ip_vs_h="yes"])
+ AC_CHECK_HEADERS([net/ip_vs.h], [have_net_ip_vs_h="yes"])
+ AC_CHECK_HEADERS([ip_vs.h], [have_ip_vs_h="yes"])
+
+ if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"; then
+ ip_vs_h_needs_kernel_cflags="yes"
+ fi
+
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+
+ # For the email plugin
+ AC_CHECK_HEADERS([linux/un.h], [], [],
+ [[
+ #if HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ ]]
+ )
+ # For the turbostat plugin
+ AC_CHECK_HEADERS([asm/msr-index.h],
+ [have_asm_msrindex_h="yes"],
+ [have_asm_msrindex_h="no"]
+ )
+
+ if test "x$have_asm_msrindex_h" = "xyes"; then
+ 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
+
+ AC_CHECK_HEADERS([cpuid.h],
+ [have_cpuid_h="yes"],
+ [have_cpuid_h="no (cpuid.h not found)"]
+ )
+
+ AC_CHECK_HEADERS([sys/capability.h],
+ [have_capability="yes"],
+ [have_capability="no (<sys/capability.h> not found)"]
+ )
+
+ if test "x$have_capability" = "xyes"; then
+ AC_CHECK_LIB([cap], [cap_get_proc],
+ [have_capability="yes"],
+ [have_capability="no (cap_get_proc() not found)"]
+ )
+ fi
+
+ if test "x$have_capability" = "xyes"; then
+ AC_CHECK_DECL([CAP_IS_SUPPORTED],
+ [have_capability="yes"],
+ [have_capability="no (CAP_IS_SUPPORTED not found)"],
+ [[#include <sys/capability.h>]]
+ )
+ fi
+
+ if test "x$have_capability" = "xyes"; then
+ AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
+ fi