From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3658 invoked by alias); 12 Apr 2007 07:03:14 -0000 Received: (qmail 3639 invoked by uid 22791); 12 Apr 2007 07:03:12 -0000 X-Spam-Check-By: sourceware.org Received: from server.usilu.net (HELO mail.usilu.net) (195.176.178.200) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 12 Apr 2007 08:03:02 +0100 Received: from [192.168.76.141] ([192.168.76.141] RDNS failed) by mail.usilu.net over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Apr 2007 09:03:44 +0200 Message-ID: <461DD98E.50901@lu.unisi.ch> Date: Thu, 12 Apr 2007 07:03:00 -0000 From: Paolo Bonzini Reply-To: bonzini@gnu.org User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: Charles Wilson CC: Charles Wilson , Steve Ellcey , dave.korn@artimi.com, binutils@sourceware.org, gcc-patches@gcc.gnu.org, gdb-patches@gcc.gnu.org, newlib@sourceware.org, Ralf.Wildenhues@gmx.de, aoliva@redhat.com, fxcoudert@gmail.com, schwab@suse.de 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> In-Reply-To: <461DD341.2010000@fastmail.fm> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00158.txt.bz2 > 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