Date: Sat, 18 Aug 2001 22:02:23 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: "David O'Brien" <obrien@FreeBSD.ORG> Cc: Ruslan Ermilov <ru@FreeBSD.ORG>, <current@FreeBSD.ORG>, Mark Peek <mark@whistle.com>, Warner Losh <imp@harmony.village.org> Subject: Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file Message-ID: <20010818213654.J38997-100000@besplex.bde.org> In-Reply-To: <20010817084437.C5916@dragon.nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010818213654.J38997-100000>