aboutsummaryrefslogtreecommitdiffstats
path: root/community/autoconf2.13/getloadavg.patch
blob: 46f26d692f049283e6f7575f9db3bbd09fca7c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From debian/patches/other-debian.patch.

autoconf (2.13-24) unstable; urgency=low
  * Fix test for getloadavg (Bug#84170).
 -- Ben Pfaff <blp@gnu.org>  Wed, 31 Jan 2001 19:12:03 -0500

--- autoconf-2.13/acspecific.m4
+++ autoconf-2.13/acspecific.m4
@@ -1477,14 +1477,19 @@ AC_SUBST(ALLOCA)dnl
 AC_DEFUN(AC_FUNC_GETLOADAVG,
 [ac_have_func=no # yes means we've found a way to get the load average.
 
-# Some systems with -lutil have (and need) -lkvm as well, some do not.
-# On Solaris, -lkvm requires nlist from -lelf, so check that first
-# to get the right answer into the cache.
-AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")
-AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS")
-# Check for the 4.4BSD definition of getloadavg.
-AC_CHECK_LIB(util, getloadavg,
-  [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
+# Some systems have getloadavg without any extra libraries.
+AC_CHECK_FUNC(getloadavg, [ac_have_func=yes])
+
+if test $ac_have_func = no; then
+  # Some systems with -lutil have (and need) -lkvm as well, some do not.
+  # On Solaris, -lkvm requires nlist from -lelf, so check that first
+  # to get the right answer into the cache.
+  AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")
+  AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS")
+  # Check for the 4.4BSD definition of getloadavg.
+  AC_CHECK_LIB(util, getloadavg,
+    [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
+fi
 
 if test $ac_have_func = no; then
   # There is a commonly available library for RS/6000 AIX.