This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Patch to update libtool in GCC and Src trees
- From: "Charles Wilson" <libtool at cwilson dot fastmail dot fm>
- To: newlib at sourceware dot org
- Cc: "Alexandre Oliva" <aoliva at redhat dot com>, "Steve Ellcey" <sje at cup dot hp dot com>, "Ralf Wildenhues" <Ralf dot Wildenhues at gmx dot de>
- Date: Tue, 15 May 2007 14:06:41 -0400
- Subject: Re: Patch to update libtool in GCC and Src trees
Forwarded message from off-list conversation:
On Tue, 15 May 2007 18:41:15 +0200, "Ralf Wildenhues" said:
> Hi Charles,
>
> * Charles Wilson wrote on Tue, May 15, 2007 at 08:23:14AM CEST:
> >
> > However, updating newlib is not simple. It boils down to this -- about 15
> > of the configure.in's in newlib (which has about 75 separately-configured
> > subprojects) contain something like:
> >
> > if test "${use_libtool}" = "yes"; then
> > AC_LIBTOOL_WIN32_DLL
> > AM_PROG_LIBTOOL
> > fi
> >
> > which apparently worked with the old libtool, but with the new libtool you
> > end up with undefined macros getting used ($Xsed, for example).
> > http://www.cygwin.com/ml/newlib/2007/msg00523.html
>
> First, I think this is a bug in Libtool. Thanks for the report.
> (If you send it to bug-libtool -- preferably with a test case, then it
> won't be forgotten ;-)
>
> Second, I think the right way to do it should have been written as
> AS_IF([test "$use_libtool" = yes],
> [AC_LIBTOOL_WIN32_DLL
> AM_PROG_LIBTOOL])
>
> but oh well, we can't do that as then 99% of the libtool configure code
> is executed unconditionally (because lots of it is pulled in via
> AC_REQUIRE/m4_require), at least with Autoconf 2.61's AS_IF. So
> forget about this solution, as nice as it would have looked like.
> (A workaround for Autoconf 2.59 would have been simple, BTW.)
>
> I think it suffices to get $SED and $Xsed right, and be aware of some
> macros that may be needed by other macros. Paolo's approach to use
> _LT_DECL_SED looks good to me, but I haven't tested it; I tried this
> (before seeing his idea):
>
> --- snip ---
> AC_PROG_SED
> if test "$use_libtool" = yes; then
> AC_LIBTOOL_WIN32_DLL
> AM_PROG_LIBTOOL
> fi
> : ${Xsed="$SED -e 1s/^X//"}
> --- snip ---
>
> Be sure to have called the following macros beforehand, if you
> or another macro that comes after the libtool macros needs them:
> AC_PROG_CC, AC_CANONICAL_BUILD, AC_CANONICAL_HOST,
> AC_PROG_LN_S, AC_PROG_EGREP, AC_PROG_FGREP.
>
> Note that if you want to avoid doing multiple identical changes to
> several configure.ac files: you cannot use AC_DEFUN in this case to wrap
> the above snippet (because then those libtool configure tests will come
> out early again). If you're interested in still getting things in a
> common macro file, ask again for a hacky way.