libtool-patches
[Top][All Lists]
Advanced

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

Re: loop in libtool m4 macros


From: Ralf Wildenhues
Subject: Re: loop in libtool m4 macros
Date: Thu, 9 Jun 2005 21:53:36 +0200
User-agent: Mutt/1.5.9i

Hi Ralf,

You just made my day.  :)

* Ralf Menzel wrote on Thu, Jun 09, 2005 at 06:50:18PM CEST:
> 
> > Index: m4/libtool.m4
> [...]
> > -[lt_join($@, lt_decl_varnames_tagged([$1],
> [...]
> 
> Well I head a look at the traces. This indicated that lt_combine might
> be the culprit. (lt_join uses lt_combine.) Though I didn't know what

(It's the other way round, but anyway.)

> this might effect, I made the following change. (More or less just
> because _lt_combine looks similar.)

Cool!  Thanks!

*snip patch*
> I was pleasently suprised to see, that the loop disapeared. But
> instead I got another error:
> 
> --- snip ---
> configure.ac:44: error: Unknown option `' to LT_INIT_LIBTOOL

> The error came for every configure.ac where LT_INIT is used without
> options. I'd try the following change but haven't got time to test it
> now. Maybe someone else can make further investigation.

You were close.  With this slightly simpler patch below, everything
seems to work.  I'd still like someone that actually knows something
about m4 to take a look at this before committing it -- also the
proposed ChangeLog entry!  (Also, my m4 indentation style, erm, sucks.
Is there a set of rules?)  It seems _lt_combine is not used at all --
should we still keep it?

Cheers,
Ralf

        * m4/ltoptions.m4 (_LT_SET_OPTIONS): Loop options only if
        nonempty.
        * m4/ltsugar.m4 (lt_combine): Don't test against empty quotes,
        test against empty arg.  Fixes infinite m4 loop with CVS Autoconf.

Index: m4/ltoptions.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/ltoptions.m4,v
retrieving revision 1.6.2.4
diff -u -r1.6.2.4 ltoptions.m4
--- m4/ltoptions.m4     9 Jan 2005 13:48:56 -0000       1.6.2.4
+++ m4/ltoptions.m4     9 Jun 2005 19:46:45 -0000
@@ -51,12 +51,14 @@
 # dispatch to that macro; otherwise complain about the unknown option
 # and exit.
 m4_define([_LT_SET_OPTIONS],
-[AC_FOREACH([_LT_Option], [$1],
-    [_LT_SET_OPTION(_LT_Option)
-    m4_ifdef(_LT_MANGLE_DEFUN(_LT_Option),
+[m4_if([$1], [], [],
+       [AC_FOREACH([_LT_Option], [$1],
+       [_LT_SET_OPTION(_LT_Option)
+           m4_ifdef(_LT_MANGLE_DEFUN(_LT_Option),
                _LT_MANGLE_DEFUN(_LT_Option),
        [m4_fatal([Unknown option `]_LT_Option[' to LT][_INIT_LIBTOOL])])
-    ])dnl
+       ])dnl
+       ])
 dnl
 dnl Simply set some default values (i.e off) if boolean options were not
 dnl specified:
Index: m4/ltsugar.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/ltsugar.m4,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 ltsugar.m4
--- m4/ltsugar.m4       9 Jan 2005 13:48:56 -0000       1.2.2.1
+++ m4/ltsugar.m4       9 Jun 2005 19:46:45 -0000
@@ -38,7 +38,7 @@
 # PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
 # has the form PREFIXmINFIXSUFFIXn.
 m4_define([lt_combine],
-[m4_if([$2], [[]], [],
+[m4_if([$2], [], [],
        [lt_join(m4_quote(m4_default([$1], [, ])),
                _$0([$1], m4_car($2)[$3], m4_shiftn(3, $@)),
                $0([$1], m4_cdr($2), m4_shiftn(2, $@)))])])




reply via email to

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