From 5be04ec2ceb1df77afbca4fcbf9e92a712612d6f Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:27:12 +0100 Subject: Sync with the latest Gnulib code (d4ec02b3cc) --- gl/m4/getloadavg.m4 | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'gl/m4/getloadavg.m4') diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4 index 79e420ba..0918bcd2 100644 --- a/gl/m4/getloadavg.m4 +++ b/gl/m4/getloadavg.m4 @@ -1,13 +1,12 @@ -# Check for getloadavg. - -# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2023 Free Software -# Foundation, Inc. +# getloadavg.m4 +# serial 13 +dnl Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free Software +dnl Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 10 +# Check for getloadavg. # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. # New applications should use gl_GETLOADAVG instead. @@ -20,13 +19,18 @@ AC_DEFUN([gl_GETLOADAVG], # Persuade glibc to declare getloadavg(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) -gl_save_LIBS=$LIBS +gl_saved_LIBS=$LIBS # getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0, # NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7. HAVE_GETLOADAVG=1 -AC_CHECK_FUNC([getloadavg], [], - [gl_func_getloadavg_done=no +gl_CHECK_FUNCS_ANDROID([getloadavg], [[#include ]]) +if test $ac_cv_func_getloadavg != yes; then + case "$gl_cv_onwards_func_getloadavg" in + future*) REPLACE_GETLOADAVG=1 ;; + esac + + gl_func_getloadavg_done=no # Some systems with -lutil have (and need) -lkvm as well, some do not. # On Solaris, -lkvm requires nlist from -lelf, so check that first @@ -73,14 +77,15 @@ AC_CHECK_FUNC([getloadavg], [], AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with .]) AC_CHECK_LIB([dgc], [dg_sys_info])]) fi - fi]) + fi +fi -if test "x$gl_save_LIBS" = x; then +if test "x$gl_saved_LIBS" = x; then GETLOADAVG_LIBS=$LIBS else - GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"` + GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_saved_LIBS!!"` fi -LIBS=$gl_save_LIBS +LIBS=$gl_saved_LIBS AC_SUBST([GETLOADAVG_LIBS])dnl -- cgit v1.2.3-74-g34f1