Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2001 20:30:45 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        current@FreeBSD.ORG
Cc:        Mark Peek <mark@whistle.com>, Bruce Evans <bde@zeta.org.au>, Warner Losh <imp@harmony.village.org>
Subject:   Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file
Message-ID:  <20010814203045.A60765@sunbay.com>
In-Reply-To: <20010814085556.E73693@dragon.nuxi.com>; from obrien@FreeBSD.ORG on Tue, Aug 14, 2001 at 08:55:56AM -0700
References:  <20010810110151.B7988@sunbay.com> <20010810235643.Y23367-100000@besplex.bde.org> <20010810173751.B60193@sunbay.com> <p05100300b799a7ab0ef4@[207.76.207.129]> <20010810191407.A73485@sunbay.com> <p05100305b799bb5daf9c@[207.76.207.129]> <20010810202300.A80439@sunbay.com> <20010813133015.A12153@dragon.nuxi.com> <20010814095404.A71466@sunbay.com> <20010814085556.E73693@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Aug 14, 2001 at 08:55:56AM -0700, David O'Brien wrote:
> On Tue, Aug 14, 2001 at 09:54:04AM +0300, Ruslan Ermilov wrote:
> > > They produce the same output, but in the general case they do not need
> > > to.
> > 
> > What I hear?  Hell, then my solution (or something similar) should be
> > committed, as it at least unbreaks the 4.x -> 5.0 upgrade path, which
> > I am mostly concerned about (on the same arch).
> 
> I never said they weren't the same format nor that it wouldn't be fixed.
> I said I wanted to try some things.  NetBSD something simular to the
> patch below in their usr.bin/file/Makefile -- they build the .mgc files
> during build time.  The patch to src/Makefile.inc is one way to implement
> the needed hooks.
> 
Good.

> >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.
> 
Just to clarify.  Nothing should be built in ${.OBJDIR} at install time,
as it may be read-only.  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.  And
also note that only bootstrap-tools and utilities copied to the
${TMPPATH} as the first step of `installworld' are allowed during
`installworld'.

> +mkmagic:	apprentice.c print-hacked.c
> +	${HOST_CC} -o mkmagic -DHAVE_CONFIG_H -DCOMPILE_ONLY \
> +		-I${.CURDIR} -I${SRCDIR} ${.ALLSRC}
> 
Whoa, cool!

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.  Let's don't reinvent
the wheel, and please try the attached patch instead.


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=p

Index: Makefile.inc1
===================================================================
RCS file: /home/ncvs/src/Makefile.inc1,v
retrieving revision 1.208
diff -u -r1.208 Makefile.inc1
--- Makefile.inc1	2001/08/04 18:25:38	1.208
+++ Makefile.inc1	2001/08/14 17:30:11
@@ -600,7 +600,8 @@
 
 build-tools:
 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
-    ${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.sbin/sysinstall
+    ${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.bin/file \
+    usr.sbin/sysinstall
 	cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
 .endfor
 
Index: usr.bin/file/Makefile
===================================================================
RCS file: /home/ncvs/src/usr.bin/file/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- usr.bin/file/Makefile	2001/08/08 16:19:30	1.21
+++ usr.bin/file/Makefile	2001/08/14 17:30:11
@@ -34,23 +34,29 @@
 CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H
 CFLAGS+= -I${.CURDIR} -I${SRCDIR}
 
-CLEANFILES+=	magic magic.mgc magic.mime.mgc magic.mime.PITA
+CLEANFILES+=	mkmagic magic magic.mgc magic.mime.mgc magic.mime.PITA
 
 MAGFILES=	${SRCDIR}/Header\
 		${SRCDIR}/Localstuff\
 		${SRCDIR}/Magdir/[a-z]*
 
-all: file magic magic.mgc magic.mime.mgc
+all: ${PROG} magic magic.mgc magic.mime.mgc
 
+build-tools: mkmagic
+
+mkmagic: apprentice.c print-hacked.c
+	${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \
+	    -I${.CURDIR} -I${SRCDIR} -o ${.TARGET} ${.ALLSRC}
+
 magic: ${MAGFILES}
 	cat ${.ALLSRC} > ${.TARGET}
 
-magic.mgc: file magic
-	./${PROG} -C -m magic
+magic.mgc: mkmagic magic
+	./mkmagic magic
 
-magic.mime.mgc: file magic.mime
+magic.mime.mgc: mkmagic magic.mime
 	ln -sf ${SRCDIR}/magic.mime magic.mime.PITA
-	./${PROG} -C -m magic.mime.PITA
+	./mkmagic magic.mime.PITA
 	mv magic.mime.PITA.mgc magic.mime.mgc
 
 CLEANFILES+=	print-hacked.c

--k+w/mQv8wyuph6w0--

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?20010814203045.A60765>