bug-gnulib
[Top][All Lists]
Advanced

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

Re: absolute-header: make the macro more usable


From: Eric Blake
Subject: Re: absolute-header: make the macro more usable
Date: Mon, 17 May 2010 10:36:15 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4

On 05/16/2010 03:43 PM, Bruno Haible wrote:
> Can someone explain why the argument of AS_TR_SH apparently needs to be
> double-quoted? The autoconf doc does not mention this. (I experimentally
> determine the number of needed quotations by adding too many [[[]]] here
> and there, look at the generated configure file for input like
>   gl_ABSOLUTE_HEADER_ONE([unistr.h])
>   gl_ABSOLUTE_HEADER([foobar.h baz.h])
> and remove the quotation levels one by one, until the generated code is fine.
> This means, if I were to remove one more level of quotation, I would enable
> some unwanted m4 evaluations, right?)

Which version of autoconf are you using?  But yes, anything where you
don't want extra m4 evaluations should be double-quoted.  Using
AS_TR_SH([$1]) is just fine if you know that $1 will not contain any
macro names, but if you want the transliteration to be used as a literal
string, then AS_TR_SH([[$1]]) is the correct approach.  This behavior
mirrors how m4_translit behaves.

Arguably, we could have made AS_TR_SH double-quote it's output since
it's fairly obvious from semantics that whatever we are transliterating
should not be producing any macro names on output, but it's probably too
late to change that in autoconf now for backwards compatibility.

> +AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
> +[
> +  AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])])

That use of m4_dquote is overkill.  You could have just used:

AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <$1>]])])

for identical results with less m4 execution time.

-- 
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]