diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-08-23 19:42:51 +0200 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2022-09-14 11:08:55 +0200 |
commit | 868beb15ae02c352005a2df8857f4ebb9bd758fd (patch) | |
tree | 0dc6e6a91c4ef0f131ca82a777e6ac2ad193c399 /gl/m4/getloadavg.m4 | |
parent | b89aee56964f7d933f2da5f371e32b4d7db9410b (diff) | |
download | monitoring-plugins-868beb1.tar.gz |
Sync with the latest Gnulib code (d27c820595)
Diffstat (limited to 'gl/m4/getloadavg.m4')
-rw-r--r-- | gl/m4/getloadavg.m4 | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4 index 611372aa..7bb8890b 100644 --- a/gl/m4/getloadavg.m4 +++ b/gl/m4/getloadavg.m4 | |||
@@ -1,13 +1,13 @@ | |||
1 | # Check for getloadavg. | 1 | # Check for getloadavg. |
2 | 2 | ||
3 | # Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2013 Free Software | 3 | # Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2022 Free Software |
4 | # Foundation, Inc. | 4 | # Foundation, Inc. |
5 | 5 | ||
6 | # This file is free software; the Free Software Foundation | 6 | # This file is free software; the Free Software Foundation |
7 | # gives unlimited permission to copy and/or distribute it, | 7 | # gives unlimited permission to copy and/or distribute it, |
8 | # with or without modifications, as long as this notice is preserved. | 8 | # with or without modifications, as long as this notice is preserved. |
9 | 9 | ||
10 | #serial 6 | 10 | #serial 10 |
11 | 11 | ||
12 | # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. | 12 | # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. |
13 | # New applications should use gl_GETLOADAVG instead. | 13 | # New applications should use gl_GETLOADAVG instead. |
@@ -22,7 +22,7 @@ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) | |||
22 | 22 | ||
23 | gl_save_LIBS=$LIBS | 23 | gl_save_LIBS=$LIBS |
24 | 24 | ||
25 | # getloadvg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0, | 25 | # getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0, |
26 | # NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7. | 26 | # NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7. |
27 | HAVE_GETLOADAVG=1 | 27 | HAVE_GETLOADAVG=1 |
28 | AC_CHECK_FUNC([getloadavg], [], | 28 | AC_CHECK_FUNC([getloadavg], [], |
@@ -45,7 +45,9 @@ AC_CHECK_FUNC([getloadavg], [], | |||
45 | # There is a commonly available library for RS/6000 AIX. | 45 | # There is a commonly available library for RS/6000 AIX. |
46 | # Since it is not a standard part of AIX, it might be installed locally. | 46 | # Since it is not a standard part of AIX, it might be installed locally. |
47 | gl_getloadavg_LIBS=$LIBS | 47 | gl_getloadavg_LIBS=$LIBS |
48 | LIBS="-L/usr/local/lib $LIBS" | 48 | if test $cross_compiling != yes; then |
49 | LIBS="-L/usr/local/lib $LIBS" | ||
50 | fi | ||
49 | AC_CHECK_LIB([getloadavg], [getloadavg], | 51 | AC_CHECK_LIB([getloadavg], [getloadavg], |
50 | [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes], | 52 | [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes], |
51 | [LIBS=$gl_getloadavg_LIBS]) | 53 | [LIBS=$gl_getloadavg_LIBS]) |
@@ -92,6 +94,9 @@ else | |||
92 | fi | 94 | fi |
93 | AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0], | 95 | AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0], |
94 | [[#if HAVE_SYS_LOADAVG_H | 96 | [[#if HAVE_SYS_LOADAVG_H |
97 | /* OpenIndiana has a bug: <sys/time.h> must be included before | ||
98 | <sys/loadavg.h>. */ | ||
99 | # include <sys/time.h> | ||
95 | # include <sys/loadavg.h> | 100 | # include <sys/loadavg.h> |
96 | #endif | 101 | #endif |
97 | #include <stdlib.h>]]) | 102 | #include <stdlib.h>]]) |
@@ -105,7 +110,7 @@ AC_DEFUN([gl_PREREQ_GETLOADAVG], | |||
105 | [ | 110 | [ |
106 | # Figure out what our getloadavg.c needs. | 111 | # Figure out what our getloadavg.c needs. |
107 | 112 | ||
108 | AC_CHECK_HEADERS_ONCE([sys/param.h]) | 113 | AC_CHECK_HEADERS_ONCE([sys/param.h unistd.h]) |
109 | 114 | ||
110 | # On HPUX9, an unprivileged user can get load averages this way. | 115 | # On HPUX9, an unprivileged user can get load averages this way. |
111 | if test $gl_func_getloadavg_done = no; then | 116 | if test $gl_func_getloadavg_done = no; then |
@@ -142,7 +147,7 @@ fi | |||
142 | AC_CHECK_HEADERS([nlist.h], | 147 | AC_CHECK_HEADERS([nlist.h], |
143 | [AC_CHECK_MEMBERS([struct nlist.n_un.n_name], | 148 | [AC_CHECK_MEMBERS([struct nlist.n_un.n_name], |
144 | [], [], | 149 | [], [], |
145 | [@%:@include <nlist.h>]) | 150 | [#include <nlist.h>]) |
146 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]], | 151 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]], |
147 | [[struct nlist x; | 152 | [[struct nlist x; |
148 | #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME | 153 | #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME |