author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 24 Feb 2017 16:55:12 +0000 (17:55 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 24 Feb 2017 16:55:12 +0000 (17:55 +0100) |
Conflicts:
configure.ac
configure.ac
1 | 2 | |||
---|---|---|---|---|
configure.ac | patch | | diff1 | | diff2 | | blob | history |
src/daemon/common.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc configure.ac
index 0154d829c5289d117aad0401c68578951b243864,366ef9b6ddc2256830862c943303b191b0419084..5f4536925ef38b665186d1d55de704dc78430b37
--- 1/configure.ac
--- 2/configure.ac
+++ b/configure.ac
sys/vfstab.h \
sys/vmmeter.h \
syslog.h \
- wordexp.h \
+ wordexp.h
])
-# For entropy plugin on newer NetBSD
-AC_CHECK_HEADERS(sys/rndio.h, [], [],
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-])
+if test "x$ac_system" = "xNetBSD"; then
+ # For entropy plugin on newer NetBSD
+ AC_CHECK_HEADERS([sys/rndio.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_IOCTL_H
+ # include <sys/ioctl.h>
+ #endif
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ]]
+ )
+fi
# For ping library
-AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
-[#if HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-])
-AC_CHECK_HEADERS(netinet/in.h, [], [],
-[#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
-])
-AC_CHECK_HEADERS(netinet/ip.h, [], [],
-[#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
-])
-AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
-[#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_IP_H
-# include <netinet/ip.h>
-#endif
-])
-AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
-[#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_IP_H
-# include <netinet/ip.h>
-#endif
-])
-AC_CHECK_HEADERS(netinet/ip6.h, [], [],
-[#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
-])
-AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
-[#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
-])
-AC_CHECK_HEADERS(netinet/tcp.h, [], [],
-[#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_IP_H
-# include <netinet/ip.h>
-#endif
-])
-AC_CHECK_HEADERS(netinet/udp.h, [], [],
-[#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_IP_H
-# include <netinet/ip.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
-])
+AC_CHECK_HEADERS([netinet/in_systm.h], [], [],
+ [[
+ #include <stdint.h>
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.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
-])
+AC_CHECK_HEADERS([netinet/in.h], [], [],
+ [[
+ #include <stdint.h>
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_NETINET_IN_SYSTM_H
+ # include <netinet/in_systm.h>
+ #endif
+ ]]
+)
- if test "x$have_ip6_ext" = "xno"; then
- CFLAGS="$SAVE_CFLAGS"
- fi
-fi
+AC_CHECK_HEADERS([netinet/ip.h], [], [],
+ [[
+ #include <stdint.h>
+ #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
+ ]]
+)
-# For cpu modules
-AC_CHECK_HEADERS(sys/dkstat.h)
-if test "x$ac_system" = "xDarwin"
-then
- AC_CHECK_HEADERS(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(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, [], [],
-[
-#if HAVE_IOKIT_IOKITLIB_H
-# include <IOKit/IOKitLib.h>
-#endif
-#if HAVE_IOKIT_IOTYPES_H
-# include <IOKit/IOTypes.h>
-#endif
-])
+AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [],
+ [[
+ #include <stdint.h>
+ #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_IP_H
+ # include <netinet/ip.h>
+ #endif
+ ]]
+)
-fi
+AC_CHECK_HEADERS([netinet/ip_var.h], [], [],
+ [[
+ #include <stdint.h>
+ #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_IP_H
+ # include <netinet/ip.h>
+ #endif
+ ]]
+)
-AC_CHECK_HEADERS(sys/sysctl.h, [], [],
-[
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-])
+AC_CHECK_HEADERS([netinet/ip6.h], [], [],
+ [[
+ #include <stdint.h>
+ #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
+ ]]
+)
-AC_MSG_CHECKING([for sysctl kern.cp_times])
-if test -x /sbin/sysctl
-then
- /sbin/sysctl kern.cp_times >/dev/null 2>&1
- if test $? -eq 0
- then
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
- [Define if sysctl supports kern.cp_times])
- else
- AC_MSG_RESULT([no])
- fi
-else
- AC_MSG_RESULT([no])
-fi
+AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
+ [[
+ #include <stdint.h>
+ #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
+ ]]
+)
-AC_MSG_CHECKING([for sysctl kern.cp_time])
-if test -x /sbin/sysctl
-then
- /sbin/sysctl kern.cp_time >/dev/null 2>&1
- if test $? -eq 0
- then
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1,
- [Define if sysctl supports kern.cp_time])
- else
- AC_MSG_RESULT([no])
- fi
-else
- AC_MSG_RESULT([no])
-fi
+AC_CHECK_HEADERS([netinet/tcp.h], [], [],
+ [[
+ #include <stdint.h>
+ #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_IP_H
+ # include <netinet/ip.h>
+ #endif
+ ]]
+)
-# For hddtemp module
-AC_CHECK_HEADERS(linux/major.h)
+AC_CHECK_HEADERS([netinet/udp.h], [], [],
+ [[
+ #include <stdint.h>
+ #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_IP_H
+ # include <netinet/ip.h>
+ #endif
+ ]]
+)
-# 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>
-])
- AC_CHECK_HEADERS([sys/sysmacros.h])
-else
- have_linux_raid_md_u_h="no"
-fi
+# For cpu modules
+AC_CHECK_HEADERS([sys/dkstat.h])
+if test "x$ac_system" = "xDarwin"; then
+ AC_CHECK_HEADERS(
+ [[ \
+ 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 \
+ CoreFoundation/CoreFoundation.h \
+ IOKit/IOKitLib.h \
+ IOKit/IOTypes.h \
+ IOKit/ps/IOPSKeys.h \
+ IOKit/IOBSD.h \
+ IOKit/storage/IOBlockStorageDriver.h
+ ]]
+ )
-# For the wireless module
-have_linux_wireless_h="no"
-if test "x$ac_system" = "xLinux"
-then
- AC_CHECK_HEADERS(linux/wireless.h,
- [have_linux_wireless_h="yes"],
- [have_linux_wireless_h="no"],
-[
-#include <dirent.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-])
+ # For the battery plugin
+ AC_CHECK_HEADERS([IOKit/ps/IOPowerSources.h], [], [],
+ [[
+ #if HAVE_IOKIT_IOKITLIB_H
+ # include <IOKit/IOKitLib.h>
+ #endif
+ #if HAVE_IOKIT_IOTYPES_H
+ # include <IOKit/IOTypes.h>
+ #endif
+ ]]
+ )
fi
-# For the swap module
-have_sys_swap_h="yes"
-AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
-[
-#undef _FILE_OFFSET_BITS
-#undef _LARGEFILE64_SOURCE
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-])
-
-# For load module
-# For the processes plugin
-# For users module
-AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
+AC_CHECK_HEADERS([sys/sysctl.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ]]
+)
# For interface plugin
-AC_CHECK_HEADERS(ifaddrs.h)
-AC_CHECK_HEADERS(net/if.h, [], [],
-[
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-])
-AC_CHECK_HEADERS(linux/if.h, [], [],
-[
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-])
-AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
-[
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-#if HAVE_LINUX_INET_DIAG_H
-# include <linux/inet_diag.h>
-#endif
-])
-AC_CHECK_HEADERS(linux/netdevice.h, [], [],
-[
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-#if HAVE_LINUX_IF_H
-# include <linux/if.h>
-#endif
-])
+AC_CHECK_HEADERS([ifaddrs.h])
+AC_CHECK_HEADERS([net/if.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ ]]
+)
+
+if test "x$ac_system" = "xLinux"; then
+ # For hddtemp module
+ AC_CHECK_HEADERS([linux/major.h])
+
+ # For md module (Linux only)
+ 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>
+ ]]
+ )
+ AC_CHECK_HEADERS([sys/sysmacros.h])
+
+ AC_CHECK_HEADERS([linux/wireless.h],
+ [have_linux_wireless_h="yes"],
+ [have_linux_wireless_h="no"],
+ [[
+ #include <dirent.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+ ]]
+ )
-# For ethstat module
-AC_CHECK_HEADERS(linux/sockios.h,
+ AC_CHECK_HEADERS([linux/if.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ ]]
+ )
+
+ AC_CHECK_HEADERS([linux/inet_diag.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ ]]
+ )
+
+ AC_CHECK_HEADERS([linux/netdevice.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #if HAVE_LINUX_IF_H
+ # include <linux/if.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,
+ [[
+ #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"
-have_ip_vs_h="no"
-ip_vs_h_needs_kernel_cflags="no"
-if test "x$ac_system" = "xLinux"
-then
- 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 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
+ ]]
+ )
- 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"
+ # 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
- AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
+ # 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)"]
+ )
- 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_capability" = "xyes"; then
- AC_CHECK_LIB([cap], [cap_get_bound],
++ AC_CHECK_LIB([cap], [cap_get_proc],
+ [have_capability="yes"],
- [have_capability="no (cap_get_bound() not found)"]
++ [have_capability="no (cap_get_proc() not found)"]
+ )
+ fi
- 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
+ if test "x$have_capability" = "xyes"; then
- AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_bound() (-lcap).])
++ AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
+ fi
- CFLAGS="$SAVE_CFLAGS"
- fi
+else
+ have_linux_raid_md_u_h="no"
+ have_linux_wireless_h="no"
fi
-AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
+
+AM_CONDITIONAL([IP_VS_H_NEEDS_KERNEL_CFLAGS], [test "x$ip_vs_h_needs_kernel_cflags" = "xyes"])
+AM_CONDITIONAL([BUILD_WITH_CAPABILITY], [test "x$have_capability" = "xyes"])
+
+# For the swap module
+have_sys_swap_h="yes"
+AC_CHECK_HEADERS([sys/swap.h vm/anon.h],
+ [],
+ [have_sys_swap_h="no"],
+ [[
+ #undef _FILE_OFFSET_BITS
+ #undef _LARGEFILE64_SOURCE
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ]]
+)
+
+# For load module
+# For the processes plugin
+# For users module
+AC_CHECK_HEADERS([sys/loadavg.h linux/config.h utmp.h utmpx.h])
# For quota module
-AC_CHECK_HEADERS(sys/ucred.h, [], [],
-[
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-])
+AC_CHECK_HEADERS([sys/ucred.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ]]
+)
# For mount interface
-AC_CHECK_HEADERS(sys/mount.h, [], [],
-[
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-])
-
-# For the email plugin
-AC_CHECK_HEADERS(linux/un.h, [], [],
-[
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-])
+AC_CHECK_HEADERS([sys/mount.h], [], [],
+ [[
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ]]
+)
# --enable-xfs {{{
AC_ARG_ENABLE([xfs],
diff --cc src/daemon/common.c
Simple merge