EXTRA_SPECS addition
authorMichael Meissner <meissner@gcc.gnu.org>
Thu, 18 Jan 1996 15:19:51 +0000 (15:19 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 18 Jan 1996 15:19:51 +0000 (15:19 +0000)
From-SVN: r11063

gcc/config/rs6000/aix3newas.h
gcc/config/rs6000/aix41.h
gcc/config/rs6000/eabiaix.h
gcc/config/rs6000/eabile.h
gcc/config/rs6000/lynx.h
gcc/config/rs6000/netware.h
gcc/config/rs6000/powerpc.h
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/sysv4.h
gcc/config/rs6000/sysv4le.h
gcc/gcc.c

index 1758e49eb28ce42440fa18f977ca07c6c007cb98..6ae4a6436fb36be4a665f44fbe94372bc74c11f8 100644 (file)
@@ -26,33 +26,10 @@ Boston, MA 02111-1307, USA.  */
 /* Tell the assembler to assume that all undefined names are external.  */
 
 #undef ASM_SPEC
-#define ASM_SPEC "-u \
-%{!mcpu*: \
-  %{mpower: %{!mpowerpc*: %{!mpower2: -mpwr}}} \
-  %{mpower2: -mpwrx} \
-  %{mno-power: %{mpowerpc*: -mppc}} \
-  %{mno-power: %{!mpowerpc*: -mcom}} \
-  %{!mno-power: %{mpowerpc*: -m601}} \
-  %{!mno-power: %{!mpowerpc*: %{!mpower2: -mpwr}}}} \
-%{mcpu=common: -mcom} \
-%{mcpu=power: -mpwr} \
-%{mcpu=power2: -mpwrx} \
-%{mcpu=powerpc: -mppc} \
-%{mcpu=rios: -mpwr} \
-%{mcpu=rios1: -mpwr} \
-%{mcpu=rios2: -mpwrx} \
-%{mcpu=rsc: -mpwr} \
-%{mcpu=rsc1: -mpwr} \
-%{mcpu=403: -mppc} \
-%{mcpu=505: -mppc} \
-%{mcpu=601: -m601} \
-%{mcpu=602: -mppc} \
-%{mcpu=603: -mppc} \
-%{mcpu=603e: -mppc} \
-%{mcpu=604: -mppc} \
-%{mcpu=620: -mppc} \
-%{mcpu=821: -mppc} \
-%{mcpu=860: -mppc}"
+#define ASM_SPEC "-u %(asm_cpu)"
+
+#undef ASM_DEFAULT_SPEC
+#define ASM_DEFAULT_SPEC "-mpwr"
 
 /* Define the options for the binder: Start text at 512, align all segments
    to 512 bytes, and warn if there is text relocation.
index a0de198c9087853194935aaa2c9194ba3cf22c20..3807d0b29cd3507628dc8525bc07a15dc193cabb 100644 (file)
@@ -24,64 +24,20 @@ Boston, MA 02111-1307, USA.  */
 #include "rs6000/rs6000.h"
 
 #undef ASM_SPEC
-#define ASM_SPEC "-u \
-%{!mcpu*: \
-  %{mpower2: -mpwrx} \
-  %{mpowerpc*: %{!mpower: -mppc}} \
-  %{mpower: %{!mpower2: -mpwr}} \
-  %{mpowerpc*: %{mpower: -m601}} \
-  %{!mpowerpc*: %{!mpower*: -mcom}}} \
-%{mcpu=common: -mcom} \
-%{mcpu=power: -mpwr} \
-%{mcpu=power2: -mpwrx} \
-%{mcpu=powerpc: -mppc} \
-%{mcpu=rios: -mpwr} \
-%{mcpu=rios1: -mpwr} \
-%{mcpu=rios2: -mpwrx} \
-%{mcpu=rsc: -mpwr} \
-%{mcpu=rsc1: -mpwr} \
-%{mcpu=403: -mppc} \
-%{mcpu=505: -mppc} \
-%{mcpu=601: -m601} \
-%{mcpu=602: -mppc} \
-%{mcpu=603: -mppc} \
-%{mcpu=603e: -mppc} \
-%{mcpu=604: -mppc} \
-%{mcpu=620: -mppc} \
-%{mcpu=821: -mppc} \
-%{mcpu=860: -mppc}"
+#define ASM_SPEC "-u %(asm_cpu)"
 
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 \
 -Asystem(unix) -Asystem(aix)"
 
 #undef CPP_SPEC
-#define CPP_SPEC "\
-%{posix: -D_POSIX_SOURCE} \
-%{!mcpu*: \
-  %{mpower: %{!mpower2: -D_ARCH_PWR}} \
-  %{mpower2: -D_ARCH_PWR2} \
-  %{mpowerpc*: -D_ARCH_PPC} \
-  %{!mpower*: -D_ARCH_COM}} \
-%{mcpu=common: -D_ARCH_COM} \
-%{mcpu=power: -D_ARCH_PWR} \
-%{mcpu=power2: -D_ARCH_PWR2} \
-%{mcpu=powerpc: -D_ARCH_PPC} \
-%{mcpu=rios: -D_ARCH_PWR} \
-%{mcpu=rios1: -D_ARCH_PWR} \
-%{mcpu=rios2: -D_ARCH_PWR2} \
-%{mcpu=rsc: -D_ARCH_PWR} \
-%{mcpu=rsc1: -D_ARCH_PWR} \
-%{mcpu=403: -D_ARCH_PPC} \
-%{mcpu=505: -D_ARCH_PPC} \
-%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
-%{mcpu=602: -D_ARCH_PPC} \
-%{mcpu=603: -D_ARCH_PPC} \
-%{mcpu=603e: -D_ARCH_PPC} \
-%{mcpu=604: -D_ARCH_PPC} \
-%{mcpu=620: -D_ARCH_PPC} \
-%{mcpu=821: -D_ARCH_PPC} \
-%{mcpu=860: -D_ARCH_PPC}"
+#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_cpu)"
+
+#undef CPP_DEFAULT_SPEC
+#define CPP_DEFAULT_SPEC "-D_ARCH_COM"
+
+#undef ASM_DEFAULT_SPEC
+#define ASM_DEFAULT_SPEC "-mcom"
 
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT MASK_NEW_MNEMONICS
index 7a70a9c9948549dc14a5197f75b6dab4712af2fe..82b059c942ad84d20e73f3274087a3cd72993a6a 100644 (file)
@@ -24,42 +24,8 @@ Boston, MA 02111-1307, USA.  */
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_AIX_CALLS)
 
-#undef CPP_SPEC
-#define CPP_SPEC "\
-%{posix: -D_POSIX_SOURCE} \
-%{mrelocatable: -D_RELOCATABLE} \
-%{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
-%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
-%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: -D_CALL_AIX}}}} \
-%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \
-%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
-%{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
-%{!mlittle: %{!mlittle-endian: -D_BIG_ENDIAN -Amachine(bigendian)}} \
-%{!mcpu*: \
-  %{mpower: %{!mpower2: -D_ARCH_PWR}} \
-  %{mpower2: -D_ARCH_PWR2} \
-  %{mpowerpc*: -D_ARCH_PPC} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
-  %{!mno-powerpc: -D_ARCH_PPC}} \
-%{mcpu=common: -D_ARCH_COM} \
-%{mcpu=power: -D_ARCH_PWR} \
-%{mcpu=power2: -D_ARCH_PWR2} \
-%{mcpu=powerpc: -D_ARCH_PPC} \
-%{mcpu=rios: -D_ARCH_PWR} \
-%{mcpu=rios1: -D_ARCH_PWR} \
-%{mcpu=rios2: -D_ARCH_PWR2} \
-%{mcpu=rsc: -D_ARCH_PWR} \
-%{mcpu=rsc1: -D_ARCH_PWR} \
-%{mcpu=403: -D_ARCH_PPC} \
-%{mcpu=505: -D_ARCH_PPC} \
-%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
-%{mcpu=602: -D_ARCH_PPC} \
-%{mcpu=603: -D_ARCH_PPC} \
-%{mcpu=603e: -D_ARCH_PPC} \
-%{mcpu=604: -D_ARCH_PPC} \
-%{mcpu=620: -D_ARCH_PPC} \
-%{mcpu=821: -D_ARCH_PPC} \
-%{mcpu=860: -D_ARCH_PPC}"
+#undef CPP_SYSV_DEFAULT_SPEC
+#define        CPP_SYSV_DEFAULT_SPEC "-D_CALL_AIX"
 
 /* Define this macro as a C expression for the initializer of an
    array of string to tell the driver program which options are
index 3927c6b623a7977c61163f4f805c3a6591c7ae75..aaa3ecd426c0443cf9a14654f777a40b9b3cdac0 100644 (file)
@@ -25,42 +25,11 @@ Boston, MA 02111-1307, USA.  */
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN)
 
-#undef CPP_SPEC
-#define CPP_SPEC "\
-%{posix: -D_POSIX_SOURCE} \
-%{mrelocatable: -D_RELOCATABLE} \
-%{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
-%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
-%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: -D_CALL_SYSV}}}} \
-%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \
-%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
+#undef CPP_ENDIAN_SPEC
+#define        CPP_ENDIAN_SPEC \
+"%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
 %{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
-%{!mbig: %{!mbig-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}} \
-%{!mcpu*: \
-  %{mpower: %{!mpower2: -D_ARCH_PWR}} \
-  %{mpower2: -D_ARCH_PWR2} \
-  %{mpowerpc*: -D_ARCH_PPC} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
-  %{!mno-powerpc: -D_ARCH_PPC}} \
-%{mcpu=common: -D_ARCH_COM} \
-%{mcpu=power: -D_ARCH_PWR} \
-%{mcpu=power2: -D_ARCH_PWR2} \
-%{mcpu=powerpc: -D_ARCH_PPC} \
-%{mcpu=rios: -D_ARCH_PWR} \
-%{mcpu=rios1: -D_ARCH_PWR} \
-%{mcpu=rios2: -D_ARCH_PWR2} \
-%{mcpu=rsc: -D_ARCH_PWR} \
-%{mcpu=rsc1: -D_ARCH_PWR} \
-%{mcpu=403: -D_ARCH_PPC} \
-%{mcpu=505: -D_ARCH_PPC} \
-%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
-%{mcpu=602: -D_ARCH_PPC} \
-%{mcpu=603: -D_ARCH_PPC} \
-%{mcpu=603e: -D_ARCH_PPC} \
-%{mcpu=604: -D_ARCH_PPC} \
-%{mcpu=620: -D_ARCH_PPC} \
-%{mcpu=821: -D_ARCH_PPC} \
-%{mcpu=860: -D_ARCH_PPC}"
+%{!mbig: %{!mbig-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}}"
 
 /* Define this macro as a C expression for the initializer of an
    array of string to tell the driver program which options are
index 4f1c934dbc4b96888997275691ae3a2727827403..db2c0bb97f55274e9bb8c2a3d61c2a6612419199 100644 (file)
@@ -72,34 +72,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* This can become more refined as we have more powerpc options. */
 #undef ASM_SPEC
-#define ASM_SPEC "\
--u \
-%{!mcpu*: \
-  %{mpower2: -mpwrx} \
-  %{mpowerpc*: %{!mpower: -mppc}} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -mcom}}} \
-  %{mno-powerpc: %{mpower: %{!mpower2: -mpwr}}} \
-  %{!mno-powerpc: %{mpower: -m601}} \
-  %{!mno-powerpc: %{!mpower: -mppc}}} \
-%{mcpu=common: -mcom} \
-%{mcpu=power: -mpwr} \
-%{mcpu=power2: -mpwrx} \
-%{mcpu=powerpc: -mppc} \
-%{mcpu=rios: -mpwr} \
-%{mcpu=rios1: -mpwr} \
-%{mcpu=rios2: -mpwrx} \
-%{mcpu=rsc: -mpwr} \
-%{mcpu=rsc1: -mpwr} \
-%{mcpu=403: -mppc} \
-%{mcpu=505: -mppc} \
-%{mcpu=601: -m601} \
-%{mcpu=602: -mppc} \
-%{mcpu=603: -mppc} \
-%{mcpu=603e: -mppc} \
-%{mcpu=604: -mppc} \
-%{mcpu=620: -mppc} \
-%{mcpu=821: -mppc} \
-%{mcpu=860: -mppc}"
+#define ASM_SPEC "-u %(asm_cpu)"
 
 #undef SUBTARGET_SWITCHES
 #define SUBTARGET_SWITCHES \
index b11204c075fa20ee530fd71dd07a542759b2fe97..83cd7cf3b7d8f6bc0e403a6413d2ec080fce7503 100644 (file)
@@ -182,34 +182,7 @@ toc_section ()                                                             \
   fprintf (FILE, ".%s", PREFIX)
 
 #undef ASM_SPEC
-#define ASM_SPEC "\
--u \
-%{!mcpu*: \
-  %{mpower2: -mpwrx} \
-  %{mpowerpc*: %{!mpower: -mppc}} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -mcom}}} \
-  %{mno-powerpc: %{mpower: %{!mpower2: -mpwr}}} \
-  %{!mno-powerpc: %{mpower: -m601}} \
-  %{!mno-powerpc: %{!mpower: -mppc}}} \
-%{mcpu=common: -mcom} \
-%{mcpu=power: -mpwr} \
-%{mcpu=power2: -mpwrx} \
-%{mcpu=powerpc: -mppc} \
-%{mcpu=rios: -mpwr} \
-%{mcpu=rios1: -mpwr} \
-%{mcpu=rios2: -mpwrx} \
-%{mcpu=rsc: -mpwr} \
-%{mcpu=rsc1: -mpwr} \
-%{mcpu=403: -mppc} \
-%{mcpu=505: -mppc} \
-%{mcpu=601: -m601} \
-%{mcpu=602: -mppc} \
-%{mcpu=603: -mppc} \
-%{mcpu=603e: -mppc} \
-%{mcpu=604: -mppc} \
-%{mcpu=620: -mppc} \
-%{mcpu=821: -mppc} \
-%{mcpu=860: -mppc} \
+#define ASM_SPEC "-u %(asm_cpu) \
 %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
 /* This is the end of what might become sysv4.h.  */
 
index 5d915cb749298c3503082862db27adce059730e5..c050690f49c3073edae8999b2dc0a312e68b8c50 100644 (file)
@@ -24,66 +24,17 @@ Boston, MA 02111-1307, USA.  */
 #include "rs6000/rs6000.h"
 
 #undef ASM_SPEC
-#define ASM_SPEC "-u \
-%{!mcpu*: \
-  %{mpower2: -mpwrx} \
-  %{mpowerpc*: %{!mpower: -mppc}} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -mcom}}} \
-  %{mno-powerpc: %{mpower: %{!mpower2: -mpwr}}} \
-  %{!mno-powerpc: %{mpower: -m601}} \
-  %{!mno-powerpc: %{!mpower: -mppc}}} \
-%{mcpu=common: -mcom} \
-%{mcpu=power: -mpwr} \
-%{mcpu=power2: -mpwrx} \
-%{mcpu=powerpc: -mppc} \
-%{mcpu=rios: -mpwr} \
-%{mcpu=rios1: -mpwr} \
-%{mcpu=rios2: -mpwrx} \
-%{mcpu=rsc: -mpwr} \
-%{mcpu=rsc1: -mpwr} \
-%{mcpu=403: -mppc} \
-%{mcpu=505: -mppc} \
-%{mcpu=601: -m601} \
-%{mcpu=602: -mppc} \
-%{mcpu=603: -mppc} \
-%{mcpu=603e: -mppc} \
-%{mcpu=604: -mppc} \
-%{mcpu=620: -mppc} \
-%{mcpu=821: -mppc} \
-%{mcpu=860: -mppc}"
+#define ASM_SPEC "-u %(asm_cpu)"
 
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 \
 -Asystem(unix) -Asystem(aix) -Acpu(powerpc) -Amachine(powerpc)"
 
-#undef CPP_SPEC
-#define CPP_SPEC "\
-%{posix: -D_POSIX_SOURCE} \
-%{!mcpu*: \
-  %{mpower: %{!mpower2: -D_ARCH_PWR}} \
-  %{mpower2: -D_ARCH_PWR2} \
-  %{mpowerpc*: -D_ARCH_PPC} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
-  %{!mno-powerpc: -D_ARCH_PPC}} \
-%{mcpu=common: -D_ARCH_COM} \
-%{mcpu=power: -D_ARCH_PWR} \
-%{mcpu=power2: -D_ARCH_PWR2} \
-%{mcpu=powerpc: -D_ARCH_PPC} \
-%{mcpu=rios: -D_ARCH_PWR} \
-%{mcpu=rios1: -D_ARCH_PWR} \
-%{mcpu=rios2: -D_ARCH_PWR2} \
-%{mcpu=rsc: -D_ARCH_PWR} \
-%{mcpu=rsc1: -D_ARCH_PWR} \
-%{mcpu=403: -D_ARCH_PPC} \
-%{mcpu=505: -D_ARCH_PPC} \
-%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
-%{mcpu=602: -D_ARCH_PPC} \
-%{mcpu=603: -D_ARCH_PPC} \
-%{mcpu=603e: -D_ARCH_PPC} \
-%{mcpu=604: -D_ARCH_PPC} \
-%{mcpu=620: -D_ARCH_PPC} \
-%{mcpu=821: -D_ARCH_PPC} \
-%{mcpu=860: -D_ARCH_PPC}"
+#undef CPP_DEFAULT_SPEC
+#define        CPP_DEFAULT_SPEC "-D_ARCH_PPC"
+
+#undef ASM_DEFAULT_SPEC
+#define        ASM_DEFAULT_SPEC "-mppc"
 
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
index 002c5ee7717dc9d7a0ef31de018d4858e4f31798..51c1ffde1b588a5449021d80e675b22f98dcedbe 100644 (file)
@@ -45,19 +45,22 @@ Boston, MA 02111-1307, USA.  */
    longer be needed.  Also, the extern declaration of mcount in ASM_FILE_START
    will no longer be needed.  */
 
-/* #define ASM_SPEC "-u" */
+/* #define ASM_SPEC "-u %(asm_cpu)" */
 
 /* Define appropriate architecture macros for preprocessor depending on
    target switches.  */
 
-#define CPP_SPEC "\
-%{posix: -D_POSIX_SOURCE} \
-%{!mcpu*: \
+#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_cpu)"
+
+/* Common CPP definitions used by CPP_SPEC amonst the various targets
+   for handling -mcpu=xxx switches.  */
+#define CPP_CPU_SPEC \
+"%{!mcpu*: \
   %{mpower: %{!mpower2: -D_ARCH_PWR}} \
   %{mpower2: -D_ARCH_PWR2} \
   %{mpowerpc*: -D_ARCH_PPC} \
   %{mno-power: %{!mpowerpc*: -D_ARCH_COM}} \
-  %{!mno-power: %{!mpower2: -D_ARCH_PWR}}} \
+  %{!mno-power: %{!mpower2: %(cpp_default)}}} \
 %{mcpu=common: -D_ARCH_COM} \
 %{mcpu=power: -D_ARCH_PWR} \
 %{mcpu=power2: -D_ARCH_PWR2} \
@@ -70,7 +73,7 @@ Boston, MA 02111-1307, USA.  */
 %{mcpu=403: -D_ARCH_PPC} \
 %{mcpu=505: -D_ARCH_PPC} \
 %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
-%{mcpu=602: -d_ARCH_PPC} \
+%{mcpu=602: -D_ARCH_PPC} \
 %{mcpu=603: -D_ARCH_PPC} \
 %{mcpu=603e: -D_ARCH_PPC} \
 %{mcpu=604: -D_ARCH_PPC} \
@@ -78,6 +81,74 @@ Boston, MA 02111-1307, USA.  */
 %{mcpu=821: -D_ARCH_PPC} \
 %{mcpu=860: -D_ARCH_PPC}"
 
+#ifndef CPP_DEFAULT_SPEC
+#define CPP_DEFAULT_SPEC "-D_ARCH_PWR"
+#endif
+
+#ifndef CPP_SYSV_SPEC
+#define CPP_SYSV_SPEC ""
+#endif
+
+#ifndef CPP_ENDIAN_SPEC
+#define CPP_ENDIAN_SPEC ""
+#endif
+
+#ifndef CPP_SYSV_DEFAULT_SPEC
+#define CPP_SYSV_DEFAULT_SPEC ""
+#endif
+
+/* Common ASM definitions used by ASM_SPEC amonst the various targets
+   for handling -mcpu=xxx switches.  */
+#define ASM_CPU_SPEC \
+"%{!mcpu*: \
+  %{mpower: %{!mpower2: -mpwr}} \
+  %{mpower2: -mpwrx} \
+  %{mpowerpc*: -mppc} \
+  %{mno-power: %{!mpowerpc*: -mcom}} \
+  %{!mno-power: %{!mpower2: %(asm_default)}}} \
+%{mcpu=common: -mcom} \
+%{mcpu=power: -mpwr} \
+%{mcpu=power2: -mpwrx} \
+%{mcpu=powerpc: -mppc} \
+%{mcpu=rios: -mpwr} \
+%{mcpu=rios1: -mpwr} \
+%{mcpu=rios2: -mpwrx} \
+%{mcpu=rsc: -mpwr} \
+%{mcpu=rsc1: -mpwr} \
+%{mcpu=403: -mppc} \
+%{mcpu=505: -mppc} \
+%{mcpu=601: -m601} \
+%{mcpu=602: -mppc} \
+%{mcpu=603: -mppc} \
+%{mcpu=603e: -mppc} \
+%{mcpu=604: -mppc} \
+%{mcpu=620: -mppc} \
+%{mcpu=821: -mppc} \
+%{mcpu=860: -mppc}"
+
+#ifndef ASM_DEFAULT_SPEC
+#define ASM_DEFAULT_SPEC "-mpwr"
+#endif
+
+/* This macro defines names of additional specifications to put in the specs
+   that can be used in various specifications like CC1_SPEC.  Its definition
+   is an initializer with a subgrouping for each command option.
+
+   Each subgrouping contains a string constant, that defines the
+   specification name, and a string constant that used by the GNU CC driver
+   program.
+
+   Do not define this macro if it does not need to do anything.  */
+
+#define EXTRA_SPECS                                    \
+  { "cpp_cpu",         CPP_CPU_SPEC },                 \
+  { "cpp_default",     CPP_DEFAULT_SPEC },             \
+  { "cpp_sysv",                CPP_SYSV_SPEC },                \
+  { "cpp_sysv_default",        CPP_SYSV_DEFAULT_SPEC },        \
+  { "cpp_endian",      CPP_ENDIAN_SPEC },              \
+  { "asm_cpu",         ASM_CPU_SPEC },                 \
+  { "asm_default",     ASM_DEFAULT_SPEC }
+
 /* Define the options for the binder: Start text at 512, align all segments
    to 512 bytes, and warn if there is text relocation.
 
index 586c3592532713dd7276db72eb0af0cba312c00d..08742998820527ffc3a1d2156f310cf4b2a0eeab 100644 (file)
@@ -425,34 +425,7 @@ extern int rs6000_pic_labelno;
 /* Pass -mppc to the assembler, since that is what powerpc.h currently
    implies.  */
 #undef ASM_SPEC
-#define ASM_SPEC "\
--u \
-%{!mcpu*: \
-  %{mpower2: -mpwrx} \
-  %{mpowerpc*: %{!mpower: -mppc}} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -mcom}}} \
-  %{mno-powerpc: %{mpower: %{!mpower2: -mpwr}}} \
-  %{!mno-powerpc: %{mpower: -m601}} \
-  %{!mno-powerpc: %{!mpower: -mppc}}} \
-%{mcpu=common: -mcom} \
-%{mcpu=power: -mpwr} \
-%{mcpu=power2: -mpwrx} \
-%{mcpu=powerpc: -mppc} \
-%{mcpu=rios: -mpwr} \
-%{mcpu=rios1: -mpwr} \
-%{mcpu=rios2: -mpwrx} \
-%{mcpu=rsc: -mpwr} \
-%{mcpu=rsc1: -mpwr} \
-%{mcpu=403: -mppc} \
-%{mcpu=505: -mppc} \
-%{mcpu=601: -m601} \
-%{mcpu=602: -mppc} \
-%{mcpu=603: -mppc} \
-%{mcpu=603e: -mppc} \
-%{mcpu=604: -mppc} \
-%{mcpu=620: -mppc} \
-%{mcpu=821: -mppc} \
-%{mcpu=860: -mppc} \
+#define ASM_SPEC "-u %(asm_cpu) \
 %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
 %{mrelocatable} %{mrelocatable-lib} %{memb} \
 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
@@ -608,42 +581,25 @@ do {                                                                      \
 %{mbig: -oformat elf32-powerpc } %{mbig-endian: -oformat elf32-powerpc }"
 #endif /* CROSS_COMPILE */
 
-#undef CPP_SPEC
-#define CPP_SPEC "\
-%{posix: -D_POSIX_SOURCE} \
-%{mrelocatable: -D_RELOCATABLE} \
+#undef CPP_SYSV_SPEC
+#define CPP_SYSV_SPEC \
+"%{mrelocatable: -D_RELOCATABLE} \
 %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
 %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
-%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: -D_CALL_SYSV}}}} \
-%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \
-%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
+%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} \
+%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
+
+#undef CPP_SYSV_DEFAULT_SPEC
+#define        CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
+
+#undef CPP_ENDIAN_SPEC
+#define        CPP_ENDIAN_SPEC \
+"%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
 %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
-%{!mlittle: %{!mlittle-endian: -D_BIG_ENDIAN -Amachine(bigendian)}} \
-%{!mcpu*: \
-  %{mpower: %{!mpower2: -D_ARCH_PWR}} \
-  %{mpower2: -D_ARCH_PWR2} \
-  %{mpowerpc*: -D_ARCH_PPC} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
-  %{!mno-powerpc: -D_ARCH_PPC}} \
-%{mcpu=common: -D_ARCH_COM} \
-%{mcpu=power: -D_ARCH_PWR} \
-%{mcpu=power2: -D_ARCH_PWR2} \
-%{mcpu=powerpc: -D_ARCH_PPC} \
-%{mcpu=rios: -D_ARCH_PWR} \
-%{mcpu=rios1: -D_ARCH_PWR} \
-%{mcpu=rios2: -D_ARCH_PWR2} \
-%{mcpu=rsc: -D_ARCH_PWR} \
-%{mcpu=rsc1: -D_ARCH_PWR} \
-%{mcpu=403: -D_ARCH_PPC} \
-%{mcpu=505: -D_ARCH_PPC} \
-%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
-%{mcpu=602: -D_ARCH_PPC} \
-%{mcpu=603: -D_ARCH_PPC} \
-%{mcpu=603e: -D_ARCH_PPC} \
-%{mcpu=604: -D_ARCH_PPC} \
-%{mcpu=620: -D_ARCH_PPC} \
-%{mcpu=821: -D_ARCH_PPC} \
-%{mcpu=860: -D_ARCH_PPC}"
+%{!mlittle: %{!mlittle-endian: -D_BIG_ENDIAN -Amachine(bigendian)}}"
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu)"
 
 /* Define this macro as a C expression for the initializer of an
    array of string to tell the driver program which options are
index 4d05d90e152fa50cb6c95f593a7eece3bce57287..14663a6b6c75d90e535f00c7b68415ab8049d7ff 100644 (file)
@@ -25,39 +25,12 @@ Boston, MA 02111-1307, USA.  */
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN)
 
-#undef CPP_SPEC
-#define CPP_SPEC "\
-%{posix: -D_POSIX_SOURCE} \
-%{mrelocatable: -D_RELOCATABLE} \
-%{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
-%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
-%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: -D_CALL_SYSV}}}} \
-%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \
-%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
+#undef CPP_ENDIAN_SPEC
+#define        CPP_ENDIAN_SPEC \
+"%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
 %{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
-%{!mbig: %{!mbig-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}} \
-%{!mcpu*: \
-  %{mpower: %{!mpower2: -D_ARCH_PWR}} \
-  %{mpower2: -D_ARCH_PWR2} \
-  %{mpowerpc*: -D_ARCH_PPC} \
-  %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
-  %{!mno-powerpc: -D_ARCH_PPC}} \
-%{mcpu=common: -D_ARCH_COM} \
-%{mcpu=power: -D_ARCH_PWR} \
-%{mcpu=power2: -D_ARCH_PWR2} \
-%{mcpu=powerpc: -D_ARCH_PPC} \
-%{mcpu=rios: -D_ARCH_PWR} \
-%{mcpu=rios1: -D_ARCH_PWR} \
-%{mcpu=rios2: -D_ARCH_PWR2} \
-%{mcpu=rsc: -D_ARCH_PWR} \
-%{mcpu=rsc1: -D_ARCH_PWR} \
-%{mcpu=403: -D_ARCH_PPC} \
-%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
-%{mcpu=602: -D_ARCH_PPC} \
-%{mcpu=603: -D_ARCH_PPC} \
-%{mcpu=603e: -D_ARCH_PPC} \
-%{mcpu=604: -D_ARCH_PPC} \
-%{mcpu=620: -D_ARCH_PPC}"
+%{!mbig: %{!mbig-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}}"
+
 
 /* Define this macro as a C expression for the initializer of an
    array of string to tell the driver program which options are
index d905f5f5656d363b7cf8d3e01394b2449e05c891..298a4317f7cff97636bea79077d929142cc00b33 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -546,6 +546,10 @@ static char *startfile_spec = STARTFILE_SPEC;
 static char *switches_need_spaces = SWITCHES_NEED_SPACES;
 static char *multilib_select = MULTILIB_SELECT;
 
+#ifdef EXTRA_SPECS
+static struct { char *name, *spec; } extra_specs[] = { EXTRA_SPECS };
+#endif
+
 /* This defines which switch letters take arguments.  */
 
 #ifndef SWITCH_TAKES_ARG
@@ -1254,6 +1258,21 @@ set_spec (name, spec)
     cross_compile = atoi (sl->spec);
   else if (! strcmp (name, "multilib"))
     multilib_select = sl->spec;
+#ifdef EXTRA_SPECS
+  else
+    {
+      int i;
+      for (i = 0; i < sizeof (extra_specs) / sizeof (extra_specs[0]); i++)
+       {
+         if (! strcmp (name, extra_specs[i].name))
+           {
+             extra_specs[i].spec = sl->spec;
+             break;
+           }
+       }
+    }
+#endif
+
   /* Free the old spec */
   if (old_spec)
     free (old_spec);
@@ -2512,6 +2531,14 @@ process_command (argc, argv)
          printf ("*cross_compile:\n%d\n\n", cross_compile);
          printf ("*multilib:\n%s\n\n", multilib_select);
 
+#ifdef EXTRA_SPECS
+         {
+           int j;
+           for (j = 0; j < sizeof (extra_specs) / sizeof (extra_specs[0]); j++)
+             printf ("*%s:\n%s\n\n", extra_specs[j].name,
+                     (extra_specs[j].spec) ? extra_specs[j].spec : "");
+         }
+#endif
          exit (0);
        }
       else if (! strcmp (argv[i], "-dumpversion"))
@@ -4314,6 +4341,15 @@ main (argc, argv)
   if (specs_file != 0 && strcmp (specs_file, "specs"))
     read_specs (specs_file);
 
+#ifdef EXTRA_SPECS
+  else
+    {
+      int k;
+      for (k = 0; k < sizeof (extra_specs) / sizeof (extra_specs[0]); k++)
+       set_spec (extra_specs[k].name, extra_specs[k].spec);
+    }
+#endif
+
   /* If not cross-compiling, look for startfiles in the standard places.  */
   /* The fact that these are done here, after reading the specs file,
      means that it cannot be found in these directories.
@@ -4956,6 +4992,21 @@ validate_all_switches ()
     if (c == '%' && *p == '{')
       /* We have a switch spec.  */
       validate_switches (p + 1);
+
+#ifdef EXTRA_SPECS
+  {
+    int i;
+    for (i = 0; i < sizeof (extra_specs) / sizeof (extra_specs[0]); i++)
+      {
+       p = extra_specs[i].spec;
+       while (c = *p++)
+         if (c == '%' && *p == '{')
+           /* We have a switch spec.  */
+           validate_switches (p + 1);
+      }
+  }
+#endif
+
 }
 
 /* Look at the switch-name that comes after START