Makefile.in (stmp-docobjdir): New target; ensure $docobjdir exists.
[official-gcc.git] / gcc / doc / hostconfig.texi
blob626a893c167a78204ece3d1c7e4e5acf9cbb73e9
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gccint.texi.
6 @node Host Config
7 @chapter Host Configuration
8 @cindex host configuration
10 Most details about the machine and system on which the compiler is
11 actually running are detected by the @command{configure} script.  Some
12 things are impossible for @command{configure} to detect; these are
13 described in two ways, either by macros defined in a file named
14 @file{xm-@var{machine}.h} or by hook functions in the file specified
15 by the @var{out_host_hook_obj} variable in @file{config.gcc}.  (The
16 intention is that very few hosts will need a header file but nearly
17 every fully supported host will need to override some hooks.)
19 If you need to define only a few macros, and they have simple
20 definitions, consider using the @code{xm_defines} variable in your
21 @file{config.gcc} entry instead of creating a host configuration
22 header.  @xref{System Config}.
24 @menu
25 * Host Common::         Things every host probably needs implemented.
26 * Filesystem::          Your host can't have the letter `a' in filenames?
27 * Host Misc::           Rare configuration options for hosts.
28 @end menu
30 @node Host Common
31 @section Host Common
32 @cindex host hooks
33 @cindex host functions
35 Some things are just not portable, even between similar operating systems,
36 and are too difficult for autoconf to detect.  They get implemented using
37 hook functions in the file specified by the @var{host_hook_obj}
38 variable in @file{config.gcc}.
40 @deftypefn {Host Hook} void HOST_HOOKS_EXTRA_SIGNALS (void)
41 This host hook is used to set up handling for extra signals.  The most
42 common thing to do in this hook is to detect stack overflow.
43 @end deftypefn
45 @node Filesystem
46 @section Host Filesystem
47 @cindex configuration file
48 @cindex @file{xm-@var{machine}.h}
50 GCC needs to know a number of things about the semantics of the host
51 machine's filesystem.  Filesystems with Unix and MS-DOS semantics are
52 automatically detected.  For other systems, you can define the
53 following macros in @file{xm-@var{machine}.h}.
55 @ftable @code
56 @item HAVE_DOS_BASED_FILE_SYSTEM
57 This macro is automatically defined by @file{system.h} if the host
58 file system obeys the semantics defined by MS-DOS instead of Unix.
59 DOS file systems are case insensitive, file specifications may begin
60 with a drive letter, and both forward slash and backslash (@samp{/}
61 and @samp{\}) are directory separators.
63 @item DIR_SEPARATOR
64 @itemx DIR_SEPARATOR_2
65 If defined, these macros expand to character constants specifying
66 separators for directory names within a file specification.
67 @file{system.h} will automatically give them appropriate values on
68 Unix and MS-DOS file systems.  If your file system is neither of
69 these, define one or both appropriately in @file{xm-@var{machine}.h}.
71 However, operating systems like VMS, where constructing a pathname is
72 more complicated than just stringing together directory names
73 separated by a special character, should not define either of these
74 macros.
76 @item PATH_SEPARATOR
77 If defined, this macro should expand to a character constant
78 specifying the separator for elements of search paths.  The default
79 value is a colon (@samp{:}).  DOS-based systems usually, but not
80 always, use semicolon (@samp{;}).
82 @item VMS
83 Define this macro if the host system is VMS@.
85 @item HOST_OBJECT_SUFFIX
86 Define this macro to be a C string representing the suffix for object
87 files on your host machine.  If you do not define this macro, GCC will
88 use @samp{.o} as the suffix for object files.
90 @item HOST_EXECUTABLE_SUFFIX
91 Define this macro to be a C string representing the suffix for
92 executable files on your host machine.  If you do not define this macro,
93 GCC will use the null string as the suffix for executable files.
95 @item HOST_BIT_BUCKET
96 A pathname defined by the host operating system, which can be opened as
97 a file and written to, but all the information written is discarded.
98 This is commonly known as a @dfn{bit bucket} or @dfn{null device}.  If
99 you do not define this macro, GCC will use @samp{/dev/null} as the bit
100 bucket.  If the host does not support a bit bucket, define this macro to
101 an invalid filename.
103 @item UPDATE_PATH_HOST_CANONICALIZE (@var{path})
104 If defined, a C statement (sans semicolon) that performs host-dependent
105 canonicalization when a path used in a compilation driver or
106 preprocessor is canonicalized.  @var{path} is a malloc-ed path to be
107 canonicalized.  If the C statement does canonicalize @var{path} into a
108 different buffer, the old path should be freed and the new buffer should
109 have been allocated with malloc.
111 @item DUMPFILE_FORMAT
112 Define this macro to be a C string representing the format to use for
113 constructing the index part of debugging dump file names.  The resultant
114 string must fit in fifteen bytes.  The full filename will be the
115 concatenation of: the prefix of the assembler file name, the string
116 resulting from applying this format to an index number, and a string
117 unique to each dump file kind, e.g. @samp{rtl}.
119 If you do not define this macro, GCC will use @samp{.%02d.}.  You should
120 define this macro if using the default will create an invalid file name.
121 @end ftable
123 @node Host Misc
124 @section Host Misc
125 @cindex configuration file
126 @cindex @file{xm-@var{machine}.h}
128 @ftable @code
129 @item FATAL_EXIT_CODE
130 A C expression for the status code to be returned when the compiler
131 exits after serious errors.  The default is the system-provided macro
132 @samp{EXIT_FAILURE}, or @samp{1} if the system doesn't define that
133 macro.  Define this macro only if these defaults are incorrect.
135 @item SUCCESS_EXIT_CODE
136 A C expression for the status code to be returned when the compiler
137 exits without serious errors.  (Warnings are not serious errors.)  The
138 default is the system-provided macro @samp{EXIT_SUCCESS}, or @samp{0} if
139 the system doesn't define that macro.  Define this macro only if these
140 defaults are incorrect.
142 @item USE_C_ALLOCA
143 Define this macro if GCC should use the C implementation of @code{alloca}
144 provided by @file{libiberty.a}.  This only affects how some parts of the
145 compiler itself allocate memory.  It does not change code generation.
147 When GCC is built with a compiler other than itself, the C @code{alloca}
148 is always used.  This is because most other implementations have serious
149 bugs.  You should define this macro only on a system where no
150 stack-based @code{alloca} can possibly work.  For instance, if a system
151 has a small limit on the size of the stack, GCC's builtin @code{alloca}
152 will not work reliably.
154 @item COLLECT2_HOST_INITIALIZATION
155 If defined, a C statement (sans semicolon) that performs host-dependent
156 initialization when @code{collect2} is being initialized.
158 @item GCC_DRIVER_HOST_INITIALIZATION
159 If defined, a C statement (sans semicolon) that performs host-dependent
160 initialization when a compilation driver is being initialized.
162 @item SMALL_ARG_MAX
163 Define this macro if the host system has a small limit on the total
164 size of an argument vector.  This causes the driver to take more care
165 not to pass unnecessary arguments to subprocesses.
166 @end ftable
168 In addition, if @command{configure} generates an incorrect definition of
169 any of the macros in @file{auto-host.h}, you can override that
170 definition in a host configuration header.  If you need to do this,
171 first see if it is possible to fix @command{configure}.