Subject: proposed change to m68k-gcc CPP_SPEC / CPP_PREDEFINES
To: None <tech-userlevel@NetBSD.ORG, port-m68k@NetBSD.ORG>
From: J.T. Conklin <jtc@cygnus.com>
List: tech-userlevel
Date: 05/07/1996 15:01:45
The enclosed patchq removes mc68000 and mc68020 from our gcc's
CPP_PREDEFINES, and defines __mc680X0__ as appropriate for
whatever -m680X0 flag is specified on the command line.
This change is consistant with the goal of having only __NetBSD__ and
__${MACHINE_ARCH}__ be predefined CPP macros, yet it allows users to
have conditional code based on the target cpu.
Before I submit this change to the FSF, I'd appreciate any comments.
--jtc
Index: netbsd.h
===================================================================
RCS file: /a/cvsroot/src/gnu/usr.bin/gcc/arch/m68k/netbsd.h,v
retrieving revision 1.4
diff -c -r1.4 netbsd.h
*** netbsd.h 1996/04/04 20:17:22 1.4
--- netbsd.h 1996/05/07 21:44:55
***************
*** 13,26 ****
This will control the use of inline 68881 insns in certain macros. */
#undef CPP_SPEC
! #define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__} %{posix:-D_POSIX_SOURCE}"
#undef ASM_SPEC
! #define ASM_SPEC " %| %{m68030} %{m68040} %{fpic:-k} %{fPIC:-k -K}"
/* Names to predefine in the preprocessor for this target machine. */
! #define CPP_PREDEFINES "-Dunix -Dm68k -Dmc68000 -Dmc68020 -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__ -Asystem(unix) -Asystem(NetBSD) -Acpu(m68k) -Amachine(m68k)"
/* Make gcc agree with <machine/ansi.h> */
--- 13,33 ----
This will control the use of inline 68881 insns in certain macros. */
#undef CPP_SPEC
! #define CPP_SPEC "%{!msoft-float:-D__HAVE_68881__ -D__HAVE_FPU__} %{posix:-D_POSIX_SOURCE }\
! %{m68000:-D__mc68000__ }\
! %{m68020:-D__mc68020__ }\
! %{m68030:-D__mc68030__ }\
! %{m68040:-D__mc68040__ }\
! %{m68060:-D__mc68060__ }\
! %{!m68000:%{!m68020:%{!m68030:%{!m68040:%{!m68060:-D__mc68020__ }}}}}\
! "
#undef ASM_SPEC
! #define ASM_SPEC " %| %{m68030} %{m68040} %{m68060} %{fpic:-k} %{fPIC:-k -K}"
/* Names to predefine in the preprocessor for this target machine. */
! #define CPP_PREDEFINES "-Dunix -Dm68k -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__ -Asystem(unix) -Asystem(NetBSD) -Acpu(m68k) -Amachine(m68k)"
/* Make gcc agree with <machine/ansi.h> */