Fix the toolification of disklabel by using the nbinclude namespace

under HAVE_NBTOOL_CONFIG_H for disktab.h as well.  This means
disktab.h has to be installed in the nbinclude include directory.

(Failure mode: with TOOLDIR as a subdirectory of /usr, the host's disktab.h
got picked up, and not the in-tree copy.)

Reviewed by dyoung.
This commit is contained in:
he 2005-06-22 21:35:28 +00:00
parent dd3259cec0
commit 0ec45ddeab
2 changed files with 11 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.c,v 1.32 2005/06/12 19:46:15 dyoung Exp $ */
/* $NetBSD: disklabel.c,v 1.33 2005/06/22 21:35:28 he Exp $ */
/*
* Copyright (c) 1983, 1987, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)disklabel.c 8.2 (Berkeley) 5/3/95";
#else
__RCSID("$NetBSD: disklabel.c,v 1.32 2005/06/12 19:46:15 dyoung Exp $");
__RCSID("$NetBSD: disklabel.c,v 1.33 2005/06/22 21:35:28 he Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -50,8 +50,8 @@ __RCSID("$NetBSD: disklabel.c,v 1.32 2005/06/12 19:46:15 dyoung Exp $");
#include <ufs/ffs/fs.h>
#if HAVE_NBTOOL_CONFIG_H
#include "../../sys/sys/disklabel.h"
#include "../../include/disktab.h"
#include <nbinclude/sys/disklabel.h>
#include <nbinclude/disktab.h>
#else
#include <sys/disklabel.h>
#include <disktab.h>

View File

@ -1,12 +1,14 @@
# $NetBSD: Makefile.disklabel,v 1.1 2005/06/12 19:46:17 dyoung Exp $
# $NetBSD: Makefile.disklabel,v 1.2 2005/06/22 21:35:28 he Exp $
_ARCHDIR= ${.CURDIR}/../../sys/arch
_INCDIR= ${.CURDIR}/../../include
_SYSDIR= ${.CURDIR}/../../sys/sys
_SUBDIR!= cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
_ARCH_INCS!= cd ${_ARCHDIR} && find . -name disklabel.h
_INCS= bootblock.h \
_INCS= disktab.h
_SYSINCS= bootblock.h \
disklabel.h disklabel_acorn.h disklabel_gpt.h dkbad.h
HOST_CPPFLAGS+= -I${TOOLDIR}/include
@ -17,7 +19,9 @@ beforedepend:
cd ${_ARCHDIR} && \
${TOOL_PAX} -s /include\\/// -rw ${_ARCH_INCS} \
${TOOLDIR}/include/nbinclude
cd ${_INCDIR} && \
${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude
cd ${_SYSDIR} && \
${TOOL_PAX} -rw ${_INCS} ${TOOLDIR}/include/nbinclude/sys
${TOOL_PAX} -rw ${_SYSINCS} ${TOOLDIR}/include/nbinclude/sys
cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
${HOST_INSTALL_SYMLINK} ${MACHINE} machine