[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Ensure LT_PATH_LD works when called before LT_INIT
From: |
Charles Wilson |
Subject: |
[PATCH] Ensure LT_PATH_LD works when called before LT_INIT |
Date: |
Fri, 19 Jun 2009 13:33:22 -0400 |
* libltdl/m4/libtool.m4 (LT_PATH_LD): AC_REQUIRE _LT_PROG_ECHO_BACKSLASH.
Original patch by Yaakov Selkowitz. As he explained:
>
> There's a bug in LT_PATH_LD (AC_PROG_LD) when called prior to LT_INIT
> (AC_PROG_LIBTOOL):
>
> checking for ld used by gcc...
> /usr/lib/gcc/i686-pc-cygwin/4.3.2/../../../../i686-pc-cygwin/bin/ld: no input
> files
> ./configure: line 3955: : command not found
>
> Yet this does not occur when the same macro is run by LT_INIT.
>
> Here's the offending hunk:
>
> # Canonicalize the pathname of ld
> ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
> while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
> ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
> done
>
> The problem is that $ECHO hasn't been defined yet. This is done by
> _LT_PROG_ECHO_BACKSLASH, which is called at the beginning of LT_INIT, but
> isn't
> an explicit requirement of LT_PATH_LD, which may be called on its own.
> (AFAICS, all other macros which use $ECHO are libtool-internal and would only
> be called after LT_INIT.)
While it is not typical for LT_* functions to be called before LT_INIT,
this can happen in this case because when libtool is in use, AC_PROG_LD
is AU_DEFUN'ed to _LT_PATH_LD. And it is certainly ok for AC_PROG_LD
to be called before LT_INIT or AC_PROG_LIBTOOL (as AC_PROG_LIBTOOL is
AU_DEFUN'ed to LT_INIT). So, it /ought/ to work, but it doesn't.
This patch seems like an obvious fix to me. Ok to push?
---
libltdl/m4/libtool.m4 | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 5f24fab..6beb125 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2772,6 +2772,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
AC_ARG_WITH([gnu-ld],
[AS_HELP_STRING([--with-gnu-ld],
--
1.6.3.1
- [PATCH] Ensure LT_PATH_LD works when called before LT_INIT,
Charles Wilson <=