From: Matt Kraai Date: Wed, 10 Jul 2002 00:33:52 +0000 (+0000) Subject: aix.h: Convert CPP_PREDEFINES to TARGET_OS_CPP_BUILTINS. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7990b46f6c184388750f820b8ad2ba7936c899d1;p=platform%2Fupstream%2Fgcc.git aix.h: Convert CPP_PREDEFINES to TARGET_OS_CPP_BUILTINS. * config/rs6000/aix.h: Convert CPP_PREDEFINES to TARGET_OS_CPP_BUILTINS. * config/rs6000/aix31.h: Likewise. * config/rs6000/aix41.h: Likewise. * config/rs6000/aix43.h: Likewise. * config/rs6000/aix51.h: Likewise. * config/rs6000/beos.h: Likewise. * config/rs6000/darwin.h: Likewise. * config/rs6000/eabi.h: Likewise. * config/rs6000/eabisim.h: Likewise. * config/rs6000/linux.h: Likewise. * config/rs6000/linux64.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/rs6000/mach.h: Likewise. * config/rs6000/rtems.h: Likewise. * config/rs6000/sysv4.h: Likewise. * config/rs6000/vxppc.h: Likewise. From-SVN: r55356 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 19f2df7..47805c9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2002-07-09 Matt Kraai + + * config/rs6000/aix.h: Convert CPP_PREDEFINES to + TARGET_OS_CPP_BUILTINS. + * config/rs6000/aix31.h: Likewise. + * config/rs6000/aix41.h: Likewise. + * config/rs6000/aix43.h: Likewise. + * config/rs6000/aix51.h: Likewise. + * config/rs6000/beos.h: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/eabi.h: Likewise. + * config/rs6000/eabisim.h: Likewise. + * config/rs6000/linux.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/lynx.h: Likewise. + * config/rs6000/mach.h: Likewise. + * config/rs6000/rtems.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * config/rs6000/vxppc.h: Likewise. 2002-07-09 Devang Patel * objc/objc-act.c (adjust_type_for_id_default): Fix my previous patch. diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 7c0a4cf..5e619e6 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -41,8 +41,20 @@ Boston, MA 02111-1307, USA. */ #define LINK_LIBGCC_SPECIAL_1 /* Names to predefine in the preprocessor for this target machine. */ -#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_LONG_LONG \ --Asystem=unix -Asystem=aix -Acpu=rs6000 -Amachine=rs6000" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_IBMR2"); \ + builtin_define ("_POWER"); \ + builtin_define ("_AIX"); \ + builtin_define ("_AIX32"); \ + builtin_define ("_LONG_LONG"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=aix"); \ + builtin_assert ("cpu=rs6000"); \ + builtin_assert ("machine=rs6000"); \ + } \ + while (0) /* Define appropriate architecture macros for preprocessor depending on target switches. */ diff --git a/gcc/config/rs6000/aix31.h b/gcc/config/rs6000/aix31.h index 688e588..f390add 100644 --- a/gcc/config/rs6000/aix31.h +++ b/gcc/config/rs6000/aix31.h @@ -60,8 +60,18 @@ Boston, MA 02111-1307, USA. */ } /* AIX 3.2 defined _AIX32, but older versions do not. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D_IBMR2 -D_AIX -Asystem=unix -Asystem=aix -Acpu=rs6000 -Amachine=rs6000" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_IBMR2"); \ + builtin_define ("_AIX"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=aix"); \ + builtin_assert ("cpu=rs6000"); \ + builtin_assert ("machine=rs6000"); \ + } \ + while (0) /* AIX 3.1 uses bit 15 in CROR as the magic nop. */ #undef RS6000_CALL_GLUE diff --git a/gcc/config/rs6000/aix41.h b/gcc/config/rs6000/aix41.h index cc839b2..7f23a48 100644 --- a/gcc/config/rs6000/aix41.h +++ b/gcc/config/rs6000/aix41.h @@ -33,9 +33,20 @@ Boston, MA 02111-1307, USA. */ #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mcom" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 \ --D_LONG_LONG -Asystem=unix -Asystem=aix" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_IBMR2"); \ + builtin_define ("_POWER"); \ + builtin_define ("_AIX"); \ + builtin_define ("_AIX32"); \ + builtin_define ("_AIX41"); \ + builtin_define ("_LONG_LONG"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=aix"); \ + } \ + while (0) #undef CPP_SPEC #define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\ diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h index ddf9857..bcbfcf2 100644 --- a/gcc/config/rs6000/aix43.h +++ b/gcc/config/rs6000/aix43.h @@ -96,9 +96,21 @@ do { \ #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mcom" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 \ --D_LONG_LONG -Asystem=unix -Asystem=aix" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_IBMR2"); \ + builtin_define ("_POWER"); \ + builtin_define ("_AIX"); \ + builtin_define ("_AIX32"); \ + builtin_define ("_AIX41"); \ + builtin_define ("_AIX43"); \ + builtin_define ("_LONG_LONG"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=aix"); \ + } \ + while (0) #undef CPP_SPEC #define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\ diff --git a/gcc/config/rs6000/aix51.h b/gcc/config/rs6000/aix51.h index 2f0d682..552394e 100644 --- a/gcc/config/rs6000/aix51.h +++ b/gcc/config/rs6000/aix51.h @@ -96,9 +96,22 @@ do { \ #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mcom" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_LONG_LONG \ --D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -Asystem=unix -Asystem=aix" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_IBMR2"); \ + builtin_define ("_POWER"); \ + builtin_define ("_LONG_LONG"); \ + builtin_define ("_AIX"); \ + builtin_define ("_AIX32"); \ + builtin_define ("_AIX41"); \ + builtin_define ("_AIX43"); \ + builtin_define ("_AIX51"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=aix"); \ + } \ + while (0) #undef CPP_SPEC #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \ diff --git a/gcc/config/rs6000/beos.h b/gcc/config/rs6000/beos.h index 4d2952a..1f788c3 100644 --- a/gcc/config/rs6000/beos.h +++ b/gcc/config/rs6000/beos.h @@ -38,9 +38,18 @@ Boston, MA 02111-1307, USA. */ #undef ASM_SPEC #define ASM_SPEC "-u %(asm_cpu)" -#undef CPP_PREDEFINES +#undef TARGET_OS_CPP_BUILTINS /* __POWERPC__ must be defined for some header files */ -#define CPP_PREDEFINES "-D__BEOS__ -D__POWERPC__ -Asystem=beos -Acpu=powerpc -Amachine=powerpc" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__BEOS__"); \ + builtin_define ("__POWERPC__"); \ + builtin_assert ("system=beos"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + while (0) #undef CPP_SPEC #define CPP_SPEC "%{posix: -D_POSIX_SOURCE}" diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index a472334..f874354 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -44,7 +44,16 @@ Boston, MA 02111-1307, USA. */ #define SUBTARGET_OVERRIDE_OPTIONS \ rs6000_altivec_abi = 1; -#define CPP_PREDEFINES "-D__ppc__ -D__POWERPC__ -D__NATURAL_ALIGNMENT__ -D__MACH__ -D__APPLE__" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__ppc__"); \ + builtin_define ("__POWERPC__"); \ + builtin_define ("__NATURAL_ALIGNMENT__"); \ + builtin_define ("__MACH__"); \ + builtin_define ("__APPLE__"); \ + } \ + while (0) /* We want -fPIC by default, unless we're using -static to compile for the kernel or some such. */ diff --git a/gcc/config/rs6000/eabi.h b/gcc/config/rs6000/eabi.h index 88fb6f8..fd41177 100644 --- a/gcc/config/rs6000/eabi.h +++ b/gcc/config/rs6000/eabi.h @@ -31,6 +31,14 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC Embedded)"); -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-DPPC -D__embedded__ -Asystem=embedded -Acpu=powerpc -Amachine=powerpc" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("PPC"); \ + builtin_define ("__embedded__"); \ + builtin_assert ("system=embedded"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + while (0) diff --git a/gcc/config/rs6000/eabisim.h b/gcc/config/rs6000/eabisim.h index 92e0957..00f710e 100644 --- a/gcc/config/rs6000/eabisim.h +++ b/gcc/config/rs6000/eabisim.h @@ -23,9 +23,19 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC Simulated)"); -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-DPPC -D__embedded__ -D__simulator__ -Asystem=embedded -Asystem=simulator -Acpu=powerpc -Amachine=powerpc" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("PPC"); \ + builtin_define ("__embedded__"); \ + builtin_define ("__simulator__"); \ + builtin_assert ("system=embedded"); \ + builtin_assert ("system=simulator"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + while (0) /* Make the simulator the default */ #undef LIB_DEFAULT_SPEC diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h index 99c0453..0beaa61 100644 --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -27,9 +27,17 @@ Boston, MA 02111-1307, USA. */ #undef MD_EXEC_PREFIX #undef MD_STARTFILE_PREFIX -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-DPPC -D__ELF__ -Dpowerpc -Acpu=powerpc -Amachine=powerpc" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("PPC"); \ + builtin_define ("__ELF__"); \ + builtin_define_std ("powerpc"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + while (0) #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index eaa962d..192e6cc 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -106,11 +106,20 @@ Boston, MA 02111-1307, USA. */ #undef MD_EXEC_PREFIX #undef MD_STARTFILE_PREFIX -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-D_PPC_ -D__PPC__ -D_PPC64_ -D__PPC64__ -D__powerpc__ -D__powerpc64__ \ - -D_PIC_ -D__PIC__ -D__ELF__ \ - -Acpu=powerpc64 -Amachine=powerpc64" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__PPC__"); \ + builtin_define ("__PPC64__"); \ + builtin_define ("__powerpc__"); \ + builtin_define ("__powerpc64__"); \ + builtin_define ("__PIC__"); \ + builtin_define ("__ELF__"); \ + builtin_assert ("cpu=powerpc64"); \ + builtin_assert ("machine=powerpc64"); \ + } \ + while (0) #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" diff --git a/gcc/config/rs6000/lynx.h b/gcc/config/rs6000/lynx.h index fb45997..7878ef9 100644 --- a/gcc/config/rs6000/lynx.h +++ b/gcc/config/rs6000/lynx.h @@ -53,8 +53,22 @@ Boston, MA 02111-1307, USA. */ #undef DEFAULT_SIGNED_CHAR #define DEFAULT_SIGNED_CHAR 1 -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Acpu=rs6000 -Amachine=rs6000 -Asystem=lynx -Asystem=unix -DLynx -D_IBMR2 -Dunix -Drs6000 -Dlynx -DLYNX" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("cpu=rs6000"); \ + builtin_assert ("machine=rs6000"); \ + builtin_assert ("system=lynx"); \ + builtin_assert ("system=unix"); \ + builtin_define_std ("Lynx"); \ + builtin_define ("_IBMR2"); \ + builtin_define_std ("unix"); \ + builtin_define_std ("rs6000"); \ + builtin_define_std ("lynx"); \ + builtin_define_std ("LYNX"); \ + } \ + while (0) #undef LINK_SPEC #define LINK_SPEC "-T0x10001000 -H0x1000 -D0x20000000 -btextro -bhalt:4 -bnodelcsect -bnso -bro -bnoglink %{v} %{b*}" diff --git a/gcc/config/rs6000/mach.h b/gcc/config/rs6000/mach.h index d4395d5..a246f91 100644 --- a/gcc/config/rs6000/mach.h +++ b/gcc/config/rs6000/mach.h @@ -26,8 +26,19 @@ Boston, MA 02111-1307, USA. */ #define TARGET_VERSION fprintf (stderr, " (Mach-RS/6000)"); /* We don't define AIX under MACH; instead we define `unix'. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Drios -D_IBMR2 -Dunix -Asystem=unix -Asystem=mach -Acpu=rs6000 -Amachine=rs6000" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("rios"); \ + builtin_define ("_IBMR2"); \ + builtin_define_std ("unix"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=mach"); \ + builtin_assert ("cpu=rs6000"); \ + builtin_assert ("machine=rs6000"); \ + } \ + while (0) /* Define different binder options for MACH. */ #undef LINK_SPEC diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h index aa68130..072d86c 100644 --- a/gcc/config/rs6000/rtems.h +++ b/gcc/config/rs6000/rtems.h @@ -21,6 +21,14 @@ Boston, MA 02111-1307, USA. */ /* Specify predefined symbols in preprocessor. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-DPPC -D__rtems__ \ - -Asystem=rtems -Acpu=powerpc -Amachine=powerpc" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("PPC"); \ + builtin_define ("__rtems__"); \ + builtin_assert ("system=rtems"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + while (0) diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index bb85385..4433936 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -808,9 +808,19 @@ do { \ #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)"); #endif -#ifndef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc" +#ifndef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("PPC"); \ + builtin_define_std ("unix"); \ + builtin_define ("__svr4__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=svr4"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + while (0) #endif /* Pass various options to the assembler. */ diff --git a/gcc/config/rs6000/vxppc.h b/gcc/config/rs6000/vxppc.h index 79c63ea..91250a6 100644 --- a/gcc/config/rs6000/vxppc.h +++ b/gcc/config/rs6000/vxppc.h @@ -39,10 +39,18 @@ Boston, MA 02111-1307, USA. */ #undef LINK_OS_DEFAULT_SPEC #define LINK_OS_DEFAULT_SPEC "%(link_os_vxworks)" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "\ --D__vxworks -D__vxworks__ -Asystem=vxworks -Asystem=embedded \ --Acpu=powerpc -Amachine=powerpc" +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__vxworks"); \ + builtin_define ("__vxworks__"); \ + builtin_assert ("system=vxworks"); \ + builtin_assert ("system=embedded"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + while (0) /* We use stabs-in-elf for debugging */ #undef PREFERRED_DEBUGGING_TYPE