Patch to update libtool in GCC and binutils trees

Charles Wilson libtool@cwilson.fastmail.fm
Fri Mar 30 04:16:00 GMT 2007


This:

> 	if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
> 	   grep "enable shared" > /dev/null;
> 	then
> 	  LIBSUPCXX_PICFLAGS=-prefer-pic
> 	else
> 	  LIBSUPCXX_PICFLAGS=
> 	fi

isn't the correct mechanism, anymore.  From the new libtool's .info:

===========================================
    With 1.3 era libtool, if you wanted to know any details of what
libtool had discovered about your architecture and environment, you had
to run the script with `--config' and grep through the results.  This
idiom was supported up to and including 1.5.x era libtool, where it was
possible to call the generated libtool script from `configure.ac' as
soon as `LT_INIT' had completed.  However, one of the features of
libtool 1.4 was that the libtool configuration was migrated out of a
separate `ltconfig' file, and added to the `LT_INIT' macro (nee
`AC_PROG_LIBTOOL'), so the results of the configuration tests were
available directly to code in `configure.ac', rendering the call out to
the generated libtool script obsolete.

    Starting with libtool 2.0, the multipass generation of the libtool
script has been consolidated into a single `config.status' pass, which
happens after all the code in `configure.ac' has completed.  The
implication of this is that the libtool script does not exist during
execution of code from `configure.ac', and so obviously it cannot be
called for `--config' details anymore.  If you are upgrading projects
that used this idiom to libtool 2.0 or newer, you should replace those
calls with direct references to the equivalent Autoconf shell variables
that are set by the configure time tests before being passed to
`config.status' for inclusion in the generated libtool script.
===========================================

So, short version: the code above should be replaced with [untested]:

	LIBSUPCXX_PICFLAGS=
	test "$enable_shared" = yes && LIBSUPCXX_PICFLAGS=-prefer-pic

Also, this:

AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL

should be replaced with

LT_INIT([dlopen win32-dll])

(okay, the win32-dll part would correspond to the deprecated 
AC_LIBTOOL_WIN32_DLL macro, which isn't actually present in libstdc++'s 
existing configure.ac.  But it would be nice if...)

--
Chuck



More information about the Gcc-patches mailing list