From owner-freebsd-current Tue Aug 14 21:49:38 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 1DBA137B401; Tue, 14 Aug 2001 21:49:29 -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 OAA24543; Wed, 15 Aug 2001 14:49:25 +1000 Date: Wed, 15 Aug 2001 14:46:49 +1000 (EST) From: Bruce Evans X-X-Sender: To: 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: <20010814190921.A25060@dragon.nuxi.com> Message-ID: <20010815140226.V17885-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 Tue, 14 Aug 2001, David O'Brien wrote: > On Tue, Aug 14, 2001 at 08:30:45PM +0300, Ruslan Ermilov wrote: > > > The build in ${DESTDIR} is allowed, we, for > > example, execute makewhatis(1) at the end of `installworld'. But this > > "build" is implicit, i.e., it's not done by make dependencies. > > What is wrong with doing the .mgc creation during make install? 1. May have cross building problems. Installing on the host should work someday. 2. Doesn't work as well as install(1) unless we add most of install(1)'s features to the creation program. > The > behavior of ``file -C'' is to write the .mgc in the same directory as the > source file. That behavior does not make me happy, and is the source of > the use of "magic.mime.PITA". It takes 23 lines just to append ".mgc" to the source file name. This misfeature could be left out for the COMPILE_ONLY case. > > That's what I wanted from the very beginning (-DCOMPILE_ONLY knob). > > It then fits just nicely into the `build-tools' concept. And we > > don't need this ugly HOST_CC hack for Makefile.inc1, as ${CC} is > > set correctly during the `build-tools' stage. > > I personally often find `build-tools' a hack, and would really prefer to > build things that can be at program compile time. The correct way is to build the tools earlier, in one directory for each tool so that the standard rules work right and different compilation environments can easily be arranged. This would be easy to implement for file(1) since there is only one tool. > > Let's don't reinvent the wheel, and please try the attached patch > > instead. > > I don't see why HOST_CC is such a hack. I think it is more clear what is > going on than adding mkmagic to build-tools. It essentially hard-codes a special case of TMAKE/TMAKEENV. It is superficially easier to understand, but actually much more complicated. TMAKEENV gives a relatively simple host environment, with things like COMPILER_PATH unset. When you build mkmagic later, the more complicated WMAKEENV environment is in effect, and you need to kill parts of it to get back to TMAKEENV. This is not easy. HOST_CC only sets a couple of parts IIRC, and doesn't do this quite right (it should unset COMPILER_PATH instead of setting it ...). > > RCS file: /home/ncvs/src/usr.bin/file/Makefile,v > ... > > +build-tools: mkmagic > > + > > +mkmagic: apprentice.c print-hacked.c > > + ${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \ > > + -I${.CURDIR} -I${SRCDIR} -o ${.TARGET} ${.ALLSRC} > > Why shouldn't mkmagic be added to CLEANFILES? It is (just in a different place?). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message