Don't add `-I${NETBSDSRCDIR}/sys' to HOST_CPPFLAGS to pull

necessary target system headers (<fs/unicode.h> and <fs/cd9660/iso.h>)
because system headers for the host (like <sys/stat.h>) are also pulled
from there and it causes build errors if target src tree is different
from installed one on the host.
Instead, copy the necessary system headers for host's programs into
${.OBJDIR} first.

Problem reported from Geert Hendrickx, and there is no particular comment
on tech-toolchain.
This commit is contained in:
tsutsui 2006-10-15 04:24:11 +00:00
parent 4fcce87c8c
commit 78ca0f3f54
1 changed files with 16 additions and 2 deletions

View File

@ -1,10 +1,24 @@
# $NetBSD: Makefile,v 1.6 2006/09/17 03:56:03 tsutsui Exp $
# $NetBSD: Makefile,v 1.7 2006/10/15 04:24:11 tsutsui Exp $
HOSTPROG= macppc_installboot
SRCS= installboot.c cd9660.c cd9660_util.c
NOMAN= # defined
HOST_CPPFLAGS+= -I${.CURDIR} -I${NETBSDSRCDIR}/sys
HOST_CPPFLAGS+= -I. -I${.CURDIR}
#HOST_CPPFLAGS+= -DDEBUG
.if !make(obj) && !make(clean) && !make(cleandir)
.BEGIN:
-rm -rf fs
${HOST_INSTALL_DIR} fs
${HOST_INSTALL_DIR} fs/cd9660
${HOST_INSTALL_FILE} ${NETBSDSRCDIR}/sys/fs/unicode.h fs
${HOST_INSTALL_FILE} ${NETBSDSRCDIR}/sys/fs/cd9660/iso.h fs/cd9660
.endif
cleandir distclean: cleaninc
cleaninc:
-rm -rf fs
.include <bsd.hostprog.mk>