From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16141 invoked by alias); 7 Oct 2003 22:53:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16131 invoked from network); 7 Oct 2003 22:53:06 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 7 Oct 2003 22:53:06 -0000 Received: from drow by nevyn.them.org with local (Exim 4.22 #1 (Debian)) id 1A70hV-0003Qc-Q1 for ; Tue, 07 Oct 2003 18:53:05 -0400 Date: Tue, 07 Oct 2003 22:53:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: RFC: Use program_transform_name correctly Message-ID: <20031007225305.GA13082@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20031007215028.GA11817@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-10/txt/msg00178.txt.bz2 On Tue, Oct 07, 2003 at 03:10:59PM -0700, Theodore A. Roth wrote: > > > On Tue, 7 Oct 2003, Daniel Jacobowitz wrote: > > > On Tue, Oct 07, 2003 at 04:41:35PM -0500, Jim Blandy wrote: > > > > > > It seems as if some Makefiles aren't properly using > > > program_transform_name. > > > > > > The same kind of weirdness corrected(?) in the patch below appears in > > > gdb/Makefile.in, so I'm not at all sure I'm not misunderstanding > > > what's going on. If folks agree that the change below would be > > > correct, then I'll put together a larger patch that fixes the ones I > > > can find elsewhere, too. > > > > > > (Not sure why this hasn't come up before; Daniel J.'s recent posts on > > > the topic seem to be about setting program_transform_name, not on how > > > to use it.) > > > > That is _bizarre_. Does it even give you anything but a sed error now? > > > > > 2003-10-07 Jim Blandy > > > > > > * Makefile.in (RUNTEST_FOR_TARGET): Pass the transformation to set > > > properly. > > > > > > Index: gdb/testsuite//Makefile.in > > > =================================================================== > > > RCS file: /cvs/cvsfiles/devo/gdb/testsuite/Makefile.in,v > > > retrieving revision 1.66 > > > diff -c -r1.66 Makefile.in > > > *** gdb/testsuite//Makefile.in 9 Sep 2003 21:03:53 -0000 1.66 > > > --- gdb/testsuite//Makefile.in 7 Oct 2003 21:33:22 -0000 > > > *************** > > > *** 53,59 **** > > > if [ "$(host_canonical)" = "$(target_canonical)" ]; then \ > > > echo runtest; \ > > > else \ > > > ! t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \ > > > fi; \ > > > fi` > > > > > > --- 53,59 ---- > > > if [ "$(host_canonical)" = "$(target_canonical)" ]; then \ > > > echo runtest; \ > > > else \ > > > ! t='$(program_transform_name)'; echo runtest | sed -e '$$t'; \ > > > fi; \ > > > fi` > > > > That's certainly what it's supposed to look like. > > > > You sure that the expression is right? I think the single quotes will > hide the expansion of $t in the shell. I ran a simple test on my > system with this make file fragment: > > roth@knuth:/tmp$ cat Makefile > program_transform_name = s/^/avr-/ > > all: > t='$(program_transform_name)'; echo runtest | sed -e '$$t' > t='$(program_transform_name)'; echo runtest | sed -e "$$t" > roth@knuth:/tmp$ make > t='s/^/avr-/'; echo runtest | sed -e '$t' > runtest > t='s/^/avr-/'; echo runtest | sed -e "$t" > avr-runtest Eh, you're right, this will teach me to answer without looking. From gcc/Makefile.in: t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \ That's the idiom we should use here. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer