OSDN Git Service

* config/netbsd-aout.h (NETBSD_OS_CPP_BUILTINS_AOUT): Define
[pf3gnuchains/gcc-fork.git] / gcc / config / netbsd.h
1 /* Base configuration file for all NetBSD targets.
2    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 /* TARGET_OS_CPP_BUILTINS() common to all NetBSD targets.  */
23 #define NETBSD_OS_CPP_BUILTINS_COMMON()         \
24   do                                            \
25     {                                           \
26       builtin_define ("__NetBSD__");            \
27       builtin_assert ("system=unix");           \
28       builtin_assert ("system=NetBSD");         \
29     }                                           \
30   while (0)
31
32 /* TARGET_OS_CPP_BUILTINS() common to all LP64 NetBSD targets.  */
33 #define NETBSD_OS_CPP_BUILTINS_LP64()           \
34   do                                            \
35     {                                           \
36       builtin_define ("_LP64");                 \
37     }                                           \
38   while (0)
39
40 /* CPP_SPEC parts common to all NetBSD targets.  */
41 #define NETBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
42
43 /* NETBSD_NATIVE is defined when gcc is integrated into the NetBSD
44    source tree so it can be configured appropriately without using
45    the GNU configure/build mechanism. */
46
47 #ifdef NETBSD_NATIVE
48
49 /* Look for the include files in the system-defined places.  */
50
51 #undef GPLUSPLUS_INCLUDE_DIR
52 #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
53
54 #undef GCC_INCLUDE_DIR
55 #define GCC_INCLUDE_DIR "/usr/include"
56
57 #undef INCLUDE_DEFAULTS
58 #define INCLUDE_DEFAULTS                        \
59   {                                             \
60     { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },     \
61     { GCC_INCLUDE_DIR, "GCC", 0, 0 },           \
62     { 0, 0, 0, 0 }                              \
63   }
64
65 /* Under NetBSD, the normal location of the compiler back ends is the
66    /usr/libexec directory.  */
67
68 #undef STANDARD_EXEC_PREFIX
69 #define STANDARD_EXEC_PREFIX            "/usr/libexec/"
70
71 /* Under NetBSD, the normal location of the various *crt*.o files is the
72    /usr/lib directory.  */
73
74 #undef STANDARD_STARTFILE_PREFIX
75 #define STANDARD_STARTFILE_PREFIX       "/usr/lib/"
76
77 #endif /* NETBSD_NATIVE */
78
79
80 /* Provide a LIB_SPEC appropriate for NetBSD.  Just select the appropriate
81    libc, depending on whether we're doing profiling; if `-posix' is specified,
82    link against the appropriate libposix first.  Don't include libc when
83    linking a shared library.  */
84
85 #undef LIB_SPEC
86 #define LIB_SPEC                \
87   "%{posix:                     \
88      %{!p:                      \
89        %{!pg:-lposix}}          \
90      %{p:-lposix_p}             \
91      %{pg:-lposix_p}}           \
92    %{!shared:                   \
93      %{!symbolic:               \
94        %{!p:                    \
95          %{!pg:-lc}}            \
96        %{p:-lc_p}               \
97        %{pg:-lc_p}}}"
98
99 /* Provide a LIBGCC_SPEC appropriate for NetBSD.  We also want to exclude
100    libgcc with -symbolic.  */
101
102 #undef LIBGCC_SPEC
103 #ifdef NETBSD_NATIVE
104 #define LIBGCC_SPEC             \
105   "%{!symbolic:                 \
106      %{!shared:                 \
107        %{!p:                    \
108          %{!pg: -lgcc}}}                \
109      %{shared: -lgcc_pic}       \
110      %{p: -lgcc_p}              \
111      %{pg: -lgcc_p}}"
112 #else
113 #define LIBGCC_SPEC "%{!shared:%{!symbolic: -lgcc}}"
114 #endif
115
116 /* When building shared libraries, the initialization and finalization 
117    functions for the library are .init and .fini respectively.  */
118
119 #define COLLECT_SHARED_INIT_FUNC(STREAM,FUNC)                           \
120   do {                                                                  \
121     fprintf ((STREAM), "void __init() __asm__ (\".init\");");           \
122     fprintf ((STREAM), "void __init() {\n\t%s();\n}\n", (FUNC));        \
123   } while (0)
124
125 #define COLLECT_SHARED_FINI_FUNC(STREAM,FUNC)                           \
126   do {                                                                  \
127     fprintf ((STREAM), "void __fini() __asm__ (\".fini\");");           \
128     fprintf ((STREAM), "void __fini() {\n\t%s();\n}\n", (FUNC));        \
129   } while (0)
130
131 /* Allow #sccs in preprocessor.  */
132
133 #undef SCCS_DIRECTIVE
134 #define SCCS_DIRECTIVE
135
136 #undef TARGET_HAS_F_SETLKW
137 #define TARGET_HAS_F_SETLKW
138
139 /* Implicit library calls should use memcpy, not bcopy, etc.  */
140
141 #undef TARGET_MEM_FUNCTIONS
142 #define TARGET_MEM_FUNCTIONS 1
143
144 /* Handle #pragma weak and #pragma pack.  */
145
146 #define HANDLE_SYSV_PRAGMA
147
148
149 /* Define some types that are the same on all NetBSD platforms,
150    making them agree with <machine/ansi.h>.  */
151
152 #undef WCHAR_TYPE
153 #define WCHAR_TYPE "int"
154
155 #undef WCHAR_TYPE_SIZE
156 #define WCHAR_TYPE_SIZE 32
157
158 #undef WINT_TYPE
159 #define WINT_TYPE "int"