Subject: misc/33095: building tools from scratch prints incorrect warning
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <j+nbsd@2006.salmi.ch>
List: netbsd-bugs
Date: 03/17/2006 20:15:00
>Number:         33095
>Category:       misc
>Synopsis:       building tools from scratch prints incorrect warning
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 17 20:15:00 +0000 2006
>Originator:     Jukka Salmi
>Release:        NetBSD 3.99.17
>Environment:
System: NetBSD moray.salmi.ch 3.99.17 NetBSD 3.99.17 (GENERIC.APM) #0: Thu Mar 16 13:53:31 CET 2006 build@moray.salmi.ch:/build/nbsd/i386/sys/arch/i386/compile/GENERIC.APM i386
Architecture: i386
Machine: i386
>Description:
Building src/tools from scratch prints an incorrect warning (see below).
>How-To-Repeat:
$ cd /usr/src && ./build.sh -O /tmp/build -T /tmp/tools tools
[...]
rm -f PREVIOUSTOOLDIR
*** WARNING: TOOLDIR has moved?
*** PREVIOUSTOOLDIR ''
***     !=  TOOLDIR '/tmp/tools'
*** Cleaning mis-matched tools
rm -f PREVIOUSTOOLDIR
(cd /usr/src/tools && /tmp/tools/bin/nbmake cleandir)
[...]
>Fix:
Index: tools/Makefile
===================================================================
RCS file: /cvsroot/src/tools/Makefile,v
retrieving revision 1.93
diff -u -p -r1.93 Makefile
--- tools/Makefile	3 Feb 2006 22:07:57 -0000	1.93
+++ tools/Makefile	17 Mar 2006 19:54:36 -0000
@@ -122,7 +122,7 @@ PREVIOUSTOOLDIR=	
 CLEANFILES+=	PREVIOUSTOOLDIR
 
 realall realdepend: .MAKE
-.if "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
+.if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
 	@echo "*** WARNING: TOOLDIR has moved?"
 	@echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
 	@echo "***     !=  TOOLDIR '${TOOLDIR}'"