Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2001 14:46:49 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        <current@FreeBSD.ORG>
Cc:        Ruslan Ermilov <ru@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:  <20010815140226.V17885-100000@besplex.bde.org>
In-Reply-To: <20010814190921.A25060@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010815140226.V17885-100000>