From: ljrittle Date: Wed, 12 Mar 2003 02:29:08 +0000 (+0000) Subject: * config/freebsd-spec.h (FBSD_CPP_PREDEFINES): Remove. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=78fb562b5130e000bd196cdca12ddfc65165a68c * config/freebsd-spec.h (FBSD_CPP_PREDEFINES): Remove. (FBSD_TARGET_OS_CPP_BUILTINS): New port-specific macro. (FBSD_TARGET_CPU_CPP_BUILTINS): New port-specific macro. * config/freebsd.h (CPP_PREDEFINES): Remove. (TARGET_OS_CPP_BUILTINS): New. * config/alpha/freebsd.h: Use overridden FBSD_TARGET_CPU_CPP_BUILTINS instead of TARGET_OS_CPP_BUILTINS. * config/sparc/freebsd.h (CPP_PREDEFINES): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64212 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 486378e45d3..c9300d04a9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2003-03-11 Loren James Rittle + + * config/freebsd-spec.h (FBSD_CPP_PREDEFINES): Remove. + (FBSD_TARGET_OS_CPP_BUILTINS): New port-specific macro. + (FBSD_TARGET_CPU_CPP_BUILTINS): New port-specific macro. + * config/freebsd.h (CPP_PREDEFINES): Remove. + (TARGET_OS_CPP_BUILTINS): New. + * config/alpha/freebsd.h: Use overridden FBSD_TARGET_CPU_CPP_BUILTINS + instead of TARGET_OS_CPP_BUILTINS. + * config/sparc/freebsd.h (CPP_PREDEFINES): Remove. + 2003-03-11 Geoffrey Keating * c-cppbuiltin.c (builtin_define_std): Add ATTRIBUTE_UNUSED. diff --git a/gcc/config/alpha/freebsd.h b/gcc/config/alpha/freebsd.h index c77d85640f6..7b3f5c4af69 100644 --- a/gcc/config/alpha/freebsd.h +++ b/gcc/config/alpha/freebsd.h @@ -20,11 +20,13 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Provide a CPP_SPEC appropriate for FreeBSD/alpha. Besides the dealing with +/* Provide a FBSD_TARGET_CPU_CPP_BUILTINS and CPP_SPEC appropriate for + FreeBSD/alpha. Besides the dealing with the GCC option `-posix', and PIC issues as on all FreeBSD platforms, we must deal with the Alpha's FP issues. */ -#define TARGET_OS_CPP_BUILTINS() \ +#undef FBSD_TARGET_CPU_CPP_BUILTINS +#define FBSD_TARGET_CPU_CPP_BUILTINS() \ do \ { \ if (flag_pic) \ diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h index 3fc4dcc7a41..4d81d80c443 100644 --- a/gcc/config/freebsd-spec.h +++ b/gcc/config/freebsd-spec.h @@ -48,30 +48,31 @@ Boston, MA 02111-1307, USA. */ || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) -#if FBSD_MAJOR == 6 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=6 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#if FBSD_MAJOR == 5 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=5 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#if FBSD_MAJOR == 4 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=4 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#if FBSD_MAJOR == 3 -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=3 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif - -#ifndef FBSD_CPP_PREDEFINES -#define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__ -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" -#endif +#define FBSD_TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + if (FBSD_MAJOR == 6) \ + builtin_define ("__FreeBSD__=6"); \ + else if (FBSD_MAJOR == 5) \ + builtin_define ("__FreeBSD__=5"); \ + else if (FBSD_MAJOR == 4) \ + builtin_define ("__FreeBSD__=4"); \ + else if (FBSD_MAJOR == 3) \ + builtin_define ("__FreeBSD__=3"); \ + else \ + builtin_define ("__FreeBSD__"); \ + builtin_define_std ("unix"); \ + builtin_define ("__ELF__"); \ + builtin_define ("__KPRINTF_ATTRIBUTE__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=bsd"); \ + builtin_assert ("system=FreeBSD"); \ + FBSD_TARGET_CPU_CPP_BUILTINS(); \ + } \ + while (0) + +/* Define the default FreeBSD-specific per-CPU hook code. */ +#define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0) /* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC option `-posix', and PIC issues. */ diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h index 285f5bf85f9..f71bd8b42d5 100644 --- a/gcc/config/freebsd.h +++ b/gcc/config/freebsd.h @@ -42,7 +42,10 @@ Boston, MA 02111-1307, USA. */ #define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR)) #undef CPP_PREDEFINES -#define CPP_PREDEFINES FBSD_CPP_PREDEFINES +/* Obsolete, do not define it. */ + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() FBSD_TARGET_OS_CPP_BUILTINS() #undef CPP_SPEC #define CPP_SPEC FBSD_CPP_SPEC diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h index 3bc6b4f2b7e..bec5a231735 100644 --- a/gcc/config/sparc/freebsd.h +++ b/gcc/config/sparc/freebsd.h @@ -26,7 +26,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Because we include sparc/sysv4.h. */ #undef CPP_PREDEFINES -#define CPP_PREDEFINES FBSD_CPP_PREDEFINES +/* Do not define it here, we now use TARGET_OS_CPP_BUILTINS. */ #define LINK_SPEC "%(link_arch) \ %{!mno-relax:%{!r:-relax}} \