From 9bb48d10db0a9c8aec2f32c487f7b85fd8690e89 Mon Sep 17 00:00:00 2001 From: scw Date: Mon, 18 Dec 2000 08:51:39 +0000 Subject: [PATCH] Pick the supported object formats in the Makefile instead of extern.h. This gives more control of which platforms support which formats. (Basically because __%{MACHINE}__ is not pre-defined by the compiler) --- usr.bin/crunch/crunchide/Makefile | 20 +++++++++++++++++++- usr.bin/crunch/crunchide/extern.h | 26 +------------------------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/usr.bin/crunch/crunchide/Makefile b/usr.bin/crunch/crunchide/Makefile index d90f4b5d5b07..6b887e8d8736 100644 --- a/usr.bin/crunch/crunchide/Makefile +++ b/usr.bin/crunch/crunchide/Makefile @@ -1,7 +1,25 @@ -# $NetBSD: Makefile,v 1.5 1999/11/26 13:47:52 msaitoh Exp $ +# $NetBSD: Makefile,v 1.6 2000/12/18 08:51:39 scw Exp $ PROG= crunchide SRCS= crunchide.c exec_aout.c exec_coff.c exec_ecoff.c exec_elf32.c \ exec_elf64.c +.if ${MACHINE_ARCH} == "alpha" +CPPFLAGS+=-DNLIST_ELF64 -DNLIST_ECOFF +.elif ${MACHINE_ARCH} == "arm26" || \ + ${MACHINE_ARCH} == "mips" || \ + ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE} == "mvme68k" +CPPFLAGS+=-DNLIST_ELF32 +.elif ${MACHINE_ARCH} == "sh3" +CPPFLAGS+=-DNLIST_ELF32 -DNLIST_COFF +.elif ${MACHINE_ARCH} == "sparc64" +CPPFLAGS+=-DNLIST_AOUT -DNLIST_ELF32 -DNLIST_ELF64 +.elif ${MACHINE_ARCH} == "sparc" || \ + ${MACHINE_ARCH} == "i386" +CPPFLAGS+=-DNLIST_AOUT -DNLIST_ELF32 +.else +CPPFLAGS+=-DNLIST_AOUT +.endif + .include diff --git a/usr.bin/crunch/crunchide/extern.h b/usr.bin/crunch/crunchide/extern.h index 8ed4a425d9b7..7558e77e461d 100644 --- a/usr.bin/crunch/crunchide/extern.h +++ b/usr.bin/crunch/crunchide/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.11 2000/08/09 14:22:15 mrg Exp $ */ +/* $NetBSD: extern.h,v 1.12 2000/12/18 08:51:39 scw Exp $ */ /* * Copyright (c) 1997 Christopher G. Demetriou @@ -34,30 +34,6 @@ * <> */ -#if defined(__alpha__) -# define NLIST_ECOFF -# define NLIST_ELF64 -#elif defined(__arm26__) || defined(__mips__) -# define NLIST_ELF32 -#elif defined(__powerpc__) -# define NLIST_ELF32 -#elif defined(__sh3__) -# define NLIST_COFF -# define NLIST_ELF32 -#elif defined(__sparc64__) -# define NLIST_AOUT -# define NLIST_ELF32 -# define NLIST_ELF64 -#elif defined(__sparc__) || defined(__i386__) -# define NLIST_AOUT -# define NLIST_ELF32 -#else -# define NLIST_AOUT -/* #define NLIST_ECOFF */ -/* #define NLIST_ELF32 */ -/* #define NLIST_ELF64 */ -#endif - #ifdef NLIST_AOUT int check_aout(int, const char *); int hide_aout(int, const char *);