changeset 14965:952734b45495

getloadavg: Move AC_LIBOBJ invocations to module description. * m4/getloadavg.m4 (gl_FUNC_GETDELIM): Set HAVE_GETLOADAVG. Move AC_LIBOBJ and gl_PREREQ_GETLOADAVG invocations from here... * modules/getloadavg (configure.ac): ... to here.
author Bruno Haible <bruno@clisp.org>
date Sun, 08 May 2011 12:14:03 +0200
parents 0c2fbeeeb9c9
children 81d610ee79d1
files ChangeLog m4/getloadavg.m4 modules/getloadavg
diffstat 3 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-08  Bruno Haible  <bruno@clisp.org>
+
+	getloadavg: Move AC_LIBOBJ invocations to module description.
+	* m4/getloadavg.m4 (gl_FUNC_GETDELIM): Set HAVE_GETLOADAVG. Move
+	AC_LIBOBJ and gl_PREREQ_GETLOADAVG invocations from here...
+	* modules/getloadavg (configure.ac): ... to here.
+
 2011-05-08  Bruno Haible  <bruno@clisp.org>
 
 	gethrxtime: Move AC_LIBOBJ invocations to module description.
--- a/m4/getloadavg.m4
+++ b/m4/getloadavg.m4
@@ -7,7 +7,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 3
+#serial 4
 
 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
 # New applications should use gl_GETLOADAVG instead.
@@ -24,6 +24,7 @@
 
 # getloadvg is present in libc on glibc >= 2.2, MacOS X, FreeBSD >= 2.0,
 # NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
+HAVE_GETLOADAVG=1
 AC_CHECK_FUNC([getloadavg], [],
   [gl_have_func=no
 
@@ -52,8 +53,7 @@
 
    # Set up the replacement function if necessary.
    if test $gl_have_func = no; then
-     AC_LIBOBJ([getloadavg])
-     gl_PREREQ_GETLOADAVG
+     HAVE_GETLOADAVG=0
    fi])
 
 if test "x$gl_save_LIBS" = x; then
--- a/modules/getloadavg
+++ b/modules/getloadavg
@@ -13,6 +13,10 @@
 
 configure.ac:
 gl_GETLOADAVG
+if test $HAVE_GETLOADAVG = 0; then
+  AC_LIBOBJ([getloadavg])
+  gl_PREREQ_GETLOADAVG
+fi
 gl_STDLIB_MODULE_INDICATOR([getloadavg])
 
 Makefile.am: