diff options
-rw-r--r-- | usr.bin/size/Makefile | 19 | ||||
-rw-r--r-- | usr.bin/size/size.c | 9 | ||||
-rw-r--r-- | usr.bin/strip/Makefile | 22 | ||||
-rw-r--r-- | usr.bin/strip/strip.c | 9 |
4 files changed, 52 insertions, 7 deletions
diff --git a/usr.bin/size/Makefile b/usr.bin/size/Makefile index 9cc055035b4..20467f578d7 100644 --- a/usr.bin/size/Makefile +++ b/usr.bin/size/Makefile @@ -1,4 +1,21 @@ -# $OpenBSD: Makefile,v 1.3 1997/09/21 11:50:47 deraadt Exp $ +# $OpenBSD: Makefile,v 1.4 1998/05/11 07:40:30 niklas Exp $ + +TARGET_MACHINE_ARCH?= ${MACHINE_ARCH} + +.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 +.endif PROG= size diff --git a/usr.bin/size/size.c b/usr.bin/size/size.c index ea6a7b17040..ed420059eb4 100644 --- a/usr.bin/size/size.c +++ b/usr.bin/size/size.c @@ -1,4 +1,4 @@ -/* $OpenBSD: size.c,v 1.8 1997/09/11 11:21:52 deraadt Exp $ */ +/* $OpenBSD: size.c,v 1.9 1998/05/11 07:40:31 niklas Exp $ */ /* $NetBSD: size.c,v 1.7 1996/01/14 23:07:12 pk Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)size.c 8.2 (Berkeley) 12/9/93"; #endif -static char rcsid[] = "$OpenBSD: size.c,v 1.8 1997/09/11 11:21:52 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: size.c,v 1.9 1998/05/11 07:40:31 niklas Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -59,6 +59,11 @@ static char rcsid[] = "$OpenBSD: size.c,v 1.8 1997/09/11 11:21:52 deraadt Exp $" #include <ctype.h> #include <err.h> +#ifdef MID_MACHINE_OVERRIDE +#undef MID_MACHINE +#define MID_MACHINE MID_MACHINE_OVERRIDE +#endif + unsigned long total_text, total_data, total_bss, total_total; int ignore_bad_archive_entries = 1; int print_totals = 0; 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; |