autoconf-patches
[Top][All Lists]
Advanced

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

Re: FYI: loop in libtool m4 macros


From: Stepan Kasal
Subject: Re: FYI: loop in libtool m4 macros
Date: Tue, 21 Jun 2005 17:38:57 +0200
User-agent: Mutt/1.4.1i

Hello,
  sorry for the delay, I was offline until today.

We are discussing the problems caused by my patch:
http://lists.gnu.org/archive/html/autoconf-patches/2005-06/msg00014.html

On Sat, Jun 11, 2005 at 01:12:36PM +0200, Ralf Wildenhues wrote:
> FYI: I have applied this patch to HEAD and branch-2-0 after some
> reformatting.

Let me comment on the changes:

1)
m4/ltsugar.m4:
>  m4_define([lt_combine],
> -[m4_if([$2], [[]], [],
> +[m4_if([$2], [], [],
>         [lt_join(m4_quote(m4_default([$1], [, ])),

This is the type of problem I mentioned in the comment to the patch.
(But I said I don't expect to see it in real life--I was wrong.)
Your code specified the empty list as [[]] instead of [], which matched
the incorrect implementation of m4_cdr.

If you want to be compatible with both old and new m4_cdr, you have to
use:
  m4_if([$2], [[]], [],
        [$2], [], [],
        [lt_join(...

I apologize for the inconvinience, but I believe this was a good step
in the long time perspective.

2)
In the code of lt_combine cited above, I noticed that you use
        m4_quote(m4_default([$1], [, ])

Do you know that this removes all spaces after commas and is effectively
the same as
        m4_quote(m4_default([$1], [,])
?

I suggest that you use the following instead:

        m4_ifval([$1], [[$1]], [[, ]])

This way the first argument to lt_join will be $1, defaulting to ", ".

3)
m4/ltoptions.m4
>  m4_define([_LT_SET_OPTIONS],
> -[AC_FOREACH([_LT_Option], [$1], [...]
> +[m4_if([$1], [], [],
> +       [AC_FOREACH([_LT_Option], [$1], [...]

This change is a workaround for a bug I introduced.
Please remove the workaround, as the bug is now fixed in the Autoconf CVS.

Let me explain:
If the second argument of AC_FOREACH is empty, the expansion should be empty,
too.
Previously, m4_split([]) expanded to [[]] instead of [] (empty string).
This was the same mistake as in previous versions of m4_cdr and m4_foreach.

m4_split is now fixed; I committed the patch as attached to this mail.

AC_FOREACH now works again and your workaround id no longer needed.

Have a nice day,
        Stepan Kasal

Attachment: autoconf-20050621-m4_split.patch
Description: Text document


reply via email to

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