summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/config/i386/netbsd-elf.h19
-rw-r--r--gcc/config/i386/netbsd.h15
-rw-r--r--gcc/config/i386/netbsd64.h31
4 files changed, 51 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 75ebd81002c..4fe6deb2119 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+2002-05-29 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/i386/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
+ (CPP_PREDEFINES): Remove.
+ (SUBTARGET_EXTRA_SPECS): Define.
+ (CPP_SPEC): Use %(netbsd_cpp_spec).
+ * config/i386/netbsd.h (TARGET_OS_CPP_BUILTINS): Define.
+ (CPP_PREDEFINES): Remove.
+ (SUBTARGET_EXTRA_SPECS): Define.
+ (CPP_SPEC): Use %(netbsd_cpp_spec).
+ * config/i386/netbsd64.h (TARGET_OS_CPP_BUILTINS): Define.
+ (CPP_PREDEFINES, CPP_LP64_SPEC, CPP_SUBTARGET_SPEC): Remove.
+ (SUBTARGET_EXTRA_SPECS): Remove cpp_lp64 and cpp_subtarget.
+ Add netbsd_cpp_spec.
+ (CPP_SPEC): Remove %(cpp_subtarget), add %(netbsd_cpp_spec).
+
2002-05-29 Neil Booth <neil@daikokuya.demon.co.uk>
Zack Weinberg <zack@codesourcery.com>
diff --git a/gcc/config/i386/netbsd-elf.h b/gcc/config/i386/netbsd-elf.h
index f3992e8ae37..b91847f7a4a 100644
--- a/gcc/config/i386/netbsd-elf.h
+++ b/gcc/config/i386/netbsd-elf.h
@@ -20,6 +20,13 @@ 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. */
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_CPP_BUILTINS_ELF(); \
+ } \
+ while (0)
+
/* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target.
This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
the i386 target. */
@@ -38,16 +45,14 @@ Boston, MA 02111-1307, USA. */
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
%{static:-static}}"
-/* Names to predefine in the preprocessor for this target machine. */
-
-#define CPP_PREDEFINES \
- "-D__NetBSD__ -D__ELF__ -Asystem=unix -Asystem=NetBSD"
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "netbsd_cpp_spec", NETBSD_CPP_SPEC },
-/* Provide a CPP_SPEC appropriate for NetBSD. Currently we just deal with
- the GCC option `-posix'. */
+/* Provide a CPP_SPEC appropriate for NetBSD. */
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %(netbsd_cpp_spec)"
/* Make gcc agree with <machine/ansi.h> */
diff --git a/gcc/config/i386/netbsd.h b/gcc/config/i386/netbsd.h
index 400cb0f432f..89dce21a311 100644
--- a/gcc/config/i386/netbsd.h
+++ b/gcc/config/i386/netbsd.h
@@ -1,3 +1,10 @@
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_CPP_BUILTINS_AOUT(); \
+ } \
+ while (0)
+
#define TARGET_VERSION fprintf (stderr, " (NetBSD/i386 a.out)");
/* This goes away when the math-emulator is fixed */
@@ -5,12 +12,12 @@
#define TARGET_SUBTARGET_DEFAULT \
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -D__NetBSD__ \
- -Asystem=unix -Asystem=bsd -Asystem=NetBSD"
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "netbsd_cpp_spec", NETBSD_CPP_SPEC },
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %(netbsd_cpp_spec)"
#undef SIZE_TYPE
diff --git a/gcc/config/i386/netbsd64.h b/gcc/config/i386/netbsd64.h
index 26a3f42c861..24448c98515 100644
--- a/gcc/config/i386/netbsd64.h
+++ b/gcc/config/i386/netbsd64.h
@@ -20,6 +20,14 @@ 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. */
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ NETBSD_OS_CPP_BUILTINS_ELF(); \
+ if (TARGET_64BIT) \
+ NETBSD_OS_CPP_BUILTINS_LP64(); \
+ } \
+ while (0)
/* Provide a LINK_SPEC appropriate for a NetBSD/x86-64 ELF target.
This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
@@ -41,29 +49,14 @@ Boston, MA 02111-1307, USA. */
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
%{static:-static}}"
-
-/* Names to predefine in the preprocessor for this target machine. */
-
-#define CPP_PREDEFINES \
- "-D__NetBSD__ -D__ELF__ -Asystem=unix -Asystem=NetBSD"
-
-
-/* Provide some extra CPP specs needed by NetBSD/x86_64. */
-#define CPP_LP64_SPEC "%{!m32:-D_LP64}"
-
-#define CPP_SUBTARGET_SPEC "%(cpp_lp64)"
-
#undef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS \
- { "cpp_lp64", CPP_LP64_SPEC }, \
- { "cpp_subtarget", CPP_SUBTARGET_SPEC },
-
+#define SUBTARGET_EXTRA_SPECS \
+ { "netbsd_cpp_spec", NETBSD_CPP_SPEC },
-/* Provide a CPP_SPEC appropriate for NetBSD. Currently we deal with
- our subtarget specs and the GCC option `-posix'. */
+/* Provide a CPP_SPEC appropriate for NetBSD. */
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %(cpp_subtarget) %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %(netbsd_cpp_spec)"
/* Output assembler code to FILE to call the profiler. */