From f3121769a77572821c28afa298026582d8fc4ae4 Mon Sep 17 00:00:00 2001 From: thorpej Date: Mon, 28 Jan 2002 21:10:51 +0000 Subject: [PATCH] Add support for m68010-*-netbsdelf* using the existing m68k/netbsd-elf configuration. --- .../toolchain/gcc/config/m68k/netbsd-elf.h | 50 +++++++++++++++++-- gnu/dist/toolchain/gcc/configure | 10 +++- gnu/dist/toolchain/gcc/configure.in | 12 ++++- 3 files changed, 66 insertions(+), 6 deletions(-) diff --git a/gnu/dist/toolchain/gcc/config/m68k/netbsd-elf.h b/gnu/dist/toolchain/gcc/config/m68k/netbsd-elf.h index 3e3634a4d234..3ed480d62779 100644 --- a/gnu/dist/toolchain/gcc/config/m68k/netbsd-elf.h +++ b/gnu/dist/toolchain/gcc/config/m68k/netbsd-elf.h @@ -32,17 +32,59 @@ Boston, MA 02111-1307, USA. */ #define NETBSD_ELF #include -/* 68020 with 68881 */ -#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) +/* Default target comes from config.gcc */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT TARGET_CPU_DEFAULT #define bsd4_4 #undef HAS_INIT_SECTION + +#define EXTRA_SPECS \ + { "cpp_cpu_default_spec", CPP_CPU_DEFAULT_SPEC }, \ + { "cpp_cpu_spec", CPP_CPU_SPEC }, \ + { "cpp_fpu_spec", CPP_FPU_SPEC }, \ + { "asm_default_spec", ASM_DEFAULT_SPEC }, + + +#define CPP_CPU_SPEC \ + "%{m68010:-D__mc68010__} \ + %{m68020:-D__mc68020__} \ + %{m68030:-D__mc68030__} \ + %{m68040:-D__mc68040__} \ + %(cpp_cpu_default_spec)" + + +#undef TARGET_VERSION +#if TARGET_DEFAULT & MASK_68020 +#define TARGET_VERSION fprintf (stderr, " (NetBSD/m68k ELF)"); +#define CPP_CPU_DEFAULT_SPEC "%{!m680*:-D__mc68020__}" +#define ASM_DEFAULT_SPEC "%{!m680*:-m68020}" +#else +#define TARGET_VERSION fprintf (stderr, " (NetBSD/68010 ELF)"); +#define CPP_CPU_DEFAULT_SPEC "%{!m680*:-D__mc68010__}" +#define ASM_DEFAULT_SPEC "%{!m680*:-m68010}" +#endif + + +#if TARGET_DEFAULT & MASK_68881 +#define CPP_FPU_SPEC "%{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__}" +#else +#define CPP_FPU_SPEC "%{m68881:-D__HAVE_68881__ -D__HAVE_FPU__}" +#endif + + #undef CPP_SPEC -#define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__} %{posix:-D_POSIX_SOURCE}" +#define CPP_SPEC \ + "%{posix:-D_POSIX_SOURCE} %(cpp_cpu_spec) %(cpp_fpu_spec)" + #undef ASM_SPEC -#define ASM_SPEC " %| %{m68030} %{m68040} %{m68060} %{fpic:-k} %{fPIC:-k -K}" +#define ASM_SPEC \ + " %| %(asm_default_spec) \ + %{m68010} %{m68020} %{m68030} %{m68040} %{m68060} \ + %{fpic:-k} %{fPIC:-k -K}" + /* Provide a set of pre-definitions and pre-assertions appropriate for the m68k running svr4. */ diff --git a/gnu/dist/toolchain/gcc/configure b/gnu/dist/toolchain/gcc/configure index 7e440dac9514..9ff741c23f15 100755 --- a/gnu/dist/toolchain/gcc/configure +++ b/gnu/dist/toolchain/gcc/configure @@ -2932,7 +2932,7 @@ for machine in $build $host $target; do hppa*-*-*) cpu_type=pa ;; - m68000-*-*) + m680[01]0-*-*) cpu_type=m68k ;; mips*-*-*) @@ -4380,6 +4380,14 @@ for machine in $build $host $target; do float_format=m68k ;; m68*-*-netbsdelf*) + case $machine in + m68010-*) + target_cpu_default="0" + ;; + *) + target_cpu_default="MASK_68020|MASK_68881|MASK_BITFIELD" + ;; + esac float_format=m68k gas=yes gnu_ld=yes ;; diff --git a/gnu/dist/toolchain/gcc/configure.in b/gnu/dist/toolchain/gcc/configure.in index 740686fc65b1..49c8fdb41158 100644 --- a/gnu/dist/toolchain/gcc/configure.in +++ b/gnu/dist/toolchain/gcc/configure.in @@ -498,7 +498,9 @@ changequote([,])dnl hppa*-*-*) cpu_type=pa ;; - m68000-*-*) +changequote(,)dnl + m680[01]0-*-*) +changequote([,])dnl cpu_type=m68k ;; mips*-*-*) @@ -2054,6 +2056,14 @@ changequote([,])dnl float_format=m68k ;; m68*-*-netbsdelf*) + case $machine in + m68010-*) + target_cpu_default="0" + ;; + *) + target_cpu_default="MASK_68020|MASK_68881|MASK_BITFIELD" + ;; + esac float_format=m68k gas=yes gnu_ld=yes ;;