Skip to content

Commit ecea0a6

Browse files
committed
configure: disable sys/sysctl.h on Linux
It generates deprecation warnings since glibc 2.29 and we don't need it anyway. Thanks to Pavan Balaji for the report. Refs #384 Signed-off-by: Brice Goglin <[email protected]> (cherry picked from commit bf9ef36)
1 parent 9878618 commit ecea0a6

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

config/hwloc.m4

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl -*- Autoconf -*-
22
dnl
3-
dnl Copyright © 2009-2019 Inria. All rights reserved.
3+
dnl Copyright © 2009-2020 Inria. All rights reserved.
44
dnl Copyright © 2009-2012, 2015-2017 Université Bordeaux
55
dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana
66
dnl University Research and Technology
@@ -475,21 +475,6 @@ EOF])
475475
AC_CHECK_FUNCS([host_info])
476476
])
477477
478-
AC_CHECK_HEADERS([sys/param.h])
479-
AC_CHECK_HEADERS([sys/sysctl.h], [
480-
AC_CHECK_DECLS([CTL_HW, HW_NCPU],,,[[
481-
#if HAVE_SYS_PARAM_H
482-
#include <sys/param.h>
483-
#endif
484-
#include <sys/sysctl.h>
485-
]])
486-
],,[
487-
AC_INCLUDES_DEFAULT
488-
#if HAVE_SYS_PARAM_H
489-
#include <sys/param.h>
490-
#endif
491-
])
492-
493478
AC_CHECK_DECLS([strtoull], [], [AC_CHECK_FUNCS([strtoull])], [AC_INCLUDES_DEFAULT])
494479
495480
# Needed for Windows in private/misc.h
@@ -530,6 +515,23 @@ return 0;
530515
fi
531516
532517
if test "x$hwloc_linux" != "xyes" ; then
518+
# Don't look for sys/sysctl.h on Linux because it's deprecated and
519+
# generates a warning in GCC10. Also it's unneeded.
520+
AC_CHECK_HEADERS([sys/param.h])
521+
AC_CHECK_HEADERS([sys/sysctl.h], [
522+
AC_CHECK_DECLS([CTL_HW, HW_NCPU],,,[[
523+
#if HAVE_SYS_PARAM_H
524+
#include <sys/param.h>
525+
#endif
526+
#include <sys/sysctl.h>
527+
]])
528+
],,[
529+
AC_INCLUDES_DEFAULT
530+
#if HAVE_SYS_PARAM_H
531+
#include <sys/param.h>
532+
#endif
533+
])
534+
533535
# Don't detect sysctl* on Linux because its sysctl() syscall is
534536
# long deprecated and unneeded. Some libc still expose the symbol
535537
# and raise a big warning at link time.

0 commit comments

Comments
 (0)