diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-02-19 08:36:39 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-02-19 08:36:39 (GMT) |
commit | 5a7c71c9ca056e5c94e711e15b5bfba3ce8d1fc0 (patch) | |
tree | 5e527b008a24de1661af2f2aa639a08d39e2a49c | |
parent | 0490d0830234062b4055e4b0fd2131fb54d7743f (diff) | |
download | monitoring-plugins-5a7c71c9ca056e5c94e711e15b5bfba3ce8d1fc0.tar.gz |
remove getloadavg.m4
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@346 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | INSTALL | 2 | ||||
-rw-r--r-- | configure.in | 8 | ||||
-rw-r--r-- | lib/getloadavg.m4 | 108 | ||||
-rwxr-xr-x | tools/setup | 2 |
4 files changed, 9 insertions, 111 deletions
@@ -4,7 +4,7 @@ Nagios Plugins Quick-and-Dirty Installation Instructions | |||
4 | 0) If using the CVS tree, you need m4, automake, and autoconf. To | 4 | 0) If using the CVS tree, you need m4, automake, and autoconf. To |
5 | start out, run: | 5 | start out, run: |
6 | 6 | ||
7 | # aclocal | 7 | # aclocal -I lib |
8 | # autoconf | 8 | # autoconf |
9 | # autoheader | 9 | # autoheader |
10 | # automake | 10 | # automake |
diff --git a/configure.in b/configure.in index 38c2470..7b3dd08 100644 --- a/configure.in +++ b/configure.in | |||
@@ -23,7 +23,13 @@ AC_PROG_CC | |||
23 | AC_PROG_MAKE_SET | 23 | AC_PROG_MAKE_SET |
24 | AC_PROG_AWK | 24 | AC_PROG_AWK |
25 | 25 | ||
26 | AC_FUNC_GETLOADAVG([lib]) | 26 | saved_srcdir=$srcdir |
27 | srcdir=$srcdir/lib | ||
28 | test -f $srcdir/getloadavg.c \ | ||
29 | || AC_MSG_ERROR([getloadavg.c is not in $srcdir]) | ||
30 | AC_FUNC_GETLOADAVG | ||
31 | srcdir=$saved_srcdir | ||
32 | |||
27 | ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD]) | 33 | ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD]) |
28 | dnl AM_WITH_REGEX | 34 | dnl AM_WITH_REGEX |
29 | AC_PROG_RANLIB | 35 | AC_PROG_RANLIB |
diff --git a/lib/getloadavg.m4 b/lib/getloadavg.m4 deleted file mode 100644 index ff8cf30..0000000 --- a/lib/getloadavg.m4 +++ /dev/null | |||
@@ -1,108 +0,0 @@ | |||
1 | #serial 9 | ||
2 | |||
3 | # A replacement for autoconf's macro by the same name. This version | ||
4 | # accepts an optional argument specifying the name of the $srcdir-relative | ||
5 | # directory in which the file getloadavg.c may be found. It is unusual | ||
6 | # (but justified, imho) that this file is required at ./configure time. | ||
7 | |||
8 | undefine([AC_FUNC_GETLOADAVG]) | ||
9 | |||
10 | # AC_FUNC_GETLOADAVG | ||
11 | # ------------------ | ||
12 | AC_DEFUN([AC_FUNC_GETLOADAVG], | ||
13 | [ac_have_func=no # yes means we've found a way to get the load average. | ||
14 | |||
15 | AC_CHECK_HEADERS(locale.h unistd.h mach/mach.h fcntl.h) | ||
16 | AC_CHECK_FUNCS(setlocale) | ||
17 | |||
18 | # By default, expect to find getloadavg.c in $srcdir/. | ||
19 | ac_lib_dir_getloadavg=$srcdir | ||
20 | # But if there's an argument, DIR, expect to find getloadavg.c in $srcdir/DIR. | ||
21 | m4_ifval([$1], [ac_lib_dir_getloadavg=$srcdir/$1]) | ||
22 | # Make sure getloadavg.c is where it belongs, at ./configure-time. | ||
23 | test -f $ac_lib_dir_getloadavg/getloadavg.c \ | ||
24 | || AC_MSG_ERROR([getloadavg.c is not in $ac_lib_dir_getloadavg]) | ||
25 | # FIXME: Add an autoconf-time test, too? | ||
26 | |||
27 | ac_save_LIBS=$LIBS | ||
28 | |||
29 | # Check for getloadavg, but be sure not to touch the cache variable. | ||
30 | (AC_CHECK_FUNC(getloadavg, exit 0, exit 1)) && ac_have_func=yes | ||
31 | |||
32 | # On HPUX9, an unprivileged user can get load averages through this function. | ||
33 | AC_CHECK_FUNCS(pstat_getdynamic) | ||
34 | |||
35 | # Solaris has libkstat which does not require root. | ||
36 | AC_CHECK_LIB(kstat, kstat_open) | ||
37 | test $ac_cv_lib_kstat_kstat_open = yes && ac_have_func=yes | ||
38 | |||
39 | # Some systems with -lutil have (and need) -lkvm as well, some do not. | ||
40 | # On Solaris, -lkvm requires nlist from -lelf, so check that first | ||
41 | # to get the right answer into the cache. | ||
42 | # For kstat on solaris, we need libelf to force the definition of SVR4 below. | ||
43 | if test $ac_have_func = no; then | ||
44 | AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS") | ||
45 | fi | ||
46 | if test $ac_have_func = no; then | ||
47 | AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") | ||
48 | # Check for the 4.4BSD definition of getloadavg. | ||
49 | AC_CHECK_LIB(util, getloadavg, | ||
50 | [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes]) | ||
51 | fi | ||
52 | |||
53 | if test $ac_have_func = no; then | ||
54 | # There is a commonly available library for RS/6000 AIX. | ||
55 | # Since it is not a standard part of AIX, it might be installed locally. | ||
56 | ac_getloadavg_LIBS=$LIBS | ||
57 | LIBS="-L/usr/local/lib $LIBS" | ||
58 | AC_CHECK_LIB(getloadavg, getloadavg, | ||
59 | [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS]) | ||
60 | fi | ||
61 | |||
62 | # Make sure it is really in the library, if we think we found it, | ||
63 | # otherwise set up the replacement function. | ||
64 | AC_CHECK_FUNCS(getloadavg, [], | ||
65 | [_AC_LIBOBJ_GETLOADAVG]) | ||
66 | |||
67 | # Some definitions of getloadavg require that the program be installed setgid. | ||
68 | AC_CACHE_CHECK(whether getloadavg requires setgid, | ||
69 | ac_cv_func_getloadavg_setgid, | ||
70 | [AC_EGREP_CPP([Yowza Am I SETGID yet], | ||
71 | [#include "$ac_lib_dir_getloadavg/getloadavg.c" | ||
72 | #ifdef LDAV_PRIVILEGED | ||
73 | Yowza Am I SETGID yet | ||
74 | @%:@endif], | ||
75 | ac_cv_func_getloadavg_setgid=yes, | ||
76 | ac_cv_func_getloadavg_setgid=no)]) | ||
77 | if test $ac_cv_func_getloadavg_setgid = yes; then | ||
78 | NEED_SETGID=true | ||
79 | AC_DEFINE(GETLOADAVG_PRIVILEGED, 1, | ||
80 | [Define if the `getloadavg' function needs to be run setuid | ||
81 | or setgid.]) | ||
82 | else | ||
83 | NEED_SETGID=false | ||
84 | fi | ||
85 | AC_SUBST(NEED_SETGID)dnl | ||
86 | |||
87 | if test $ac_cv_func_getloadavg_setgid = yes; then | ||
88 | AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem, | ||
89 | [ # On Solaris, /dev/kmem is a symlink. Get info on the real file. | ||
90 | ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` | ||
91 | # If we got an error (system does not support symlinks), try without -L. | ||
92 | test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem` | ||
93 | ac_cv_group_kmem=`echo $ac_ls_output \ | ||
94 | | sed -ne ['s/[ ][ ]*/ /g; | ||
95 | s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/; | ||
96 | / /s/.* //;p;']` | ||
97 | ]) | ||
98 | AC_SUBST(KMEM_GROUP, $ac_cv_group_kmem)dnl | ||
99 | fi | ||
100 | if test "x$ac_save_LIBS" = x; then | ||
101 | GETLOADAVG_LIBS=$LIBS | ||
102 | else | ||
103 | GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$ac_save_LIBS!!"` | ||
104 | fi | ||
105 | LIBS=$ac_save_LIBS | ||
106 | |||
107 | AC_SUBST(GETLOADAVG_LIBS)dnl | ||
108 | ])# AC_FUNC_GETLOADAVG | ||
diff --git a/tools/setup b/tools/setup index 293aec6..18281a3 100755 --- a/tools/setup +++ b/tools/setup | |||
@@ -1,6 +1,6 @@ | |||
1 | #! /bin/sh | 1 | #! /bin/sh |
2 | 2 | ||
3 | aclocal | 3 | aclocal -I lib |
4 | autoconf | 4 | autoconf |
5 | autoheader | 5 | autoheader |
6 | automake | 6 | automake |