elf.h: Use TARGET_OS_CPP_BUILTINS rather than SUBTARGET_SPEC.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Sun, 2 Jun 2002 21:00:50 +0000 (21:00 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sun, 2 Jun 2002 21:00:50 +0000 (21:00 +0000)
config/h8300:
* elf.h: Use TARGET_OS_CPP_BUILTINS rather than
SUBTARGET_SPEC.
* rtems.h: Similarly.
* h8300.h (CPP_PREDEFINES, CPP_SPEC, SUBTARGET_CPP_SPEC,
EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): Remove.
(TARGET_CPU_CPP_BUILTINS): Use.

From-SVN: r54187

gcc/ChangeLog
gcc/config/h8300/elf.h
gcc/config/h8300/h8300.h
gcc/config/h8300/rtems.h

index 54cc7a4eef08f17a6a3b9067aa8f10343d29b41f..f931d52e98d35ad54e7bb6fd7fca587d7ceaf800 100644 (file)
@@ -1,3 +1,13 @@
+2002-06-02  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+config/h8300:
+       * elf.h: Use TARGET_OS_CPP_BUILTINS rather than
+       SUBTARGET_SPEC.
+       * rtems.h: Similarly.
+       * h8300.h (CPP_PREDEFINES, CPP_SPEC, SUBTARGET_CPP_SPEC,
+       EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): Remove.
+       (TARGET_CPU_CPP_BUILTINS): Use.
+
 2002-06-02  Richard Henderson  <rth@redhat.com>
 
        * alias.c: Include target.h.
index 7aad2a64c8c837c7c93072cb3ff276b1b0ec90d6..81e320c061d750928a91f031df525980b8a990f4 100644 (file)
@@ -1,5 +1,8 @@
-#undef SUBTARGET_CPP_SPEC
-#define SUBTARGET_CPP_SPEC "-D__ELF__"
+/* Target OS preprocessor built-ins.  */
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define ("__ELF__");             \
+    } while (0)
 
 /* Undefine some macros defined in h8300 that conflict with elfos.h .  */
 #undef SDB_DEBUGGING_INFO
index 2bee304bbe8c43060cb1a9aab77b4f0155d2e989..78bd8d33ec4f904bb7d334a018fdf666caf07479 100644 (file)
@@ -37,31 +37,41 @@ extern int cpu_type;
 extern const char *h8_push_op, *h8_pop_op, *h8_mov_op;
 extern const char * const *h8_reg_names;
 
-/* Names to predefine in the preprocessor for this target machine.  */
-
-#define CPP_PREDEFINES \
-"-D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L"
-
-#define CPP_SPEC \
-  "%{!mh:%{!ms:-D__H8300__}} %{mh:-D__H8300H__} %{ms:-D__H8300S__} \
-   %{!mh:%{!ms:-Acpu=h8300 -Amachine=h8300}} \
-   %{mh:-Acpu=h8300h -Amachine=h8300h} \
-   %{ms:-Acpu=h8300s -Amachine=h8300s} \
-   %{!mint32:-D__INT_MAX__=32767} %{mint32:-D__INT_MAX__=2147483647} \
-   %(subtarget_cpp_spec)"
-
-#define SUBTARGET_CPP_SPEC ""
+/* Target CPU builtins.  */
+#define TARGET_CPU_CPP_BUILTINS()                      \
+  do                                                   \
+    {                                                  \
+      if (TARGET_H8300H)                               \
+        {                                              \
+         builtin_define ("__H8300H__");                \
+         builtin_assert ("cpu=h8300h");                \
+         builtin_assert ("machine=h8300h");            \
+       }                                               \
+      else if (TARGET_H8300S)                          \
+        {                                              \
+         builtin_define ("__H8300S__");                \
+         builtin_assert ("cpu=h8300s");                \
+         builtin_assert ("machine=h8300s");            \
+       }                                               \
+      else                                             \
+        {                                              \
+         builtin_define ("__H8300__");                 \
+         builtin_assert ("cpu=h8300");                 \
+         builtin_assert ("machine=h8300");             \
+       }                                               \
+      if (TARGET_INT32)                                        \
+       builtin_define ("__INT_MAX__=2147483647");      \
+      else                                             \
+       builtin_define ("__INT_MAX__=32767");           \
+      builtin_define ("__LONG_MAX__=2147483647L");     \
+      builtin_define ("__LONG_LONG_MAX__=2147483647L");        \
+    }                                                  \
+  while (0)
 
 #define LINK_SPEC "%{mh:-m h8300h} %{ms:-m h8300s}"
 
 #define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
 
-#define EXTRA_SPECS                                            \
-  { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC },        \
-  SUBTARGET_EXTRA_SPECS
-
-#define SUBTARGET_EXTRA_SPECS
-
 /* Print subsidiary information on the compiler version in use.  */
 
 #define TARGET_VERSION fprintf (stderr, " (Hitachi H8/300)");
index 2e7676f41f96c20bac053ea33be1239bb65171e1..6b487cd1b7b34c6048c011bd8e4aa3ac459e3024 100644 (file)
@@ -19,7 +19,10 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dh8300 \
-  -D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L \
-  -D__rtems__ -Asystem=rtems"
+/* Target OS preprocessor built-ins.  */
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define_std ("h8300");           \
+       builtin_define ("__rtems__");           \
+       builtin_assert ("system=rtems");        \
+    } while (0)