[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] avoid new AC_REQUIRE expanded-before-required warnings
From: |
Eric Blake |
Subject: |
Re: [PATCH] avoid new AC_REQUIRE expanded-before-required warnings |
Date: |
Mon, 16 Nov 2009 18:57:34 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Jim Meyering <jim <at> meyering.net> writes:
> > The other fix is to use AC_DEFUN_ONCE in chown.m4, rather than tweaking
> > configure.ac sections of modules files.
>
> Ah ha!
> I knew there'd be a better way to solve that.
> I've gone ahead and used AC_DEFUN_ONCE for both.
> Is there any reason to use AC_DEFUN, in general?
Yes, if you intend for a macro to be expanded in more than one situation. Many
gnulib macros are one-shot, in that they take no arguments, perform a single
idempotent check, and set appropriate shell variables and a cache variable,
such that repeating the check would not discover anything different (with the
cache variable, the repeated check will not cost much time, but the repeated
expansion does cost space in the configure file); so those are good candidates
for AC_DEFUN_ONCE. But macros of the form:
check([if-working], [if-failing])
must NOT be AC_DEFUN_ONCE, since you can't guarantee that if-working and if-
failing will be idempotent. And there are still a few of those sprinkled
throughout gnulib (such as gl_FUNC_FCHOWNAT_DEREF_BUG in openat.m4)
> Here's the patch I'm testing:
Looks good to me.
--
Eric Blake