annotate m4/getloadavg.m4 @ 37246:5cfb3a67238d

regex: avoid glibc deadlock during configure glibc has a known bug where certain corruptions of the heap can cause malloc to default to printing a debug message that includes a backtrace, but the act of getting the backtrace uses dlopen which in turn calls into malloc, causing a recursive lock ending in deadlock. Thus, when configure is probing for a known glibc heap corruption bug, the overall configure would hang. The solution suggested by glibc developers is to force malloc to quit printing debug messages, which avoids recursive malloc. * m4/regex.m4 (gl_REGEX): Avoid recursive malloc deadlock when glibc bug 15078 in turn triggers bug 16159. Reported by Michal Privoznik. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Tue, 03 Dec 2013 10:34:13 -0700
parents c741bc27922a
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1 # Check for getloadavg.
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
2
36940
c741bc27922a maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 36673
diff changeset
3 # Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2013 Free Software
32209
70883299a3a5 update nearly all FSF copyright year lists to include 2009
Jim Meyering <meyering@redhat.com>
parents: 32112
diff changeset
4 # Foundation, Inc.
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
5
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
6 # This file is free software; the Free Software Foundation
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
7 # gives unlimited permission to copy and/or distribute it,
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
8 # with or without modifications, as long as this notice is preserved.
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
9
36626
fa36c6a7c96f Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 35926
diff changeset
10 #serial 6
33261
f119b63c48f3 getloadavg: don't define SVR4 on cygwin
Eric Blake <eblake@redhat.com>
parents: 32250
diff changeset
11
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
12 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
13 # New applications should use gl_GETLOADAVG instead.
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
14
34526
83eca6eef26f getloadavg: Remove an unreliable safety check.
Bruno Haible <bruno@clisp.org>
parents: 34055
diff changeset
15 # gl_GETLOADAVG
83eca6eef26f getloadavg: Remove an unreliable safety check.
Bruno Haible <bruno@clisp.org>
parents: 34055
diff changeset
16 # -------------
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
17 AC_DEFUN([gl_GETLOADAVG],
30356
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
18 [AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
19
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
20 # Persuade glibc <stdlib.h> to declare getloadavg().
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
21 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
22
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
23 gl_save_LIBS=$LIBS
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
24
36626
fa36c6a7c96f Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 35926
diff changeset
25 # getloadvg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
34055
e172e3700233 getloadavg: Add comments about platforms.
Bruno Haible <bruno@clisp.org>
parents: 34046
diff changeset
26 # NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
34656
c04fbf07b58f getloadavg: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 34526
diff changeset
27 HAVE_GETLOADAVG=1
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
28 AC_CHECK_FUNC([getloadavg], [],
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
29 [gl_func_getloadavg_done=no
29361
924834deb2ac getloadavg: use libperfstat on AIX5
Peter O'Gorman <pogma@thewrittenword.com>
parents: 27181
diff changeset
30
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
31 # Some systems with -lutil have (and need) -lkvm as well, some do not.
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
32 # On Solaris, -lkvm requires nlist from -lelf, so check that first
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
33 # to get the right answer into the cache.
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
34 # For kstat on solaris, we need to test for libelf and libkvm to force the
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
35 # definition of SVR4 below.
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
36 if test $gl_func_getloadavg_done = no; then
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
37 AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
38 AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
39 # Check for the 4.4BSD definition of getloadavg.
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
40 AC_CHECK_LIB([util], [getloadavg],
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
41 [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
42 fi
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
43
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
44 if test $gl_func_getloadavg_done = no; then
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
45 # There is a commonly available library for RS/6000 AIX.
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
46 # Since it is not a standard part of AIX, it might be installed locally.
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
47 gl_getloadavg_LIBS=$LIBS
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
48 LIBS="-L/usr/local/lib $LIBS"
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
49 AC_CHECK_LIB([getloadavg], [getloadavg],
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
50 [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
51 [LIBS=$gl_getloadavg_LIBS])
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
52 fi
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
53
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
54 # Set up the replacement function if necessary.
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
55 if test $gl_func_getloadavg_done = no; then
34656
c04fbf07b58f getloadavg: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 34526
diff changeset
56 HAVE_GETLOADAVG=0
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
57
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
58 # Solaris has libkstat which does not require root.
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
59 AC_CHECK_LIB([kstat], [kstat_open])
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
60 test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
61
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
62 # AIX has libperfstat which does not require root
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
63 if test $gl_func_getloadavg_done = no; then
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
64 AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
65 test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
66 fi
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
67
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
68 if test $gl_func_getloadavg_done = no; then
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
69 AC_CHECK_HEADER([sys/dg_sys_info.h],
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
70 [gl_func_getloadavg_done=yes
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
71 AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
72 AC_CHECK_LIB([dgc], [dg_sys_info])])
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
73 fi
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
74 fi])
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
75
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
76 if test "x$gl_save_LIBS" = x; then
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
77 GETLOADAVG_LIBS=$LIBS
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
78 else
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
79 GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
80 fi
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
81 LIBS=$gl_save_LIBS
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
82
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
83 AC_SUBST([GETLOADAVG_LIBS])dnl
30356
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
84
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
85 # Test whether the system declares getloadavg. Solaris has the function
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
86 # but declares it in <sys/loadavg.h>, not <stdlib.h>.
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
87 AC_CHECK_HEADERS([sys/loadavg.h])
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
88 if test $ac_cv_header_sys_loadavg_h = yes; then
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
89 HAVE_SYS_LOADAVG_H=1
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
90 else
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
91 HAVE_SYS_LOADAVG_H=0
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
92 fi
47c8bbb74d65 Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents: 29361
diff changeset
93 AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
35308
0efa9b7a9461 Properly quote AC_CHECK_DECL's 4th argument.
Bruno Haible <bruno@clisp.org>
parents: 34974
diff changeset
94 [[#if HAVE_SYS_LOADAVG_H
0efa9b7a9461 Properly quote AC_CHECK_DECL's 4th argument.
Bruno Haible <bruno@clisp.org>
parents: 34974
diff changeset
95 # include <sys/loadavg.h>
0efa9b7a9461 Properly quote AC_CHECK_DECL's 4th argument.
Bruno Haible <bruno@clisp.org>
parents: 34974
diff changeset
96 #endif
0efa9b7a9461 Properly quote AC_CHECK_DECL's 4th argument.
Bruno Haible <bruno@clisp.org>
parents: 34974
diff changeset
97 #include <stdlib.h>]])
26934
f07af6f0d5a8 * modules/getloadavg (Files): Add m4/getloadavg.m4.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
98 ])# gl_GETLOADAVG
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
99
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
100
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
101 # gl_PREREQ_GETLOADAVG
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
102 # --------------------
35926
382eb53c160b In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 35892
diff changeset
103 # Set up the AC_LIBOBJ replacement of 'getloadavg'.
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
104 AC_DEFUN([gl_PREREQ_GETLOADAVG],
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
105 [
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
106 # Figure out what our getloadavg.c needs.
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
107
36673
f2d7299ca259 getloadavg: clean out old Emacs and Autoconf cruft
Paul Eggert <eggert@cs.ucla.edu>
parents: 36626
diff changeset
108 AC_CHECK_HEADERS_ONCE([sys/param.h])
f2d7299ca259 getloadavg: clean out old Emacs and Autoconf cruft
Paul Eggert <eggert@cs.ucla.edu>
parents: 36626
diff changeset
109
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
110 # On HPUX9, an unprivileged user can get load averages this way.
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
111 if test $gl_func_getloadavg_done = no; then
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
112 AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
113 fi
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
114
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
115 # We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
116 # uses stabs), but it is still SVR4. We cannot check for <elf.h> because
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
117 # Irix 4.0.5F has the header but not the library.
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
118 if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
33261
f119b63c48f3 getloadavg: don't define SVR4 on cygwin
Eric Blake <eblake@redhat.com>
parents: 32250
diff changeset
119 && test "$ac_cv_lib_kvm_kvm_open" = yes; then
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
120 gl_func_getloadavg_done=yes
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
121 AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
122 fi
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
123
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
124 if test $gl_func_getloadavg_done = no; then
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
125 AC_CHECK_HEADER([inq_stats/cpustats.h],
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
126 [gl_func_getloadavg_done=yes
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
127 AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
128 AC_DEFINE([UMAX4_3], [1],
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
129 [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
130 instead of <sys/cpustats.h>.])])
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
131 fi
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
132
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
133 if test $gl_func_getloadavg_done = no; then
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
134 AC_CHECK_HEADER([sys/cpustats.h],
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
135 [gl_func_getloadavg_done=yes; AC_DEFINE([UMAX])])
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
136 fi
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
137
34974
cd81da3eb521 getloadavg: Don't clobber LIBS. Regression from previous commit.
Bruno Haible <bruno@clisp.org>
parents: 34656
diff changeset
138 if test $gl_func_getloadavg_done = no; then
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
139 AC_CHECK_HEADERS([mach/mach.h])
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
140 fi
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
141
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30356
diff changeset
142 AC_CHECK_HEADERS([nlist.h],
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
143 [AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
34046
77b9417a9d2b getloadavg: set errno
Paul Eggert <eggert@cs.ucla.edu>
parents: 33770
diff changeset
144 [], [],
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
145 [@%:@include <nlist.h>])
31620
3eca4deb2ba3 Replace uses of obsolete autoconf macros in Jim's modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 31437
diff changeset
146 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
147 [[struct nlist x;
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
148 #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
149 x.n_un.n_name = "";
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
150 #else
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
151 x.n_name = "";
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31620
diff changeset
152 #endif]])],
31620
3eca4deb2ba3 Replace uses of obsolete autoconf macros in Jim's modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 31437
diff changeset
153 [AC_DEFINE([N_NAME_POINTER], [1],
3eca4deb2ba3 Replace uses of obsolete autoconf macros in Jim's modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 31437
diff changeset
154 [Define to 1 if the nlist n_name member is a pointer])])
26939
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
155 ])dnl
564aaa2a4d29 * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
Paul Eggert <eggert@cs.ucla.edu>
parents: 26934
diff changeset
156 ])# gl_PREREQ_GETLOADAVG