summaryrefslogtreecommitdiffstats
path: root/gl/m4/getloadavg.m4
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 15:27:12 (GMT)
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 15:27:12 (GMT)
commit5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (patch)
tree2b2e1c71dffae827c8e45cd4cccc375093d03486 /gl/m4/getloadavg.m4
parent6d1d1dac32841d5ca6ee51bb09b30a6c604b17e2 (diff)
downloadmonitoring-plugins-5be04ec2ceb1df77afbca4fcbf9e92a712612d6f.tar.gz
Sync with the latest Gnulib code (d4ec02b3cc)refs/pull/2037/head
Diffstat (limited to 'gl/m4/getloadavg.m4')
-rw-r--r--gl/m4/getloadavg.m437
1 files changed, 21 insertions, 16 deletions
diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4
index 79e420b..0918bcd 100644
--- a/gl/m4/getloadavg.m4
+++ b/gl/m4/getloadavg.m4
@@ -1,13 +1,12 @@
1# Check for getloadavg. 1# getloadavg.m4
2 2# serial 13
3# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2023 Free Software 3dnl Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free Software
4# Foundation, Inc. 4dnl Foundation, Inc.
5dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it,
7dnl with or without modifications, as long as this notice is preserved.
5 8
6# This file is free software; the Free Software Foundation 9# Check for getloadavg.
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10#serial 10
11 10
12# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. 11# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
13# New applications should use gl_GETLOADAVG instead. 12# New applications should use gl_GETLOADAVG instead.
@@ -20,13 +19,18 @@ AC_DEFUN([gl_GETLOADAVG],
20# Persuade glibc <stdlib.h> to declare getloadavg(). 19# Persuade glibc <stdlib.h> to declare getloadavg().
21AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) 20AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
22 21
23gl_save_LIBS=$LIBS 22gl_saved_LIBS=$LIBS
24 23
25# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0, 24# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
26# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7. 25# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
27HAVE_GETLOADAVG=1 26HAVE_GETLOADAVG=1
28AC_CHECK_FUNC([getloadavg], [], 27gl_CHECK_FUNCS_ANDROID([getloadavg], [[#include <stdlib.h>]])
29 [gl_func_getloadavg_done=no 28if test $ac_cv_func_getloadavg != yes; then
29 case "$gl_cv_onwards_func_getloadavg" in
30 future*) REPLACE_GETLOADAVG=1 ;;
31 esac
32
33 gl_func_getloadavg_done=no
30 34
31 # Some systems with -lutil have (and need) -lkvm as well, some do not. 35 # Some systems with -lutil have (and need) -lkvm as well, some do not.
32 # On Solaris, -lkvm requires nlist from -lelf, so check that first 36 # On Solaris, -lkvm requires nlist from -lelf, so check that first
@@ -73,14 +77,15 @@ AC_CHECK_FUNC([getloadavg], [],
73 AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.]) 77 AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
74 AC_CHECK_LIB([dgc], [dg_sys_info])]) 78 AC_CHECK_LIB([dgc], [dg_sys_info])])
75 fi 79 fi
76 fi]) 80 fi
81fi
77 82
78if test "x$gl_save_LIBS" = x; then 83if test "x$gl_saved_LIBS" = x; then
79 GETLOADAVG_LIBS=$LIBS 84 GETLOADAVG_LIBS=$LIBS
80else 85else
81 GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"` 86 GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_saved_LIBS!!"`
82fi 87fi
83LIBS=$gl_save_LIBS 88LIBS=$gl_saved_LIBS
84 89
85AC_SUBST([GETLOADAVG_LIBS])dnl 90AC_SUBST([GETLOADAVG_LIBS])dnl
86 91