From: Ruben Kerkhof Date: Sun, 5 Mar 2017 16:21:11 +0000 (+0100) Subject: Merge branch 'collectd-5.7' X-Git-Tag: collectd-5.8.0~220 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9717b1a55d60d992c16e66e2ae5bdfb42f80aca8;p=collectd.git Merge branch 'collectd-5.7' Conflicts: configure.ac --- 9717b1a55d60d992c16e66e2ae5bdfb42f80aca8 diff --cc configure.ac index 63cfca77,9d49d915..3b932ca3 --- a/configure.ac +++ b/configure.ac @@@ -193,461 -260,450 +193,469 @@@ AC_CHECK_HEADERS_ONCE([ 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 -#endif -#if HAVE_SYS_IOCTL_H -# include -#endif -#if HAVE_SYS_PARAM_H -# include -#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 + #endif + #if HAVE_SYS_IOCTL_H + # include + #endif + #if HAVE_SYS_PARAM_H + # include + #endif + ]] + ) +fi # For ping library -AC_CHECK_HEADERS(netinet/in_systm.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/in.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/ip.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -#if HAVE_NETINET_IP_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/ip_var.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -#if HAVE_NETINET_IP_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/ip6.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/icmp6.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -#if HAVE_NETINET_IP6_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/tcp.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -#if HAVE_NETINET_IP_H -# include -#endif -]) -AC_CHECK_HEADERS(netinet/udp.h, [], [], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -#if HAVE_NETINET_IP_H -# include -#endif -]) - -have_ip6_ext="no" -AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"], -[#if HAVE_STDINT_H -# include -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -#if HAVE_NETINET_IP6_H -# include -#endif -]) +AC_CHECK_HEADERS([netinet/in_systm.h], [], [], + [[ + #include + #if HAVE_SYS_TYPES_H + # include + #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 -#endif -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif -#if HAVE_NETINET_IP6_H -# include -#endif -]) +AC_CHECK_HEADERS([netinet/in.h], [], [], + [[ + #include + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + ]] +) - if test "x$have_ip6_ext" = "xno"; then - CFLAGS="$SAVE_CFLAGS" - fi -fi +AC_CHECK_HEADERS([netinet/ip.h], [], [], + [[ + #include + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + #if HAVE_NETINET_IN_H + # include + #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 -#endif -#if HAVE_IOKIT_IOTYPES_H -# include -#endif -]) +AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [], + [[ + #include + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + #if HAVE_NETINET_IN_H + # include + #endif + #if HAVE_NETINET_IP_H + # include + #endif + ]] +) -fi +AC_CHECK_HEADERS([netinet/ip_var.h], [], [], + [[ + #include + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + #if HAVE_NETINET_IN_H + # include + #endif + #if HAVE_NETINET_IP_H + # include + #endif + ]] +) -AC_CHECK_HEADERS(sys/sysctl.h, [], [], -[ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_PARAM_H -# include -#endif -]) +AC_CHECK_HEADERS([netinet/ip6.h], [], [], + [[ + #include + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + #if HAVE_NETINET_IN_H + # include + #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 + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + #if HAVE_NETINET_IN_H + # include + #endif + #if HAVE_NETINET_IP6_H + # include + #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 + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + #if HAVE_NETINET_IN_H + # include + #endif + #if HAVE_NETINET_IP_H + # include + #endif + ]] +) -# For hddtemp module -AC_CHECK_HEADERS(linux/major.h) +AC_CHECK_HEADERS([netinet/udp.h], [], [], + [[ + #include + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_NETINET_IN_SYSTM_H + # include + #endif + #if HAVE_NETINET_IN_H + # include + #endif + #if HAVE_NETINET_IP_H + # include + #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 -#include -#include -]) - 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 -#include -#include -]) + # For the battery plugin + AC_CHECK_HEADERS([IOKit/ps/IOPowerSources.h], [], [], + [[ + #if HAVE_IOKIT_IOKITLIB_H + # include + #endif + #if HAVE_IOKIT_IOTYPES_H + # include + #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 -#endif -#if HAVE_SYS_PARAM_H -# include -#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 + #endif + #if HAVE_SYS_PARAM_H + # include + #endif + ]] +) # For interface plugin -AC_CHECK_HEADERS(ifaddrs.h) -AC_CHECK_HEADERS(net/if.h, [], [], -[ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_SOCKET_H -# include -#endif -]) -AC_CHECK_HEADERS(linux/if.h, [], [], -[ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_SOCKET_H -# include -#endif -]) -AC_CHECK_HEADERS(linux/inet_diag.h, [], [], -[ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_SOCKET_H -# include -#endif -#if HAVE_LINUX_INET_DIAG_H -# include -#endif -]) -AC_CHECK_HEADERS(linux/netdevice.h, [], [], -[ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_SOCKET_H -# include -#endif -#if HAVE_LINUX_IF_H -# include -#endif -]) +AC_CHECK_HEADERS([ifaddrs.h]) +AC_CHECK_HEADERS([net/if.h], [], [], + [[ + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_SYS_SOCKET_H + # include + #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 + #include + #include + ]] + ) + AC_CHECK_HEADERS([sys/sysmacros.h]) + + AC_CHECK_HEADERS([linux/wireless.h], + [have_linux_wireless_h="yes"], + [have_linux_wireless_h="no"], + [[ + #include + #include + #include + ]] + ) -# For ethstat module -AC_CHECK_HEADERS(linux/sockios.h, + AC_CHECK_HEADERS([linux/if.h], [], [], + [[ + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_SYS_SOCKET_H + # include + #endif + ]] + ) + + AC_CHECK_HEADERS([linux/inet_diag.h], [], [], + [[ + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_SYS_SOCKET_H + # include + #endif + ]] + ) + + AC_CHECK_HEADERS([linux/netdevice.h], [], [], + [[ + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_SYS_SOCKET_H + # include + #endif + #if HAVE_LINUX_IF_H + # include + #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 -#endif -#if HAVE_NET_IF_H -# include -#endif - ]) -AC_CHECK_HEADERS(linux/ethtool.h, + [[ + #if HAVE_SYS_IOCTL_H + # include + #endif + #if HAVE_NET_IF_H + # include + #endif + ]] + ) + + AC_CHECK_HEADERS([linux/ethtool.h], [have_linux_ethtool_h="yes"], [have_linux_ethtool_h="no"], - [ -#if HAVE_SYS_IOCTL_H -# include -#endif -#if HAVE_NET_IF_H -# include -#endif -#if HAVE_LINUX_SOCKIOS_H -# include -#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 + #endif + #if HAVE_NET_IF_H + # include + #endif + #if HAVE_LINUX_SOCKIOS_H + # include + #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 + + # For the email plugin + AC_CHECK_HEADERS([linux/un.h], [], [], + [[ + #if HAVE_SYS_SOCKET_H + # include + #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]], + [[ + 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 ( not found)"] + ) - AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.]) + 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 - 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_DECL([CAP_IS_SUPPORTED], ++ [have_capability="yes"], ++ [have_capability="no (CAP_IS_SUPPORTED not found)"], ++ [[#include ]] ++ ) ++ 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_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 + #endif + #if HAVE_SYS_PARAM_H + # include + #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 -#endif -#if HAVE_SYS_PARAM_H -# include -#endif -]) +AC_CHECK_HEADERS([sys/ucred.h], [], [], + [[ + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_SYS_PARAM_H + # include + #endif + ]] +) # For mount interface -AC_CHECK_HEADERS(sys/mount.h, [], [], -[ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_PARAM_H -# include -#endif -]) - -# For the email plugin -AC_CHECK_HEADERS(linux/un.h, [], [], -[ -#if HAVE_SYS_SOCKET_H -# include -#endif -]) +AC_CHECK_HEADERS([sys/mount.h], [], [], + [[ + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_SYS_PARAM_H + # include + #endif + ]] +) # --enable-xfs {{{ AC_ARG_ENABLE([xfs],