bug-autoconf
[Top][All Lists]
Advanced

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

Re: Bug #593838: AX_CFLAGS_GCC_OPTION misuses AS_VAR_PUSHDEF variable


From: Eric Blake
Subject: Re: Bug #593838: AX_CFLAGS_GCC_OPTION misuses AS_VAR_PUSHDEF variable
Date: Fri, 01 Oct 2010 07:57:22 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4

On 10/01/2010 06:51 AM, Paolo Bonzini wrote:
On 09/27/2010 07:46 PM, Eric Blake wrote:
I was able to reduce the problem
to the following trivial case:

--8<--------------------------cut here-------------------------->8--
AC_DEFUN([MY_MACRO],
[AS_VAR_PUSHDEF([VAR],[prefix_$1])

dnl This is the version used by AX_CFLAGS_GCC_OPTION.
dnl I believe that it is incorrect. It does not work on Autoconf>= 2.67.
VAR=the_value

You are correct that this will not work if VAR is an indirect variable
name. It all depends on whether $1 is determined to be an indirection.

The testcase with MY_MACRO([a=b]), which was in Ben's email, does point
out however a small efficiency regression. I think this is worth fixing
in Autoconf:

Up to 2.67, the AS_TR_SH would be evaluated at autoconf-time:

prefix_a_b=value

Now instead it is evaluated at configure-time:

as_VAR=`$as_echo "prefix_a=b" | $as_tr_sh`

eval "$as_VAR=value"

Either way, the name of the indirect variable being assigned is $prefix_a_b, whether you use pre- or post-2.67. Why is 'a=b' being passed instead of 'a_b' in the first place? I'd need to see more context of the real macro usage (rather than this trivial test case) to see whether the efficiency hit is a corner case of a=b is likely in real life and thus a performance regression, or just an extreme that is not worth worrying about.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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