From owner-freebsd-current@FreeBSD.ORG Sat Jul 12 20:01:10 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2AC337B401; Sat, 12 Jul 2003 20:01:09 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EF6543F75; Sat, 12 Jul 2003 20:01:08 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id MAA15659; Sun, 13 Jul 2003 12:57:03 +1000 Date: Sun, 13 Jul 2003 12:57:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Tim Kientzle In-Reply-To: <3F10B60C.3000106@acm.org> Message-ID: <20030713123229.A2435@gamplex.bde.org> References: <20030712165749.GA14599@colocall.net> <3F104A71.7060906@acm.org> <3F105499.BC7768C0@mindspring.com> <3F10576E.3060904@acm.org> <20030713095642.B1771@gamplex.bde.org> <3F10B60C.3000106@acm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: jmallett@freebsd.org cc: freebsd-current@freebsd.org cc: Andrey Elperin Subject: Re: make release of CURRENT on 4.7 box X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 03:01:10 -0000 On Sat, 12 Jul 2003, Tim Kientzle wrote: > Bruce Evans wrote: > > On Sat, 12 Jul 2003, Tim Kientzle wrote: > >>To be honest, I was never able to understand how > >>the previous version was supposed to work, since > >>the newvers.sh script was run with a very > >>odd current directory. > > > > Looks like it was assumed to just set variables, so that sourcing > > it doesn't make a mess. > > Here's the part that confuses me. > sys/conf/newvers.sh does more than just > set variables: I think it was originally only for building ver* files for kernels. Then it got (mis)used in src/include/Makefile. > * It updates the file "version" in the current directory > * It creates the file "vers.c" in the current directory This is very old kernel-building stuff. The only problem with it seems to be that it writes garbage files vers.c and `version' to the current directory (always the object directory for src/include?) > * It runs 'make -V KERN_IDENT' , which assumes at a minimum > that there is a Makefile in the current directory. > (Otherwise, you're invoking 'make' with no target.) This part is from a commit to newvers.sh last month. > When building -CURRENT on 4.7, the build fails in > /usr/src/include because of the following: > > osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ > ${.CURDIR}/../sys/sys/param.h \ > ${.CURDIR}/Makefile > @${ECHO} creating osreldate.h from newvers.sh > @setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \ > . ${.CURDIR}/../sys/conf/newvers.sh; \ > echo "$$COPYRIGHT" > osreldate.h; \ > > In particular, newvers.sh is being run with the > current directory being ${.OBJDIR}, and ${.OBJDIR} > doesn't contain a Makefile, so the 'make -V KERN_IDENT' > fails. My patch just runs newvers.sh in ${.CURDIR}, > which is also wrong, since that creates two files in > ${.CURDIR} that shouldn't be there. The difference seems to be that `make -V FOO' doesn't require a Makefile in -current. I think this is a side effect of indirectly related fixes for make -V (maybe the one to fix `make -f /dev/null -V FOO'. ISTR `make foo.o' never required a Makefile with BSD make. Apparently `make -V' was surprisingly different, and still is in 4.7. > I don't know the "right" way to fix this, because > I don't really understand why 'osreldate.h' cares > about KERN_IDENT, nor why it is reasonable for vers.c > and version to be created as side-effects. I suspect > that newvers.sh should be broken into two pieces: one > that sets the variables and another that creates/updates > version and vers.c. The former might then be useful > in building osreldate.h. I think splitting it or making it exit after just setting variables in the userland case is the right fix. I don't completely understand the KERN_IDENT changes, but they are only relevant for building kernels so we just need to turn them off for src/include/Makefile. Bruce