This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Final(?) patch to update libtool in GCC and src trees
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Charles Wilson <cwilson at fastmail dot fm>
- Cc: Charles Wilson <libtool at cwilson dot fastmail dot fm>, Steve Ellcey <sje at cup dot hp dot com>, dave dot korn at artimi dot com, binutils at sourceware dot org, gcc-patches at gcc dot gnu dot org, gdb-patches at gcc dot gnu dot org, newlib at sourceware dot org, Ralf dot Wildenhues at gmx dot de, aoliva at redhat dot com, fxcoudert at gmail dot com, schwab at suse dot de
- Date: Thu, 12 Apr 2007 09:02:38 +0200
- Subject: Re: Final(?) patch to update libtool in GCC and src trees
- References: <200704102006.NAA21177@hpsje.cup.hp.com> <461C49E6.6090706@cwilson.fastmail.fm> <461DD341.2010000@fastmail.fm>
- Reply-to: bonzini at gnu dot org
It's a little unorthodox (and assumes a lot about libtool's
implementation) but we COULD:
(1) hardlink/copy ${ORIGINAL_AS_FOR_TARGET--without-$exeext} .
(2) hardlink/copy ${ORIGINAL_AS_FOR_TARGET--with_$exeext} .
(3) mkdir .libs
(4) hardlink/copy ${ORIGINAL_AS_FOR_TARGET--with-/.libs/-inserted} .libs/
Another possibility (and I would be grateful if you would test this) is
to confine all this stuff into a script, something like this (I'll call
it exec-tool.in):
#! /bin/sh
ORIGINAL_AS_FOR_TARGET="@ORIGINAL_AS_FOR_TARGET@"
ORIGINAL_LD_FOR_TARGET="@ORIGINAL_LD_FOR_TARGET@"
ORIGINAL_NM_FOR_TARGET="@ORIGINAL_NM_FOR_TARGET@"
invoked=`basename "$0"`
case "$invoked" in
as)
original=$ORIGINAL_AS_FOR_TARGET
prog=as-new
dir=gas
;;
collect-ld)
original=$ORIGINAL_LD_FOR_TARGET
prog=ld-new
dir=ld
;;
nm)
original=$ORIGINAL_NM_FOR_TARGET
prog=nm-new
dir=binutils
;;
esac
case "$original" in
../*)
if test -x ../$dir/$prog; then
exec ../$dir/$prog ${1+"$@"}
else
exec ../prev-$dir/$prog ${1+"$@"}
fi
;;
*)
exec "$original" ${1+"$@"}
;;
esac
Then, you *can* use symlinks. So in configure.ac you can simply do
AC_CONFIG_FILES(exec-tool.sh:exec-tool.in, [chmod +x exec-tool.sh])
case "$ORIGINAL_AS_FOR_TARGET" in
./as) ;;
*) AC_CONFIG_LINKS(as:exec-tool.sh) ;;
esac
case "$ORIGINAL_LD_FOR_TARGET" in
./collect-ld) ;;
*) AC_CONFIG_LINKS(collect-ld:exec-tool.sh) ;;
esac
case "$ORIGINAL_NM_FOR_TARGET" in
./nm) ;;
*) AC_CONFIG_LINKS(nm:exec-tool.sh) ;;
esac
and drop all the as/collect-ld/nm rules from Makefile.in.
Paolo