autoconf-patches
[Top][All Lists]
Advanced

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

Re: Improve AC_CACHE_VAL


From: Eric Blake
Subject: Re: Improve AC_CACHE_VAL
Date: Mon, 02 Mar 2009 20:29:39 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paolo Bonzini on 3/2/2009 10:04 AM:
> Eric Blake wrote:
>> As discussed on the bug-autoconf list.  The heuristics cannot be made 
>> perfect 
>> (code commonly calls AC_MSG_RESULT more often than AC_MSG_CHECKING; and 
>> scenarios like the obsolete AC_COMPILE_CHECK, or improperly nested 
>> AC_CACHE_CHECK, can alter the balance), but should be decent enough for most 
>> well-written configure.ac.  And, as was pointed out, the presence or absence 
>> of "(cached)" on stdout doesn't impact the correctness of the configure 
>> results.
> 
> But it makes them confusing.  I really dislike this patch.

Bruno, since you raised the original issue, what do you think of this
counterproposal?  Based on Paolo's objection, I'm holding off on pushing
my first patch until we are all in agreement on the best semantics.

>  Isuggest
> instead including macros for
> 
>   exec AS_MESSAGE_FD([])>/dev/null
> 
> and
> 
>   test "$silent" != yes && exec AS_MESSAGE_FD([])>&1
> 
> like this:
> 
> # AC_SILENT_PUSH
> # --------------
> # Silence AS_MESSAGE_FD up to the next AC_SILENT_POP.
> AC_DEFINE([AC_SILENT_PUSH],
> [_AC_SILENT_PUSH[]dnl
> m4_pushdef([_AC_SILENT_PUSH, [:]])m4_pushdef([_AC_SILENT_POP], [:])])
> 
> AC_DEFINE([_AC_SILENT_PUSH],
> [exec AS_MESSAGE_FD>/dev/null])
> 
> # AC_SILENT_PUSH
> # --------------
> # Stop silencing AS_MESSAGE_FD if this is the outermost AC_SILENT_POP.
> AC_DEFINE([AC_SILENT_POP],
> [m4_popdef([_AC_SILENT_PUSH])m4_popdef([_AC_SILENT_POP])dnl
> _AC_SILENT_POP])
> 
> AC_DEFINE([_AC_SILENT_POP],
> [test "$silent" != yes && exec AS_MESSAGE_FD>&1])
> 
> and let the user decide what to silence.

Does it need to be done with shell exec redirections, or is it possible to
do it solely via m4 pushdef/popdef?  I guess it depends how we want the
following case to behave:

AC_DEFUN([foo],
[AC_SILENT_PUSH
AC_REQUIRE([bar])
AC_CACHE_VAL([blah_cv_var], [...])
AC_SILENT_POP])

with just m4 magic, the output associated with bar will be silenced, but
with exec redirections, the hoisted require call is unaffected, and only
blah_cv_var is silenced.  I guess that means I'm kind of leaning towards
the exec magic.

I agree with Ralf's comments - since AS_MESSAGE_FD is an m4sh construct,
the push/pop silence macros belong in m4sh.  Which means, for convenience,
we should then provide AC_CACHE_VAL_SILENT that does the push/pop itself.

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

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmspCMACgkQ84KuGfSFAYAnHQCgz+Bg79m+rSwLk3E5vk2Ot5CW
+CwAnRaxXnwPWo6WRwFy+CvYJ0CdO4NN
=j3q/
-----END PGP SIGNATURE-----




reply via email to

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