[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: misleading output from AC_PROG_AWK

From: Eric Blake
Subject: Re: misleading output from AC_PROG_AWK
Date: Fri, 20 Jun 2008 06:08:46 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080421 Thunderbird/ Mnenhy/

According to Ralf Wildenhues on 6/19/2008 11:42 AM:
checking for gawk... (cached) awk

In this case, awk is not gawk, and configure is not actually
searching for gawk, so this AC_PROG_AWK output is misleading.

What are the alternatives?

- output a line for each name we check, or even each directory?
  Both is waaay too verbose; AC_PROG_FC, for example, checks for
  something like two dozen names.
- "checking for AWK" or (shudder) "checking for @AWK@"?  Hmm.
- adding new macro arguments to override what's printed?
  IMVHO not worth the hassle in this case.

I don't think changing the code for this issue is worth the drawbacks.

Of those three, I would only consider a patch that does the second variant (or maybe "checking for $AWK") - the first and third are not worth it. But it doesn't bother me enough to write such a patch.

Second, in your case, './configure AWK=awk', checking is not done at
all.  I see the point that there is a difference between "configure
searched for this program before, but did not find it, so used this
alternative instead" and "the user overrides the search algorithm with
this value".  We could change it to output something like

| checking for gawk... (user-provided) awk

One drawback is that this may be wrong, too, for example when AWK
is passed from one configure script to the next (maybe "(set in $AWK)"

Now that seems like a relatively simple idea. So the possible output cases would be:

user did nothing, and awk is the final program found after a full search:
| checking for gawk... awk

user did nothing, and the cache was used:
| checking for gawk... (cached) awk

user supplied AWK:
| checking for gawk... (set in $AWK) awk

Here's where to stick a one-liner patch that would do this (although I haven't tested it, so it may need some quoting adjustments, and certainly needs a testsuite addition); does this approach sound good enough to pursue further?

2008-06-20  Eric Blake  <address@hidden>

        * lib/autoconf/programs.m4 (_AC_CHECK_PROG): Inform user when path
        search was skipped because of an environment variable.
        Reported by Clint Adams via Ben Pfaff.

diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index e7e72c0..ad248b7 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -66,6 +66,7 @@ set dummy $2; ac_word=$[2]
 AC_MSG_CHECKING([for $ac_word])
 [if test -n "$$1"; then
+  _AS_ECHO_N([(set in $$1) ])
   ac_cv_prog_$1="$$1" # Let the user override the test.

Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]