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: Mon, 27 Jun 2005 12:42:50 +0200
User-agent: Mutt/1.4.1i

Hello,

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.

The reason is that AC_FOREACH will soon become obsolete.  Paul Eggert
agreed:
http://lists.gnu.org/archive/html/autoconf-patches/2005-05/msg00082.html

(I haven't yet found time to finish and commit that patch.)

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.  ;-)

Have a nice day,
        Stepan


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]