X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fgetloadavg.m4;h=567245ea8bc495fa47b0eff942f2c1356dcca072;hb=31d4ee218ba9dabe654a9fbf53a72e5bf203b0dc;hp=ff8cf309b0c3db2757f2c2afc25971dd0c336e9d;hpb=56f0235a59ea7058e6a6370edad604b646fdf080;p=gnulib.git diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index ff8cf309b..567245ea8 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -1,4 +1,4 @@ -#serial 9 +#serial 11 # A replacement for autoconf's macro by the same name. This version # accepts an optional argument specifying the name of the $srcdir-relative @@ -12,7 +12,8 @@ undefine([AC_FUNC_GETLOADAVG]) AC_DEFUN([AC_FUNC_GETLOADAVG], [ac_have_func=no # yes means we've found a way to get the load average. -AC_CHECK_HEADERS(locale.h unistd.h mach/mach.h fcntl.h) +AC_CHECK_HEADERS_ONCE(fcntl.h locale.h unistd.h) +AC_CHECK_HEADERS(mach/mach.h) AC_CHECK_FUNCS(setlocale) # By default, expect to find getloadavg.c in $srcdir/. @@ -91,7 +92,7 @@ if test $ac_cv_func_getloadavg_setgid = yes; then # If we got an error (system does not support symlinks), try without -L. test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem` ac_cv_group_kmem=`echo $ac_ls_output \ - | sed -ne ['s/[ ][ ]*/ /g; + | sed -ne ['s/[ ][ ]*/ /g; s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/; / /s/.* //;p;']` ]) @@ -106,3 +107,19 @@ LIBS=$ac_save_LIBS AC_SUBST(GETLOADAVG_LIBS)dnl ])# AC_FUNC_GETLOADAVG + + +AC_DEFUN([gl_FUNC_GETLOADAVG], +[ + AC_FUNC_GETLOADAVG([lib]) + dnl Note AC_FUNC_GETLOADAVG does AC_LIBOBJ(getloadavg). + if test $ac_cv_func_getloadavg = no; then + gl_PREREQ_GETLOADAVG + fi +]) + +# Prerequisites of lib/getloadavg.c not done by autoconf's AC_FUNC_GETLOADAVG. +AC_DEFUN([gl_PREREQ_GETLOADAVG], +[ + AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h) +])