From 9a37560060227c42258d81367b2c344fc79b93aa Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 27 Apr 2020 14:53:02 +0200 Subject: [PATCH] configure: Check for deprecation warnings from sys/sysctl.h. The warning was added in glibc 2.30. Signed-off-by: Alexandre Julliard --- configure | 22 +++++++++++++++++++++- configure.ac | 12 +++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 1f4080fc545..0b368610fa6 100755 --- a/configure +++ b/configure @@ -7559,7 +7559,7 @@ fi -for ac_header in sys/mount.h sys/statfs.h sys/sysctl.h sys/user.h sys/vfs.h +for ac_header in sys/mount.h sys/statfs.h sys/user.h sys/vfs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include @@ -7577,6 +7577,26 @@ fi done +saved_sysctl_h_CFLAGS=$CFLAGS +test "x${GCC}" != xyes || CFLAGS="$CFLAGS -Werror" +for ac_header in sys/sysctl.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#include + #ifdef HAVE_SYS_PARAM_H + # include + #endif +" +if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SYSCTL_H 1 +_ACEOF + +fi + +done + +CFLAGS=$saved_sysctl_h_CFLAGS + for ac_header in \ netinet/ip.h \ net/if.h \ diff --git a/configure.ac b/configure.ac index ce2c94eca29..be3bc65175d 100644 --- a/configure.ac +++ b/configure.ac @@ -547,12 +547,22 @@ AC_HEADER_STAT() dnl **** Checks for headers that depend on other ones **** -AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/sysctl.h sys/user.h sys/vfs.h],,, +AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/user.h sys/vfs.h],,, [#include #ifdef HAVE_SYS_PARAM_H # include #endif]) +dnl check for broken Linux sysctl.h that causes deprecation warnings +saved_sysctl_h_CFLAGS=$CFLAGS +test "x${GCC}" != xyes || CFLAGS="$CFLAGS -Werror" +AC_CHECK_HEADERS([sys/sysctl.h],,, + [#include + #ifdef HAVE_SYS_PARAM_H + # include + #endif]) +CFLAGS=$saved_sysctl_h_CFLAGS + AC_CHECK_HEADERS(\ netinet/ip.h \ net/if.h \