[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getloadavg is broken
From: |
Bruno Haible |
Subject: |
Re: getloadavg is broken |
Date: |
Tue, 24 May 2011 23:57:03 +0200 |
User-agent: |
KMail/1.9.9 |
Sam Steingold wrote:
> Unless I remove the offending line (see the appended patch), configure
> fails with "../src/src/gllib/getloadavg.c is missing" message.
> apparently $srcdir is "../src" and $1=$gl_source_base="src/gllib" which
> cannot be combined into anything sensible.
This code was meant to simulate what an AC_LIBSOURCES invocation does.
But AC_LIBSOURCES from autoconf was found to be inadequate in the context
of gnulib and therefore has gotten a gnulib specific override (see
gnulib-tool functions func_emit_initmacro_start, func_emit_initmacro_end).
Most of the gnulib users actually don't even need the AC_LIBSOURCES invocation
normally, because gnulib-tool and a correct module description already
guarantee that source files will be where they are expected.
> no other module does such a check, so it is not clear why getloadavg should.
Good point. Here's a proposed patch.
2011-05-24 Bruno Haible <address@hidden>
getloadavg: Remove an unreliable safety check.
* m4/getloadavg.m4 (gl_GETLOADAVG): Drop argument. Remove test
whether getloadavg.c is in place.
* modules/getloadavg (configure.ac): Drop argument of gl_GETLOADAVG.
Reported by Sam Steingold <address@hidden>.
--- m4/getloadavg.m4.orig Tue May 24 23:49:07 2011
+++ m4/getloadavg.m4 Tue May 24 23:48:41 2011
@@ -7,23 +7,19 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 2
+#serial 3
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
# New applications should use gl_GETLOADAVG instead.
-# gl_GETLOADAVG(LIBOBJDIR)
-# ------------------------
+# gl_GETLOADAVG
+# -------------
AC_DEFUN([gl_GETLOADAVG],
[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
# Persuade glibc <stdlib.h> to declare getloadavg().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-# Make sure getloadavg.c is where it belongs, at configure-time.
-test -f "$srcdir/$1/getloadavg.c" ||
- AC_MSG_ERROR([$srcdir/$1/getloadavg.c is missing])
-
gl_save_LIBS=$LIBS
# getloadvg is present in libc on glibc >= 2.2, MacOS X, FreeBSD >= 2.0,
--- modules/getloadavg.orig Tue May 24 23:49:07 2011
+++ modules/getloadavg Tue May 24 23:48:51 2011
@@ -12,7 +12,7 @@
stdlib
configure.ac:
-gl_GETLOADAVG([$gl_source_base])
+gl_GETLOADAVG
gl_STDLIB_MODULE_INDICATOR([getloadavg])
Makefile.am:
--
In memoriam Georges Darboy <http://en.wikipedia.org/wiki/Georges_Darboy>