On 06/03/2010 02:52 PM, Bruno Haible wrote: > Hi, > > I would like to avoid undesired macro expansion on the result of AS_TR_CPP, > and cannot get it to work. Can someone help, please? > > ================================ configure.ac ============================= > AC_INIT([dummy], [0]) > AM_INIT_AUTOMAKE > > dnl m4_define([FOO_BAR], [undesired substitution]) > > AC_DEFUN([MYCOND], > [ > AM_CONDITIONAL([LIBUNISTRING_]AS_TR_CPP([$1]), [true]) AM_CONDITIONAL([LIBUNISTRING_]AS_TR_CPP([[$1]]), [true]) You want to double-quote the argument to AS_TR_CPP, since that macro will be expanded immediately and strips one level of quotes. > > So I guess some more quoting is needed. > > Attempt #1: Use brackets. Change line 8 to > > AM_CONDITIONAL([LIBUNISTRING_][AS_TR_CPP([$1])], [true]) No, this delays the transformation until after AM_CONDITIONAL has run. > Attempt #2: Use m4_quote. Change line 8 to > > AM_CONDITIONAL([LIBUNISTRING_]m4_quote(AS_TR_CPP([$1])), [true]) Still too late - the results of AS_TR_CPP are still expanded prior to calling m4_quote. > > Attempt #3: Use m4_dquote. Change line 8 to > > AM_CONDITIONAL([LIBUNISTRING_]m4_dquote(AS_TR_CPP([$1])), [true]) No different than the m4_dquote case - the result of AS_TR_CPP is expanded prior to the m4_dquote call. > Attempt #4: Use m4_quote and brackets. Change line 8 to > > AM_CONDITIONAL([LIBUNISTRING_]m4_quote([AS_TR_CPP([$1])]), [true]) This is like attempt #1 - you end up not invoking AS_TR_CPP at all. -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf