From owner-freebsd-current Wed Dec 13 3:46:51 2000 From owner-freebsd-current@FreeBSD.ORG Wed Dec 13 03:46:49 2000 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mail.jeamland.net (rafe.jeamland.net [203.18.243.114]) by hub.freebsd.org (Postfix) with ESMTP id 5B9ED37B404 for ; Wed, 13 Dec 2000 03:46:48 -0800 (PST) Received: by mail.jeamland.net (Postfix, from userid 1000) id 2C76670601; Wed, 13 Dec 2000 22:46:46 +1100 (EST) Date: Wed, 13 Dec 2000 22:46:45 +1100 From: Benno Rice To: freebsd-current@freebsd.org Subject: Patch to allow overriding of nm in lorder, genassym.sh Message-ID: <20001213224645.A16171@rafe.jeamland.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Does anyone object to me committing the attached patch? It basically allows the overriding of nm in lorder(1) and sys/kern/genassym.sh using the environment variable NM. I've been using this locally as I've been building with 'powerpc-elf-nm' rather than nm. Comments? Objections? Review? =) -- Benno Rice benno@FreeBSD.org --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="nm.diff" Index: sys/kern/genassym.sh =================================================================== RCS file: /home/ncvs/src/sys/kern/genassym.sh,v retrieving revision 1.1 diff -u -r1.1 genassym.sh --- sys/kern/genassym.sh 2000/06/02 09:27:48 1.1 +++ sys/kern/genassym.sh 2000/12/13 11:48:32 @@ -22,7 +22,9 @@ *) usage;; esac -nm "$1" | awk ' +# If the environment variable NM is set, use that. +# Otherwise use 'nm' and hope it's in the path. +${NM:='nm'} "$1" | awk ' / C .*sign$/ { sign = substr($1, length($1) - 3, 4) sub("^0*", "", sign) Index: usr.bin/lorder/lorder.sh =================================================================== RCS file: /home/ncvs/src/usr.bin/lorder/lorder.sh,v retrieving revision 1.3 diff -u -r1.3 lorder.sh --- usr.bin/lorder/lorder.sh 2000/05/17 22:46:47 1.3 +++ usr.bin/lorder/lorder.sh 2000/11/05 05:09:48 @@ -63,7 +63,10 @@ # # if the line has " U " it's a globally undefined symbol, put it into # the reference file. -nm -go $* | sed " +# +# if the variable NM is set, use that as our nm executable. Otherwise trust +# the path. +${NM:="nm"} -go $* | sed " / [TD] / { s/:.* [TD] / / w $S Index: usr.bin/lorder/lorder.1 =================================================================== RCS file: /home/ncvs/src/usr.bin/lorder/lorder.1,v retrieving revision 1.5 diff -u -r1.5 lorder.1 --- usr.bin/lorder/lorder.1 1999/08/28 01:03:16 1.5 +++ usr.bin/lorder/lorder.1 2000/12/13 11:47:47 @@ -61,6 +61,12 @@ .Bd -literal -offset indent ar cr library.a `lorder ${OBJS} | tsort` .Ed +.Sh ENVIRONMENT +If the environment variable +.Ev NM +is set, it is used instead of +.Xr nm 1 +in determining interdependancies. .Sh SEE ALSO .Xr ar 1 , .Xr ld 1 , --8t9RHnE3ZwKMSgU+-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message