Make sys/exec_elf.h and machine/elf_machdep.h available to host

tools, and allow paxctl to use them when compiled as a host
tool.  This fixes the build on MacOS X (and perhaps other platforms)
This commit is contained in:
riz 2006-11-22 15:08:47 +00:00
parent 90ee4817fb
commit 2f0a27492f
5 changed files with 19 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec_elf.h,v 1.88 2006/11/22 12:00:14 elad Exp $ */
/* $NetBSD: exec_elf.h,v 1.89 2006/11/22 15:08:47 riz Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -61,7 +61,11 @@
#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
#endif
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/machine/elf_machdep.h>
#else
#include <machine/elf_machdep.h>
#endif
typedef uint8_t Elf_Byte;

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.109 2006/11/17 21:54:55 dsl Exp $
# $NetBSD: Makefile,v 1.110 2006/11/22 15:08:47 riz Exp $
.include <bsd.own.mk>
@ -25,7 +25,7 @@ LINT_BITS= lint lint2
.if !defined(NOSUBDIR) # {
SUBDIR= host-mkdep .WAIT compat .WAIT \
binstall .WAIT paxctl .WAIT mktemp .WAIT \
binstall .WAIT mktemp .WAIT \
cap_mkdb crunchgen ctags genassym gencat hexdump \
${LINT_BITS} \
lorder m4 makewhatis mkdep mtree rpcgen sed tsort uudecode \
@ -38,6 +38,7 @@ SUBDIR= host-mkdep .WAIT compat .WAIT \
makefs menuc mkcsmapper mkesdb mklocale mknod msgc \
pax .WAIT \
disklabel .WAIT \
paxctl .WAIT \
fdisk .WAIT \
installboot .WAIT \
pwd_mkdb stat sunlabel zic

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.disklabel,v 1.6 2006/02/14 04:59:33 dyoung Exp $
# $NetBSD: Makefile.disklabel,v 1.7 2006/11/22 15:08:47 riz Exp $
_ARCHDIR= ${.CURDIR}/../../sys/arch
_INCDIR= ${.CURDIR}/../../include
@ -7,7 +7,8 @@ _UFSDIR= ${.CURDIR}/../../sys/ufs
_SUBDIR!= cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
_UFS_INCS!= cd ${_UFSDIR} && find ffs ufs -name '*.h'
_ARCH_INCS!= cd ${_ARCHDIR} && find . -name disklabel.h
_ARCH_INCS!= cd ${_ARCHDIR} && find . -name disklabel.h -or \
-name elf_machdep.h
_ARCH_INCS+= ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.1 2006/11/10 16:50:10 christos Exp $
# $NetBSD: Makefile,v 1.2 2006/11/22 15:08:47 riz Exp $
HOSTPROGNAME= ${_TOOL_PREFIX}paxctl
HOST_SRCDIR= usr.bin/paxctl
.include "${.CURDIR}/../Makefile.disklabel"
.include "${.CURDIR}/../Makefile.host"

View File

@ -1,4 +1,4 @@
/* $NetBSD: paxctl.c,v 1.9 2006/11/22 02:02:52 elad Exp $ */
/* $NetBSD: paxctl.c,v 1.10 2006/11/22 15:08:47 riz Exp $ */
/*-
* Copyright (c) 2006 Elad Efrat <elad@NetBSD.org>
@ -36,12 +36,16 @@
#include <sys/cdefs.h>
#ifndef lint
#ifdef __RCSID
__RCSID("$NetBSD: paxctl.c,v 1.9 2006/11/22 02:02:52 elad Exp $");
__RCSID("$NetBSD: paxctl.c,v 1.10 2006/11/22 15:08:47 riz Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#ifdef HAVE_NBTOOL_CONFIG_H
#include "../../sys/sys/exec_elf.h"
#else
#include <elf.h>
#endif
#include <stdio.h>
#include <err.h>
#include <fcntl.h>