Subject: Possible Makefile or build script bug
To: None <netbsd-bugs@netbsd.org>
From: Matthew Mondor <mmondor@linuxguru.net>
List: netbsd-bugs
Date: 10/27/2001 07:41:16
A possible bug in the NetBSD 1.5.2 distribution source tree:



Error: when compiling 1.5.2 from source:
compile_et.c: parse.h file not found

cc -O -I.                                -I/home/src/lib/libcom_err/compile_et/../../../include/heimdal  -I/home/src/lib/libroken/obj.i386                               -I/home/src/lib/libcom_err/compile_et/../../../crypto/dist/heimdal/lib/com_err          -I/home/src/lib/libcom_err/compile_et/../../../crypto/dist/heimdal/lib/roken            -DHAVE_CONFIG_H -c -o compile_et.lo /home/src/lib/libcom_err/compile_et/../../../crypto/dist/heimdal/lib/com_err/compile_et.c
/home/src/lib/libcom_err/compile_et/../../../crypto/dist/heimdal/lib/com_err/compile_et.c:42: parse.h: No such file or directory
*


I could find it at this location:
/home/src/lib/libcom_err/compile_et/parse.h



Here consists of my "cross"-build script: (i586-make)


#!/bin/sh

# just helping for cross compilation.

MACHINE=i386
MACHINE_ARCH=i386

# just in case you forgot to specify this when you built gcc...
CFLAGS="-D__NetBSD__"
export MACHINE MACHINE_ARCH CFLAGS

CPP=`gcc -print-prog-name=cpp`

make AR=ar AS=as CC=gcc LD=ld NM=nm \
	RANLIB=ranlib SIZE=size \
	STRIP=strip OBJCOPY=objcopy \
	CXX=c++ CPP=$CPP $*



And here is my /etc/mk.conf file:



COPTS+=-mcpu=i586 -march=i586 -O2 -fexpensive-optimizations -pipe
MANZ=yes
MKCATPAGES=no
OBJMACHINE=i386
DESTDIR=/home/newroot



Instructions were strictly followed from NetBSD's web site documentation
about how to cross-compile. I also noted that it says to symlink or copy
the includes and libraries of the new tree after building them. As I was
compiling on an i386 system, for a i586 one, and couldn't really link those
anywhere, I ensured to set COPTS+=-nostdinc -I/home/newroot/usr/include
-nostdlib -L/home/newroot/usr/lib at some point, in my several attempts,
which actually did not change anything. Looking at the build process, I
also noticed that the proper directories were automatically added to the
various cc/gcc commands already. This results after building includes,
libraries, at:

# pwd
/usr/src/
# i586-make obj build


I don't exactly remember but as I currently run a i586 compiled 1.5 system,
I think that I could compile 1.5 from source using this method.


On this current system, /usr/src consists of a symlink pointing to /home/src