[Top][All Lists]

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

Re: m4 quoting and autoheader

From: Eric Blake
Subject: Re: m4 quoting and autoheader
Date: Wed, 19 May 2010 09:46:58 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4

On 05/19/2010 09:33 AM, Adam Mercer wrote:
> Hi
> One of the platforms I _need_ to support for development is CentOS 5,
> which comes with very old versions of the autotools:
> m4-1.4.5-3.el5.1

There's part of your problem.

> If I locally update to the latest versions of autoconf and automnake
> the build works, but not using the system autoconf and automake.

The latest version of autoconf depends on m4 1.4.6 or greater, because
m4 1.4.5 has bugs in translit that newer autoconf would trigger
(autoconf 2.59 did not trigger those bugs, so using stock tools on your
distro should still be okay).  If you are going to upgrade to newer
autoconf, you also need to upgrade m4.

Now, back to your question:

>   define([uppercase],translit($1, "a-z", "A-Z"))
>   AC_DEFINE([HAVE_LIB[]uppercase[]],[1],[Define to 1 if you have the
> $1 library])
> ])

You should use m4_translit instead of translit, and you want the
expansion of your temporary macro 'uppercase' to occur prior to calling
AC_DEFINE, rather than after.  You ended up transliterating " to ",
because you used the wrong quoting.  You also want to ensure that the
result of the transliteration is not itself treated as a macro, hence
the double-quoting.  Also, treating uppercase as a temporary macro
implies using pushdef/popdef rather than define.  Try this instead
(although I haven't tested it):

  AC_DEFINE([HAVE_LIB]uppercase, [1], [Define if ...])

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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