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   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to