Alexandre Julliard : configure: Check for deprecation warnings from sys/sysctl.h.

Alexandre Julliard julliard at winehq.org
Mon Apr 27 15:19:30 CDT 2020


Module: wine
Branch: master
Commit: 9a37560060227c42258d81367b2c344fc79b93aa
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9a37560060227c42258d81367b2c344fc79b93aa

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Apr 27 14:53:02 2020 +0200

configure: Check for deprecation warnings from sys/sysctl.h.

The warning was added in glibc 2.30.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure    | 22 +++++++++++++++++++++-
 configure.ac | 12 +++++++++++-
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 1f4080fc54..0b368610fa 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 <sys/types.h>
@@ -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 <sys/types.h>
+     #ifdef HAVE_SYS_PARAM_H
+     # include <sys/param.h>
+     #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 ce2c94eca2..be3bc65175 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 <sys/types.h>
      #ifdef HAVE_SYS_PARAM_H
      # include <sys/param.h>
      #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 <sys/types.h>
+     #ifdef HAVE_SYS_PARAM_H
+     # include <sys/param.h>
+     #endif])
+CFLAGS=$saved_sysctl_h_CFLAGS
+
 AC_CHECK_HEADERS(\
 	netinet/ip.h \
 	net/if.h \




More information about the wine-cvs mailing list