autoconf
[Top][All Lists]
Advanced

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

Re: avoiding undesired macro expansion after AS_TR_CPP


From: Eric Blake
Subject: Re: avoiding undesired macro expansion after AS_TR_CPP
Date: Thu, 03 Jun 2010 16:57:59 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Mnenhy/0.8.2 Thunderbird/3.0.4

On 06/03/2010 04:11 PM, Bruno Haible wrote:
> Hi Eric,
> 
> Thanks for the help, but...
> 
>>>   AM_CONDITIONAL([LIBUNISTRING_]AS_TR_CPP([$1]), [true])
>>
>> AM_CONDITIONAL([LIBUNISTRING_]AS_TR_CPP([[$1]]), [true])
> 
> This does not work either:
> 
>   $ autoconf
>   configure.ac:11: error: AC_SUBST: `LIBUNISTRING_undesired 
> substitution_TRUE' is not a valid shell variable name
>   aclocal.m4:125: AM_CONDITIONAL is expanded from...
>   configure.ac:6: MYCOND is expanded from...
>   configure.ac:11: the top level
> 
> I get the impression that AS_TR_CPP is removing more quotes than it should.

Indeed.  I'll look into fixing that.  But that means you can't quite use
it on unsafe names in the meantime.

On the other hand, why not use:

AM_CONDITIONAL(AS_TR_CPP([[LIBUNISTRING_$1]]), [true])

such that you are using the LIBUNISTRING_ prefix as part of any
potential macro name, and can thus have more assurance that the user's
macros are not going to interfere unless they created macros that
interfered with your namespace.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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