OSDN Git Service

* doc/gcc.texi: Move several chapters out to ...
[pf3gnuchains/gcc-fork.git] / gcc / doc / hostconfig.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2 @c 1999, 2000, 2001 Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi.
5
6 @node Config
7 @chapter The Configuration File
8 @cindex configuration file
9 @cindex @file{xm-@var{machine}.h}
10
11 The configuration file @file{xm-@var{machine}.h} contains macro
12 definitions that describe the machine and system on which the compiler
13 is running, unlike the definitions in @file{@var{machine}.h}, which
14 describe the machine for which the compiler is producing output.  Most
15 of the values in @file{xm-@var{machine}.h} are actually the same on all
16 machines that GCC runs on, so large parts of all configuration files
17 are identical.  But there are some macros that vary:
18
19 @table @code
20 @findex USG
21 @item USG
22 Define this macro if the host system is System V@.
23
24 @findex VMS
25 @item VMS
26 Define this macro if the host system is VMS@.
27
28 @findex FATAL_EXIT_CODE
29 @item FATAL_EXIT_CODE
30 A C expression for the status code to be returned when the compiler
31 exits after serious errors.  The default is the system-provided macro
32 @samp{EXIT_FAILURE}, or @samp{1} if the system doesn't define that
33 macro.  Define this macro only if these defaults are incorrect.
34
35 @findex SUCCESS_EXIT_CODE
36 @item SUCCESS_EXIT_CODE
37 A C expression for the status code to be returned when the compiler
38 exits without serious errors.  (Warnings are not serious errors.)  The
39 default is the system-provided macro @samp{EXIT_SUCCESS}, or @samp{0} if
40 the system doesn't define that macro.  Define this macro only if these
41 defaults are incorrect.
42
43 @findex HOST_WORDS_BIG_ENDIAN
44 @item HOST_WORDS_BIG_ENDIAN
45 Defined if the host machine stores words of multi-word values in
46 big-endian order.  (GCC does not depend on the host byte ordering
47 within a word.)
48
49 @findex HOST_FLOAT_WORDS_BIG_ENDIAN
50 @item HOST_FLOAT_WORDS_BIG_ENDIAN
51 Define this macro to be 1 if the host machine stores @code{DFmode},
52 @code{XFmode} or @code{TFmode} floating point numbers in memory with the
53 word containing the sign bit at the lowest address; otherwise, define it
54 to be zero.
55
56 This macro need not be defined if the ordering is the same as for
57 multi-word integers.
58
59 @findex HOST_FLOAT_FORMAT
60 @item HOST_FLOAT_FORMAT
61 A numeric code distinguishing the floating point format for the host
62 machine.  See @code{TARGET_FLOAT_FORMAT} in @ref{Storage Layout} for the
63 alternatives and default.
64
65 @findex HOST_BITS_PER_CHAR
66 @item HOST_BITS_PER_CHAR
67 A C expression for the number of bits in @code{char} on the host
68 machine.
69
70 @findex HOST_BITS_PER_SHORT
71 @item HOST_BITS_PER_SHORT
72 A C expression for the number of bits in @code{short} on the host
73 machine.
74
75 @findex HOST_BITS_PER_INT
76 @item HOST_BITS_PER_INT
77 A C expression for the number of bits in @code{int} on the host
78 machine.
79
80 @findex HOST_BITS_PER_LONG
81 @item HOST_BITS_PER_LONG
82 A C expression for the number of bits in @code{long} on the host
83 machine.
84
85 @findex HOST_BITS_PER_LONGLONG
86 @item HOST_BITS_PER_LONGLONG
87 A C expression for the number of bits in @code{long long} on the host
88 machine.
89
90 @findex ONLY_INT_FIELDS
91 @item ONLY_INT_FIELDS
92 Define this macro to indicate that the host compiler only supports
93 @code{int} bit-fields, rather than other integral types, including
94 @code{enum}, as do most C compilers.
95
96 @findex OBSTACK_CHUNK_SIZE
97 @item OBSTACK_CHUNK_SIZE
98 A C expression for the size of ordinary obstack chunks.
99 If you don't define this, a usually-reasonable default is used.
100
101 @findex OBSTACK_CHUNK_ALLOC
102 @item OBSTACK_CHUNK_ALLOC
103 The function used to allocate obstack chunks.
104 If you don't define this, @code{xmalloc} is used.
105
106 @findex OBSTACK_CHUNK_FREE
107 @item OBSTACK_CHUNK_FREE
108 The function used to free obstack chunks.
109 If you don't define this, @code{free} is used.
110
111 @findex USE_C_ALLOCA
112 @item USE_C_ALLOCA
113 Define this macro to indicate that the compiler is running with the
114 @code{alloca} implemented in C@.  This version of @code{alloca} can be
115 found in the file @file{alloca.c}; to use it, you must also alter the
116 @file{Makefile} variable @code{ALLOCA}.  (This is done automatically
117 for the systems on which we know it is needed.)
118
119 If you do define this macro, you should probably do it as follows:
120
121 @example
122 #ifndef __GNUC__
123 #define USE_C_ALLOCA
124 #else
125 #define alloca __builtin_alloca
126 #endif
127 @end example
128
129 @noindent
130 so that when the compiler is compiled with GCC it uses the more
131 efficient built-in @code{alloca} function.
132
133 @item FUNCTION_CONVERSION_BUG
134 @findex FUNCTION_CONVERSION_BUG
135 Define this macro to indicate that the host compiler does not properly
136 handle converting a function value to a pointer-to-function when it is
137 used in an expression.
138
139 @findex MULTIBYTE_CHARS
140 @item MULTIBYTE_CHARS
141 Define this macro to enable support for multibyte characters in the
142 input to GCC@.  This requires that the host system support the ISO C
143 library functions for converting multibyte characters to wide
144 characters.
145
146 @findex POSIX
147 @item POSIX
148 Define this if your system is POSIX.1 compliant.
149
150 @findex PATH_SEPARATOR
151 @item PATH_SEPARATOR
152 Define this macro to be a C character constant representing the
153 character used to separate components in paths.  The default value is
154 the colon character
155
156 @findex DIR_SEPARATOR
157 @item DIR_SEPARATOR
158 If your system uses some character other than slash to separate
159 directory names within a file specification, define this macro to be a C
160 character constant specifying that character.  When GCC displays file
161 names, the character you specify will be used.  GCC will test for
162 both slash and the character you specify when parsing filenames.
163
164 @findex DIR_SEPARATOR_2
165 @item DIR_SEPARATOR_2
166 If your system uses an alternative character other than
167 @samp{DIR_SEPARATOR} to separate directory names within a file
168 specification, define this macro to be a C character constant specifying
169 that character.  If you define this macro, GCC will test for slash,
170 @samp{DIR_SEPARATOR}, and @samp{DIR_SEPARATOR_2} when parsing filenames.
171
172 @findex TARGET_OBJECT_SUFFIX
173 @item TARGET_OBJECT_SUFFIX
174 Define this macro to be a C string representing the suffix for object
175 files on your target machine.  If you do not define this macro, GCC will
176 use @samp{.o} as the suffix for object files.
177
178 @findex TARGET_EXECUTABLE_SUFFIX
179 @item TARGET_EXECUTABLE_SUFFIX
180 Define this macro to be a C string representing the suffix to be
181 automatically added to executable files on your target machine.  If you
182 do not define this macro, GCC will use the null string as the suffix for
183 executable files.
184
185 @findex HOST_OBJECT_SUFFIX
186 @item HOST_OBJECT_SUFFIX
187 Define this macro to be a C string representing the suffix for object
188 files on your host machine (@samp{xm-*.h}).  If you do not define this
189 macro, GCC will use @samp{.o} as the suffix for object files.
190
191 @findex HOST_EXECUTABLE_SUFFIX
192 @item HOST_EXECUTABLE_SUFFIX
193 Define this macro to be a C string representing the suffix for
194 executable files on your host machine (@samp{xm-*.h}).  If you do not
195 define this macro, GCC will use the null string as the suffix for
196 executable files.
197
198 @findex HOST_BIT_BUCKET
199 @item HOST_BIT_BUCKET
200 The name of a file or file-like object on the host system which acts as
201 a ``bit bucket''.  If you do not define this macro, GCC will use
202 @samp{/dev/null} as the bit bucket.  If the target does not support a
203 bit bucket, this should be defined to the null string, or some other
204 invalid filename.  If the bit bucket is not writable, GCC will use a
205 temporary file instead.
206
207 @findex COLLECT_EXPORT_LIST
208 @item COLLECT_EXPORT_LIST
209 If defined, @code{collect2} will scan the individual object files
210 specified on its command line and create an export list for the linker.
211 Define this macro for systems like AIX, where the linker discards
212 object files that are not referenced from @code{main} and uses export
213 lists.
214
215 @findex COLLECT2_HOST_INITIALIZATION
216 @item COLLECT2_HOST_INITIALIZATION
217 If defined, a C statement (sans semicolon) that performs host-dependent
218 initialization when @code{collect2} is being initialized.
219
220 @findex GCC_DRIVER_HOST_INITIALIZATION
221 @item GCC_DRIVER_HOST_INITIALIZATION
222 If defined, a C statement (sans semicolon) that performs host-dependent
223 initialization when a compilation driver is being initialized.
224
225 @findex UPDATE_PATH_HOST_CANONICALIZE
226 @item UPDATE_PATH_HOST_CANONICALIZE (@var{path})
227 If defined, a C statement (sans semicolon) that performs host-dependent
228 canonicalization when a path used in a compilation driver or
229 preprocessor is canonicalized.  @var{path} is a malloc-ed path to be
230 canonicalized.  If the C statement does canonicalize @var{path} into a
231 different buffer, the old path should be freed and the new buffer should
232 have been allocated with malloc.
233 @end table
234
235 @findex bzero
236 @findex bcmp
237 In addition, configuration files for system V define @code{bcopy},
238 @code{bzero} and @code{bcmp} as aliases.  Some files define @code{alloca}
239 as a macro when compiled with GCC, in order to take advantage of the
240 benefit of GCC's built-in @code{alloca}.