From owner-freebsd-current Sat Aug 18 5: 2:34 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 5A8A737B41C; Sat, 18 Aug 2001 05:02:30 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA13532; Sat, 18 Aug 2001 22:02:26 +1000 Date: Sat, 18 Aug 2001 22:02:23 +1000 (EST) From: Bruce Evans X-X-Sender: To: "David O'Brien" Cc: Ruslan Ermilov , , Mark Peek , Warner Losh Subject: Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file In-Reply-To: <20010817084437.C5916@dragon.nuxi.com> Message-ID: <20010818213654.J38997-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 17 Aug 2001, David O'Brien wrote: > On Wed, Aug 15, 2001 at 12:40:19PM +1000, Bruce Evans wrote: > > On Tue, 14 Aug 2001, Ruslan Ermilov wrote: > > > > > On Tue, Aug 14, 2001 at 08:55:56AM -0700, David O'Brien wrote: > > > > >From a correctness stand point, building the .mgc files at install time > > > > is the correct thing to do... or maybe we should do both -- doing the > > > > [re]creation of the .mgc files at install time in the cross-[arch-]build > > > > case. > > > > Not both. > > Which do you prefer? The CC_HOST way, the build-tools way, or the at > install time way? build-tools. > > > +build-tools: mkmagic > > > + > > > +mkmagic: apprentice.c print-hacked.c > > > + ${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \ > > > + -I${.CURDIR} -I${SRCDIR} -o ${.TARGET} ${.ALLSRC} > > > > This should use CFLAGS if possible, and should use LDFLAGS, something > > like: > > > > ${CC} -DCOMPILE_ONLY {CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} > > The include path in CFLAGS is wrong for this: > > -I/FBSD/5.x/usr.bin/file -I/FBSD/5.x/usr.bin/file/../../contrib/file > -I/usr/obj/FBSD/5.x/i386/usr/include > > namely pointing into /usr/obj. The extra directory seems to be a bug elsewhere. bsd.lib.mk and bsd.prog.mk add -I${DESTDIR}/usr/include to CFLAGS if DESTDIR is set. This is the wrong place to add it, but /usr/src/Makefile.inc1 relies on this for the WMAKEENV (world) stage. Makefile.inc1 also sets DESTDIR for the BMAKEENV (bootstrap-tool) and XMAKEENV (cross-tools) stages. I think this breaks these stages if NOCLEAN is set (if NOCLEAN is not set, then the extra include dir is cleaned early, and it remains unpopulated until the WMAKEENV stage). I think this is not broken for the TMAKEENV (build-tools) stage unless DESTDIR is set externally (and NOCLEAN is set). You saw the extra include dir for the `file' build-tool because you set DESTDIR externally. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message