summaryrefslogtreecommitdiff
path: root/usr.bin/strip
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1998-05-11 07:41:26 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1998-05-11 07:41:26 +0000
commita403f719dbf63e2a495bbb84cf5ba0cfbc5551d2 (patch)
tree589f50e13196515d77c4938b0da845f8174ab037 /usr.bin/strip
parent08e4ebbf797bd37f19c30822d3e6c4ebc452a8c1 (diff)
Support building for cross purposes
Diffstat (limited to 'usr.bin/strip')
-rw-r--r--usr.bin/strip/Makefile22
-rw-r--r--usr.bin/strip/strip.c9
2 files changed, 27 insertions, 4 deletions
diff --git a/usr.bin/strip/Makefile b/usr.bin/strip/Makefile
index 3cba7c051c9..6443a4dea34 100644
--- a/usr.bin/strip/Makefile
+++ b/usr.bin/strip/Makefile
@@ -1,7 +1,25 @@
-# $OpenBSD: Makefile,v 1.6 1997/04/27 20:56:54 millert Exp $
+# $OpenBSD: Makefile,v 1.7 1998/05/11 07:41:23 niklas Exp $
+
+TARGET_MACHINE_ARCH?= ${MACHINE_ARCH}
PROG= strip
-.if ${HOSTCC} != ${CC}
+
+.if ${TARGET_MACHINE_ARCH} != ${MACHINE_ARCH}
+# XXX should make this automatic
+.if ${TARGET_MACHINE_ARCH} == "i386"
+CFLAGS+= -DMID_MACHINE_OVERRIDE=MID_I386
+.elif ${TARGET_MACHINE_ARCH} == "m68k"
+CFLAGS+= -DMID_MACHINE_OVERRIDE=MID_M68K
+.elif ${TARGET_MACHINE_ARCH} == "ns32k"
+CFLAGS+= -DMID_MACHINE_OVERRIDE=MID_NS32K
+.elif ${TARGET_MACHINE_ARCH} == "sparc"
+CFLAGS+= -DMID_MACHINE_OVERRIDE=MID_SPARC
+.elif ${TARGET_MACHINE_ARCH} == "vax"
+CFLAGS+= -DMID_MACHINE_OVERRIDE=MID_VAX
+.endif
+STRIP= /usr/bin/strip
+
+.elif ${HOSTCC} != ${CC}
STRIP=./hoststrip
realinstall: hoststrip
diff --git a/usr.bin/strip/strip.c b/usr.bin/strip/strip.c
index 34b8d244002..44aca452a37 100644
--- a/usr.bin/strip/strip.c
+++ b/usr.bin/strip/strip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strip.c,v 1.9 1997/09/11 11:21:54 deraadt Exp $ */
+/* $OpenBSD: strip.c,v 1.10 1998/05/11 07:41:25 niklas Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)strip.c 5.8 (Berkeley) 11/6/91";*/
-static char rcsid[] = "$OpenBSD: strip.c,v 1.9 1997/09/11 11:21:54 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: strip.c,v 1.10 1998/05/11 07:41:25 niklas Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -57,6 +57,11 @@ static char rcsid[] = "$OpenBSD: strip.c,v 1.9 1997/09/11 11:21:54 deraadt Exp $
#include <string.h>
#include <err.h>
+#ifdef MID_MACHINE_OVERRIDE
+#undef MID_MACHINE
+#define MID_MACHINE MID_MACHINE_OVERRIDE
+#endif
+
typedef struct exec EXEC;
typedef struct nlist NLIST;