492 |
AC_DEFUN([AC_FUNC_GETLOADAVG], |
AC_DEFUN([AC_FUNC_GETLOADAVG], |
493 |
[ac_have_func=no # yes means we've found a way to get the load average. |
[ac_have_func=no # yes means we've found a way to get the load average. |
494 |
|
|
495 |
|
# The directory to find getloadavg.c in. |
496 |
|
ac_lib_dir_getloadavg=$srcdir[]m4_ifval([$1], [/$1]) |
497 |
|
|
498 |
|
# Make sure getloadavg.c is where it belongs, at configure-time. |
499 |
|
test -f "$ac_lib_dir_getloadavg/getloadavg.c" || |
500 |
|
AC_MSG_ERROR([$ac_lib_dir_getloadavg/getloadavg.c is missing]) |
501 |
|
# FIXME: Add an autoconf-time test, too? |
502 |
|
|
503 |
ac_save_LIBS=$LIBS |
ac_save_LIBS=$LIBS |
504 |
|
|
505 |
# Check for getloadavg, but be sure not to touch the cache variable. |
# Check for getloadavg, but be sure not to touch the cache variable. |
541 |
[_AC_LIBOBJ_GETLOADAVG]) |
[_AC_LIBOBJ_GETLOADAVG]) |
542 |
|
|
543 |
# Some definitions of getloadavg require that the program be installed setgid. |
# Some definitions of getloadavg require that the program be installed setgid. |
|
dnl FIXME: Don't hardwire the path of getloadavg.c in the top-level directory. |
|
544 |
AC_CACHE_CHECK(whether getloadavg requires setgid, |
AC_CACHE_CHECK(whether getloadavg requires setgid, |
545 |
ac_cv_func_getloadavg_setgid, |
ac_cv_func_getloadavg_setgid, |
546 |
[AC_EGREP_CPP([Yowza Am I SETGID yet], |
[AC_EGREP_CPP([Yowza Am I SETGID yet], |
547 |
[#include "$srcdir/getloadavg.c" |
[#include "$ac_lib_dir_getloadavg/getloadavg.c" |
548 |
#ifdef LDAV_PRIVILEGED |
#ifdef LDAV_PRIVILEGED |
549 |
Yowza Am I SETGID yet |
Yowza Am I SETGID yet |
550 |
@%:@endif], |
@%:@endif], |