Subject: Re: Missing includes when cross-compiling tools
To: Tyler Mitchell <fission@styrophone.net>
From: Simon Burge <simonb@wasabisystems.com>
List: current-users
Date: 02/11/2003 16:12:47
Tyler Mitchell wrote:

> Hello,
> 
> I am trying to build a kernel (1.6 release) for NetBSD/sparc on a Linux
> system (Slackware 8), and build.sh -t seems to stop in a couple different
> places.  This is the command I use:
> 
> [ ... ]
>
> dependall ===> cat
> cc -O -I/home/fission/src/tools/compat/obj -I/home/fission/src/tools/compat/obj/include  -I/home/fission
/src/tools/cat/../compat -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -c -o cat.lo.o /home/fission/src/tools/c
at/../../bin/cat/cat.c
> /home/fission/src/tools/cat/../../bin/cat/cat.c:42: parse error before string constant
> /home/fission/src/tools/cat/../../bin/cat/cat.c:42: warning: data definition has no type or storage clas
s
> /home/fission/src/tools/cat/../../bin/cat/cat.c:50: parse error before string constant
> /home/fission/src/tools/cat/../../bin/cat/cat.c:50: warning: data definition has no type or storage clas
s
> /home/fission/src/tools/cat/../../bin/cat/cat.c: In function `raw_args':
> /home/fission/src/tools/cat/../../bin/cat/cat.c:263: `EFTYPE' undeclared (first use in this function)
> /home/fission/src/tools/cat/../../bin/cat/cat.c:263: (Each undeclared identifier is reported only once
> /home/fission/src/tools/cat/../../bin/cat/cat.c:263: for each function it appears in.)

These two problems were fixed in later versions of cat.c:

	----------------------------
	revision 1.34
	date: 2002/06/11 22:05:07;  author: bjh21;  state: Exp;  lines: +5 -4
	Rather than (ab)using the standard error message for EFTYPE, print our own
	message when "cat -f" is used on a non-regular file.  This is necessary to
	make cat(1) portable to systems that don't have EFTYPE (like Linux).
	----------------------------
	revision 1.33
	date: 2002/06/11 22:01:30;  author: bjh21;  state: Exp;  lines: +4 -4
	Only use __RCSID() and __COPYRIGHT() if they're defined.
	----------------------------

It would probably be easier to cross-build NetBSD-current instead of
NetBSD 1.6 if you don't have a pressing reason to use the 1.6 release.
I suspect there was more than just these two linuxisms that were fixed
at that time...

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/