autoconf-patches
[Top][All Lists]
Advanced

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

FYI: loop in libtool m4 macros


From: Ralf Wildenhues
Subject: FYI: loop in libtool m4 macros
Date: Mon, 27 Jun 2005 14:28:32 +0200
User-agent: Mutt/1.4.1i

Hi Stepan,

* Stepan Kasal wrote on Mon, Jun 27, 2005 at 12:42:50PM CEST:
> On Mon, Jun 27, 2005 at 12:08:18PM +0200, Ralf Wildenhues wrote:
> > Applied to HEAD and branch-2-0.  (Only this part, so far.)
> > 
> > > -[m4_if([$1], [], [],
> > > -       [AC_FOREACH([_LT_Option], [$1],
> > > +[AC_FOREACH([_LT_Option], [$1],
> 
> thanks.  When you are at it, I also propose the patch attached below.

Thanks.  Applied (HEAD, branch-2-0).

> The reason is that AC_FOREACH will soon become obsolete.  Paul Eggert
> agreed:

> The problem with AC_FOREACH is that it encourages the wrong convention.
> 
> AC_FOREACH was never documented, so there is no problem if you replace
> it by three other undocumented macros.  ;-)

Well, since the patch is endorsed by an Autoconf author (namely, you :)
I reckon we can only win here, concerning interface changes.

Cheers,
Ralf

> 2005-06-27  Stepan Kasal  <address@hidden>
> 
>       * m4/ltoptions.m4 (_LT_UNLESS_OPTIONS, _LT_SET_OPTIONS): Replace
>         AC_FOREACH by a combination of m4_foreach/m4_split/m4_normalize.
> 
> Index: m4/ltoptions.m4
> ===================================================================
> RCS file: /cvsroot/libtool/libtool/m4/ltoptions.m4,v
> retrieving revision 1.12
> diff -u -r1.12 ltoptions.m4
> --- m4/ltoptions.m4   27 Jun 2005 10:06:31 -0000      1.12
> +++ m4/ltoptions.m4   27 Jun 2005 10:19:31 -0000
> @@ -36,7 +36,7 @@
>  # ---------------------------------------
>  # Execute IF-NOT-SET if all OPTIONS are not set.
>  m4_define([_LT_UNLESS_OPTIONS],
> -[AC_FOREACH([_LT_Option], [$1],
> +[m4_foreach([_LT_Option], m4_split(m4_normalize([$1])),
>           [m4_ifdef(_LT_MANGLE_OPTION(_LT_Option),
>                     [m4_define([$0_found])])])[]dnl
>  m4_ifdef([$0_found], [m4_undefine([$0_found])], [$2
> @@ -51,7 +51,7 @@
>  # dispatch to that macro; otherwise complain about the unknown option
>  # and exit.
>  m4_define([_LT_SET_OPTIONS],
> -[AC_FOREACH([_LT_Option], [$1],
> +[m4_foreach([_LT_Option], m4_split(m4_normalize([$1])),
>      [_LT_SET_OPTION(_LT_Option)
>      m4_ifdef(_LT_MANGLE_DEFUN(_LT_Option),
>            _LT_MANGLE_DEFUN(_LT_Option),
> 
> 




reply via email to

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