1 | <html lang="en">
|
---|
2 | <head>
|
---|
3 | <title>Installing GCC: Configuration</title>
|
---|
4 | <meta http-equiv="Content-Type" content="text/html">
|
---|
5 | <meta name="description" content="Installing GCC: Configuration">
|
---|
6 | <meta name="generator" content="makeinfo 4.5">
|
---|
7 | <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
|
---|
8 | <!--
|
---|
9 | Copyright © 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
---|
10 | 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
---|
11 | <br><p>
|
---|
12 | <p>Permission is granted to copy, distribute and/or modify this document
|
---|
13 | under the terms of the GNU Free Documentation License, Version 1.2 or
|
---|
14 | any later version published by the Free Software Foundation; with no
|
---|
15 | Invariant Sections, the Front-Cover texts being (a) (see below), and
|
---|
16 | with the Back-Cover Texts being (b) (see below). A copy of the
|
---|
17 | license is included in the section entitled "<a href="./gfdl.html">GNU Free Documentation License</a>".
|
---|
18 |
|
---|
19 | <p>(a) The FSF's Front-Cover Text is:
|
---|
20 |
|
---|
21 | <p>A GNU Manual
|
---|
22 |
|
---|
23 | <p>(b) The FSF's Back-Cover Text is:
|
---|
24 |
|
---|
25 | <p>You have freedom to copy and modify this GNU Manual, like GNU
|
---|
26 | software. Copies published by the Free Software Foundation raise
|
---|
27 | funds for GNU development.-->
|
---|
28 | </head>
|
---|
29 | <body>
|
---|
30 | <h1 class="settitle">Installing GCC: Configuration</h1>
|
---|
31 | Like most GNU software, GCC must be configured before it can be built.
|
---|
32 | This document describes the recommended configuration procedure
|
---|
33 | for both native and cross targets.
|
---|
34 |
|
---|
35 | <p>We use <var>srcdir</var> to refer to the toplevel source directory for
|
---|
36 | GCC; we use <var>objdir</var> to refer to the toplevel build/object directory.
|
---|
37 |
|
---|
38 | <p>If you obtained the sources via CVS, <var>srcdir</var> must refer to the top
|
---|
39 | <code>gcc</code> directory, the one where the <code>MAINTAINERS</code> can be found,
|
---|
40 | and not its <code>gcc</code> subdirectory, otherwise the build will fail.
|
---|
41 |
|
---|
42 | <p>If either <var>srcdir</var> or <var>objdir</var> is located on an automounted NFS
|
---|
43 | file system, the shell's built-in <code>pwd</code> command will return
|
---|
44 | temporary pathnames. Using these can lead to various sorts of build
|
---|
45 | problems. To avoid this issue, set the <code>PWDCMD</code> environment
|
---|
46 | variable to an automounter-aware <code>pwd</code> command, e.g.,
|
---|
47 | <code>pawd</code> or <code>amq -w</code>, during the configuration and build
|
---|
48 | phases.
|
---|
49 |
|
---|
50 | <p>First, we <strong>highly</strong> recommend that GCC be built into a
|
---|
51 | separate directory than the sources which does <strong>not</strong> reside
|
---|
52 | within the source tree. This is how we generally build GCC; building
|
---|
53 | where <var>srcdir</var> == <var>objdir</var> should still work, but doesn't
|
---|
54 | get extensive testing; building where <var>objdir</var> is a subdirectory
|
---|
55 | of <var>srcdir</var> is unsupported.
|
---|
56 |
|
---|
57 | <p>If you have previously built GCC in the same directory for a
|
---|
58 | different target machine, do <code>make distclean</code> to delete all files
|
---|
59 | that might be invalid. One of the files this deletes is <code>Makefile</code>;
|
---|
60 | if <code>make distclean</code> complains that <code>Makefile</code> does not exist
|
---|
61 | or issues a message like "don't know how to make distclean" it probably
|
---|
62 | means that the directory is already suitably clean. However, with the
|
---|
63 | recommended method of building in a separate <var>objdir</var>, you should
|
---|
64 | simply use a different <var>objdir</var> for each target.
|
---|
65 |
|
---|
66 | <p>Second, when configuring a native system, either <code>cc</code> or
|
---|
67 | <code>gcc</code> must be in your path or you must set <code>CC</code> in
|
---|
68 | your environment before running configure. Otherwise the configuration
|
---|
69 | scripts may fail.
|
---|
70 |
|
---|
71 | <p>Note that the bootstrap compiler and the resulting GCC must be link
|
---|
72 | compatible, else the bootstrap will fail with linker errors about
|
---|
73 | incompatible object file formats. Several multilibed targets are
|
---|
74 | affected by this requirement, see
|
---|
75 | <a href="specific.html">host/target specific installation notes</a>.
|
---|
76 |
|
---|
77 | <p>To configure GCC:
|
---|
78 |
|
---|
79 | <pre class="example"> % mkdir <var>objdir</var>
|
---|
80 | % cd <var>objdir</var>
|
---|
81 | % <var>srcdir</var>/configure [<var>options</var>] [<var>target</var>]
|
---|
82 | </pre>
|
---|
83 |
|
---|
84 | <h3 class="heading"><a name="TOC0"></a>Target specification</h3>
|
---|
85 |
|
---|
86 | <ul>
|
---|
87 | <li>GCC has code to correctly determine the correct value for <var>target</var>
|
---|
88 | for nearly all native systems. Therefore, we highly recommend you not
|
---|
89 | provide a configure target when configuring a native compiler.
|
---|
90 |
|
---|
91 | <li><var>target</var> must be specified as <code>--target=</code><var>target</var><code></code>
|
---|
92 | when configuring a cross compiler; examples of valid targets would be
|
---|
93 | i960-rtems, m68k-coff, sh-elf, etc.
|
---|
94 |
|
---|
95 | <li>Specifying just <var>target</var> instead of <code>--target=</code><var>target</var><code></code>
|
---|
96 | implies that the host defaults to <var>target</var>.
|
---|
97 | </ul>
|
---|
98 |
|
---|
99 | <h3 class="heading"><a name="TOC1"></a>Options specification</h3>
|
---|
100 |
|
---|
101 | <p>Use <var>options</var> to override several configure time options for
|
---|
102 | GCC. A list of supported <var>options</var> follows; <code>configure
|
---|
103 | --help</code> may list other options, but those not listed below may not
|
---|
104 | work and should not normally be used.
|
---|
105 |
|
---|
106 | <dl>
|
---|
107 | <dt><code>--prefix=</code><var>dirname</var><code></code>
|
---|
108 | <dd>Specify the toplevel installation
|
---|
109 | directory. This is the recommended way to install the tools into a directory
|
---|
110 | other than the default. The toplevel installation directory defaults to
|
---|
111 | <code>/usr/local</code>.
|
---|
112 |
|
---|
113 | <p>We <strong>highly</strong> recommend against <var>dirname</var> being the same or a
|
---|
114 | subdirectory of <var>objdir</var> or vice versa. If specifying a directory
|
---|
115 | beneath a user's home directory tree, some shells will not expand
|
---|
116 | <var>dirname</var> correctly if it contains the <code>~</code> metacharacter; use
|
---|
117 | <code>$HOME</code> instead.
|
---|
118 |
|
---|
119 | <p>These additional options control where certain parts of the distribution
|
---|
120 | are installed. Normally you should not need to use these options.
|
---|
121 | <dl>
|
---|
122 | <dt><code>--exec-prefix=</code><var>dirname</var><code></code>
|
---|
123 | <dd>Specify the toplevel installation directory for architecture-dependent
|
---|
124 | files. The default is <code></code><var>prefix</var><code></code>.
|
---|
125 |
|
---|
126 | <br><dt><code>--bindir=</code><var>dirname</var><code></code>
|
---|
127 | <dd>Specify the installation directory for the executables called by users
|
---|
128 | (such as <code>gcc</code> and <code>g++</code>). The default is
|
---|
129 | <code></code><var>exec-prefix</var><code>/bin</code>.
|
---|
130 |
|
---|
131 | <br><dt><code>--libdir=</code><var>dirname</var><code></code>
|
---|
132 | <dd>Specify the installation directory for object code libraries and
|
---|
133 | internal parts of GCC. The default is <code></code><var>exec-prefix</var><code>/lib</code>.
|
---|
134 |
|
---|
135 | <br><dt><code>--with-slibdir=</code><var>dirname</var><code></code>
|
---|
136 | <dd>Specify the installation directory for the shared libgcc library. The
|
---|
137 | default is <code></code><var>libdir</var><code></code>.
|
---|
138 |
|
---|
139 | <br><dt><code>--infodir=</code><var>dirname</var><code></code>
|
---|
140 | <dd>Specify the installation directory for documentation in info format.
|
---|
141 | The default is <code></code><var>prefix</var><code>/info</code>.
|
---|
142 |
|
---|
143 | <br><dt><code>--datadir=</code><var>dirname</var><code></code>
|
---|
144 | <dd>Specify the installation directory for some architecture-independent
|
---|
145 | data files referenced by GCC. The default is <code></code><var>prefix</var><code>/share</code>.
|
---|
146 |
|
---|
147 | <br><dt><code>--mandir=</code><var>dirname</var><code></code>
|
---|
148 | <dd>Specify the installation directory for manual pages. The default is
|
---|
149 | <code></code><var>prefix</var><code>/man</code>. (Note that the manual pages are only extracts from
|
---|
150 | the full GCC manuals, which are provided in Texinfo format. The manpages
|
---|
151 | are derived by an automatic conversion process from parts of the full
|
---|
152 | manual.)
|
---|
153 |
|
---|
154 | <br><dt><code>--with-gxx-include-dir=</code><var>dirname</var><code></code>
|
---|
155 | <dd>Specify
|
---|
156 | the installation directory for G++ header files. The default is
|
---|
157 | <code></code><var>prefix</var><code>/include/g++-v3</code>.
|
---|
158 |
|
---|
159 | </dl>
|
---|
160 |
|
---|
161 | <br><dt><code>--program-prefix=</code><var>prefix</var><code></code>
|
---|
162 | <dd>GCC supports some transformations of the names of its programs when
|
---|
163 | installing them. This option prepends <var>prefix</var> to the names of
|
---|
164 | programs to install in <var>bindir</var> (see above). For example, specifying
|
---|
165 | <code>--program-prefix=foo-</code> would result in <code>gcc</code>
|
---|
166 | being installed as <code>/usr/local/bin/foo-gcc</code>.
|
---|
167 |
|
---|
168 | <br><dt><code>--program-suffix=</code><var>suffix</var><code></code>
|
---|
169 | <dd>Appends <var>suffix</var> to the names of programs to install in <var>bindir</var>
|
---|
170 | (see above). For example, specifying <code>--program-suffix=-3.1</code>
|
---|
171 | would result in <code>gcc</code> being installed as
|
---|
172 | <code>/usr/local/bin/gcc-3.1</code>.
|
---|
173 |
|
---|
174 | <br><dt><code>--program-transform-name=</code><var>pattern</var><code></code>
|
---|
175 | <dd>Applies the <code>sed</code> script <var>pattern</var> to be applied to the names
|
---|
176 | of programs to install in <var>bindir</var> (see above). <var>pattern</var> has to
|
---|
177 | consist of one or more basic <code>sed</code> editing commands, separated by
|
---|
178 | semicolons. For example, if you want the <code>gcc</code> program name to be
|
---|
179 | transformed to the installed program <code>/usr/local/bin/myowngcc</code> and
|
---|
180 | the <code>g++</code> program name to be transformed to
|
---|
181 | <code>/usr/local/bin/gspecial++</code> without changing other program names,
|
---|
182 | you could use the pattern
|
---|
183 | <code>--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/'</code>
|
---|
184 | to achieve this effect.
|
---|
185 |
|
---|
186 | <p>All three options can be combined and used together, resulting in more
|
---|
187 | complex conversion patterns. As a basic rule, <var>prefix</var> (and
|
---|
188 | <var>suffix</var>) are prepended (appended) before further transformations
|
---|
189 | can happen with a special transformation script <var>pattern</var>.
|
---|
190 |
|
---|
191 | <p>As currently implemented, this option only takes effect for native
|
---|
192 | builds; cross compiler binaries' names are not transformed even when a
|
---|
193 | transformation is explicitly asked for by one of these options.
|
---|
194 |
|
---|
195 | <p>For native builds, some of the installed programs are also installed
|
---|
196 | with the target alias in front of their name, as in
|
---|
197 | <code>i686-pc-linux-gnu-gcc</code>. All of the above transformations happen
|
---|
198 | before the target alias is prepended to the name - so, specifying
|
---|
199 | <code>--program-prefix=foo-</code> and <code>program-suffix=-3.1</code>, the
|
---|
200 | resulting binary would be installed as
|
---|
201 | <code>/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1</code>.
|
---|
202 |
|
---|
203 | <p>As a last shortcoming, none of the installed Ada programs are
|
---|
204 | transformed yet, which will be fixed in some time.
|
---|
205 |
|
---|
206 | <br><dt><code>--with-local-prefix=</code><var>dirname</var><code></code>
|
---|
207 | <dd>Specify the
|
---|
208 | installation directory for local include files. The default is
|
---|
209 | <code>/usr/local</code>. Specify this option if you want the compiler to
|
---|
210 | search directory <code></code><var>dirname</var><code>/include</code> for locally installed
|
---|
211 | header files <em>instead</em> of <code>/usr/local/include</code>.
|
---|
212 |
|
---|
213 | <p>You should specify <code>--with-local-prefix</code> <strong>only</strong> if your
|
---|
214 | site has a different convention (not <code>/usr/local</code>) for where to put
|
---|
215 | site-specific files.
|
---|
216 |
|
---|
217 | <p>The default value for <code>--with-local-prefix</code> is <code>/usr/local</code>
|
---|
218 | regardless of the value of <code>--prefix</code>. Specifying
|
---|
219 | <code>--prefix</code> has no effect on which directory GCC searches for
|
---|
220 | local header files. This may seem counterintuitive, but actually it is
|
---|
221 | logical.
|
---|
222 |
|
---|
223 | <p>The purpose of <code>--prefix</code> is to specify where to <em>install
|
---|
224 | GCC</em>. The local header files in <code>/usr/local/include</code>--if you put
|
---|
225 | any in that directory--are not part of GCC. They are part of other
|
---|
226 | programs--perhaps many others. (GCC installs its own header files in
|
---|
227 | another directory which is based on the <code>--prefix</code> value.)
|
---|
228 |
|
---|
229 | <p>Both the local-prefix include directory and the GCC-prefix include
|
---|
230 | directory are part of GCC's "system include" directories. Although these
|
---|
231 | two directories are not fixed, they need to be searched in the proper
|
---|
232 | order for the correct processing of the include_next directive. The
|
---|
233 | local-prefix include directory is searched before the GCC-prefix
|
---|
234 | include directory. Another characteristic of system include directories
|
---|
235 | is that pedantic warnings are turned off for headers in these directories.
|
---|
236 |
|
---|
237 | <p>Some autoconf macros add <code>-I </code><var>directory</var><code></code> options to the
|
---|
238 | compiler command line, to ensure that directories containing installed
|
---|
239 | packages' headers are searched. When <var>directory</var> is one of GCC's
|
---|
240 | system include directories, GCC will ignore the option so that system
|
---|
241 | directories continue to be processed in the correct order. This
|
---|
242 | may result in a search order different from what was specified but the
|
---|
243 | directory will still be searched.
|
---|
244 |
|
---|
245 | <p>GCC automatically searches for ordinary libraries using
|
---|
246 | <code>GCC_EXEC_PREFIX</code>. Thus, when the same installation prefix is
|
---|
247 | used for both GCC and packages, GCC will automatically search for
|
---|
248 | both headers and libraries. This provides a configuration that is
|
---|
249 | easy to use. GCC behaves in a manner similar to that when it is
|
---|
250 | installed as a system compiler in <code>/usr</code>.
|
---|
251 |
|
---|
252 | <p>Sites that need to install multiple versions of GCC may not want to
|
---|
253 | use the above simple configuration. It is possible to use the
|
---|
254 | <code>--program-prefix</code>, <code>--program-suffix</code> and
|
---|
255 | <code>--program-transform-name</code> options to install multiple versions
|
---|
256 | into a single directory, but it may be simpler to use different prefixes
|
---|
257 | and the <code>--with-local-prefix</code> option to specify the location of the
|
---|
258 | site-specific files for each version. It will then be necessary for
|
---|
259 | users to specify explicitly the location of local site libraries
|
---|
260 | (e.g., with <code>LIBRARY_PATH</code>).
|
---|
261 |
|
---|
262 | <p>The same value can be used for both <code>--with-local-prefix</code> and
|
---|
263 | <code>--prefix</code> provided it is not <code>/usr</code>. This can be used
|
---|
264 | to avoid the default search of <code>/usr/local/include</code>.
|
---|
265 |
|
---|
266 | <p><strong>Do not</strong> specify <code>/usr</code> as the <code>--with-local-prefix</code>!
|
---|
267 | The directory you use for <code>--with-local-prefix</code> <strong>must not</strong>
|
---|
268 | contain any of the system's standard header files. If it did contain
|
---|
269 | them, certain programs would be miscompiled (including GNU Emacs, on
|
---|
270 | certain targets), because this would override and nullify the header
|
---|
271 | file corrections made by the <code>fixincludes</code> script.
|
---|
272 |
|
---|
273 | <p>Indications are that people who use this option use it based on mistaken
|
---|
274 | ideas of what it is for. People use it as if it specified where to
|
---|
275 | install part of GCC. Perhaps they make this assumption because
|
---|
276 | installing GCC creates the directory.
|
---|
277 |
|
---|
278 | <br><dt><code>--enable-shared[=</code><var>package</var><code>[,...]]</code>
|
---|
279 | <dd>Build shared versions of libraries, if shared libraries are supported on
|
---|
280 | the target platform. Unlike GCC 2.95.x and earlier, shared libraries
|
---|
281 | are enabled by default on all platforms that support shared libraries,
|
---|
282 | except for <code>libobjc</code> which is built as a static library only by
|
---|
283 | default.
|
---|
284 |
|
---|
285 | <p>If a list of packages is given as an argument, build shared libraries
|
---|
286 | only for the listed packages. For other packages, only static libraries
|
---|
287 | will be built. Package names currently recognized in the GCC tree are
|
---|
288 | <code>libgcc</code> (also known as <code>gcc</code>), <code>libstdc++</code> (not
|
---|
289 | <code>libstdc++-v3</code>), <code>libffi</code>, <code>zlib</code>, <code>boehm-gc</code> and
|
---|
290 | <code>libjava</code>. Note that <code>libobjc</code> does not recognize itself by
|
---|
291 | any name, so, if you list package names in <code>--enable-shared</code>,
|
---|
292 | you will only get static Objective-C libraries. <code>libf2c</code> and
|
---|
293 | <code>libiberty</code> do not support shared libraries at all.
|
---|
294 |
|
---|
295 | <p>Use <code>--disable-shared</code> to build only static libraries. Note that
|
---|
296 | <code>--disable-shared</code> does not accept a list of package names as
|
---|
297 | argument, only <code>--enable-shared</code> does.
|
---|
298 |
|
---|
299 | <br><dt><code><a name="with-gnu-as"></a>--with-gnu-as</code>
|
---|
300 | <dd>Specify that the compiler should assume that the
|
---|
301 | assembler it finds is the GNU assembler. However, this does not modify
|
---|
302 | the rules to find an assembler and will result in confusion if the
|
---|
303 | assembler found is not actually the GNU assembler. (Confusion may also
|
---|
304 | result if the compiler finds the GNU assembler but has not been
|
---|
305 | configured with <code>--with-gnu-as</code>.) If you have more than one
|
---|
306 | assembler installed on your system, you may want to use this option in
|
---|
307 | connection with <code>--with-as=</code><var>pathname</var><code></code>.
|
---|
308 |
|
---|
309 | <p>The following systems are the only ones where it makes a difference
|
---|
310 | whether you use the GNU assembler. On any other system,
|
---|
311 | <code>--with-gnu-as</code> has no effect.
|
---|
312 |
|
---|
313 | <ul>
|
---|
314 | <li><code>hppa1.0-</code><var>any</var><code>-</code><var>any</var><code></code>
|
---|
315 | <li><code>hppa1.1-</code><var>any</var><code>-</code><var>any</var><code></code>
|
---|
316 | <li><code>i386-</code><var>any</var><code>-sysv</code>
|
---|
317 | <li><code>m68k-bull-sysv</code>
|
---|
318 | <li><code>m68k-hp-hpux</code>
|
---|
319 | <li><code>m68000-hp-hpux</code>
|
---|
320 | <li><code>m68000-att-sysv</code>
|
---|
321 | <li><code></code><var>any</var><code>-lynx-lynxos</code>
|
---|
322 | <li><code>mips-</code><var>any</var><code></code>
|
---|
323 | <li><code>sparc-sun-solaris2.</code><var>any</var><code></code>
|
---|
324 | <li><code>sparc64-</code><var>any</var><code>-solaris2.</code><var>any</var><code></code>
|
---|
325 | </ul>
|
---|
326 |
|
---|
327 | <p>On the systems listed above (except for the HP-PA, the SPARC, for ISC on
|
---|
328 | the 386, and for <code>mips-sgi-irix5.*</code>), if you use the GNU assembler,
|
---|
329 | you should also use the GNU linker (and specify <code>--with-gnu-ld</code>).
|
---|
330 |
|
---|
331 | <br><dt><code><a name="with-as"></a>--with-as=</code><var>pathname</var><code></code>
|
---|
332 | <dd>Specify that the
|
---|
333 | compiler should use the assembler pointed to by <var>pathname</var>, rather
|
---|
334 | than the one found by the standard rules to find an assembler, which
|
---|
335 | are:
|
---|
336 | <ul>
|
---|
337 | <li>Check the
|
---|
338 | <code></code><var>exec_prefix</var><code>/lib/gcc-lib/</code><var>target</var><code>/</code><var>version</var><code></code>
|
---|
339 | directory, where <var>exec_prefix</var> defaults to <var>prefix</var> which
|
---|
340 | defaults to <code>/usr/local</code> unless overridden by the
|
---|
341 | <code>--prefix=</code><var>pathname</var><code></code> switch described above. <var>target</var> is the
|
---|
342 | target system triple, such as <code>sparc-sun-solaris2.7</code>, and
|
---|
343 | <var>version</var> denotes the GCC version, such as 3.0.
|
---|
344 | <li>Check operating system specific directories (e.g. <code>/usr/ccs/bin</code> on
|
---|
345 | Sun Solaris 2).
|
---|
346 | </ul>
|
---|
347 | Note that these rules do not check for the value of <code>PATH</code>. You may
|
---|
348 | want to use <code>--with-as</code> if no assembler is installed in the
|
---|
349 | directories listed above, or if you have multiple assemblers installed
|
---|
350 | and want to choose one that is not found by the above rules.
|
---|
351 |
|
---|
352 | <br><dt><code><a name="with-gnu-ld"></a>--with-gnu-ld</code>
|
---|
353 | <dd>Same as <a href="#with-gnu-as"><code>--with-gnu-as</code></a>
|
---|
354 | but for the linker.
|
---|
355 |
|
---|
356 | <br><dt><code>--with-ld=</code><var>pathname</var><code></code>
|
---|
357 | <dd>Same as <a href="#with-as"><code>--with-as</code></a>
|
---|
358 | but for the linker.
|
---|
359 |
|
---|
360 | <br><dt><code>--with-stabs</code>
|
---|
361 | <dd>Specify that stabs debugging
|
---|
362 | information should be used instead of whatever format the host normally
|
---|
363 | uses. Normally GCC uses the same debug format as the host system.
|
---|
364 |
|
---|
365 | <p>On MIPS based systems and on Alphas, you must specify whether you want
|
---|
366 | GCC to create the normal ECOFF debugging format, or to use BSD-style
|
---|
367 | stabs passed through the ECOFF symbol table. The normal ECOFF debug
|
---|
368 | format cannot fully handle languages other than C. BSD stabs format can
|
---|
369 | handle other languages, but it only works with the GNU debugger GDB.
|
---|
370 |
|
---|
371 | <p>Normally, GCC uses the ECOFF debugging format by default; if you
|
---|
372 | prefer BSD stabs, specify <code>--with-stabs</code> when you configure GCC.
|
---|
373 |
|
---|
374 | <p>No matter which default you choose when you configure GCC, the user
|
---|
375 | can use the <code>-gcoff</code> and <code>-gstabs+</code> options to specify explicitly
|
---|
376 | the debug format for a particular compilation.
|
---|
377 |
|
---|
378 | <p><code>--with-stabs</code> is meaningful on the ISC system on the 386, also, if
|
---|
379 | <code>--with-gas</code> is used. It selects use of stabs debugging
|
---|
380 | information embedded in COFF output. This kind of debugging information
|
---|
381 | supports C++ well; ordinary COFF debugging information does not.
|
---|
382 |
|
---|
383 | <p><code>--with-stabs</code> is also meaningful on 386 systems running SVR4. It
|
---|
384 | selects use of stabs debugging information embedded in ELF output. The
|
---|
385 | C++ compiler currently (2.6.0) does not support the DWARF debugging
|
---|
386 | information normally used on 386 SVR4 platforms; stabs provide a
|
---|
387 | workable alternative. This requires gas and gdb, as the normal SVR4
|
---|
388 | tools can not generate or interpret stabs.
|
---|
389 |
|
---|
390 | <br><dt><code>--disable-multilib</code>
|
---|
391 | <dd>Specify that multiple target
|
---|
392 | libraries to support different target variants, calling
|
---|
393 | conventions, etc should not be built. The default is to build a
|
---|
394 | predefined set of them.
|
---|
395 |
|
---|
396 | <p>Some targets provide finer-grained control over which multilibs are built
|
---|
397 | (e.g., <code>--disable-softfloat</code>):
|
---|
398 | <dl>
|
---|
399 | <dt><code>arc-*-elf*</code>
|
---|
400 | <dd>biendian.
|
---|
401 |
|
---|
402 | <br><dt><code>arm-*-*</code>
|
---|
403 | <dd>fpu, 26bit, underscore, interwork, biendian, nofmult.
|
---|
404 |
|
---|
405 | <br><dt><code>m68*-*-*</code>
|
---|
406 | <dd>softfloat, m68881, m68000, m68020.
|
---|
407 |
|
---|
408 | <br><dt><code>mips*-*-*</code>
|
---|
409 | <dd>single-float, biendian, softfloat.
|
---|
410 |
|
---|
411 | <br><dt><code>powerpc*-*-*, rs6000*-*-*</code>
|
---|
412 | <dd>aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian,
|
---|
413 | sysv, aix.
|
---|
414 |
|
---|
415 | </dl>
|
---|
416 |
|
---|
417 | <br><dt><code>--enable-threads</code>
|
---|
418 | <dd>Specify that the target
|
---|
419 | supports threads. This affects the Objective-C compiler and runtime
|
---|
420 | library, and exception handling for other languages like C++ and Java.
|
---|
421 | On some systems, this is the default.
|
---|
422 |
|
---|
423 | <p>In general, the best (and, in many cases, the only known) threading
|
---|
424 | model available will be configured for use. Beware that on some
|
---|
425 | systems, gcc has not been taught what threading models are generally
|
---|
426 | available for the system. In this case, <code>--enable-threads</code> is an
|
---|
427 | alias for <code>--enable-threads=single</code>.
|
---|
428 |
|
---|
429 | <br><dt><code>--disable-threads</code>
|
---|
430 | <dd>Specify that threading support should be disabled for the system.
|
---|
431 | This is an alias for <code>--enable-threads=single</code>.
|
---|
432 |
|
---|
433 | <br><dt><code>--enable-threads=</code><var>lib</var><code></code>
|
---|
434 | <dd>Specify that
|
---|
435 | <var>lib</var> is the thread support library. This affects the Objective-C
|
---|
436 | compiler and runtime library, and exception handling for other languages
|
---|
437 | like C++ and Java. The possibilities for <var>lib</var> are:
|
---|
438 |
|
---|
439 | <dl>
|
---|
440 | <dt><code>aix</code>
|
---|
441 | <dd>AIX thread support.
|
---|
442 | <br><dt><code>dce</code>
|
---|
443 | <dd>DCE thread support.
|
---|
444 | <br><dt><code>mach</code>
|
---|
445 | <dd>Generic MACH thread support, known to work on NeXTSTEP. (Please note
|
---|
446 | that the file needed to support this configuration, <code>gthr-mach.h</code>, is
|
---|
447 | missing and thus this setting will cause a known bootstrap failure.)
|
---|
448 | <br><dt><code>no</code>
|
---|
449 | <dd>This is an alias for <code>single</code>.
|
---|
450 | <br><dt><code>posix</code>
|
---|
451 | <dd>Generic POSIX thread support.
|
---|
452 | <br><dt><code>pthreads</code>
|
---|
453 | <dd>Same as <code>posix</code> on arm*-*-linux*, *-*-chorusos* and *-*-freebsd*
|
---|
454 | only. A future release of gcc might remove this alias or extend it
|
---|
455 | to all platforms.
|
---|
456 | <br><dt><code>rtems</code>
|
---|
457 | <dd>RTEMS thread support.
|
---|
458 | <br><dt><code>single</code>
|
---|
459 | <dd>Disable thread support, should work for all platforms.
|
---|
460 | <br><dt><code>solaris</code>
|
---|
461 | <dd>Sun Solaris 2 thread support.
|
---|
462 | <br><dt><code>vxworks</code>
|
---|
463 | <dd>VxWorks thread support.
|
---|
464 | <br><dt><code>win32</code>
|
---|
465 | <dd>Microsoft Win32 API thread support.
|
---|
466 | </dl>
|
---|
467 |
|
---|
468 | <br><dt><code>--with-cpu=</code><var>cpu</var><code></code>
|
---|
469 | <dd>Specify which cpu variant the
|
---|
470 | compiler should generate code for by default. This is currently
|
---|
471 | only supported on some ports, specifically arm, powerpc, and
|
---|
472 | SPARC. If configure does not recognize the model name (e.g. arm700,
|
---|
473 | 603e, or ultrasparc) you provide, please check the
|
---|
474 | <code>gcc/config.gcc</code> script for a complete list of supported models.
|
---|
475 |
|
---|
476 | <br><dt><code>--enable-altivec</code>
|
---|
477 | <dd>Specify that the target supports AltiVec vector enhancements. This
|
---|
478 | option will adjust the ABI for AltiVec enhancements, as well as generate
|
---|
479 | AltiVec code when appropriate. This option is only available for
|
---|
480 | PowerPC systems.
|
---|
481 |
|
---|
482 | <br><dt><code>--enable-target-optspace</code>
|
---|
483 | <dd>Specify that target
|
---|
484 | libraries should be optimized for code space instead of code speed.
|
---|
485 | This is the default for the m32r platform.
|
---|
486 |
|
---|
487 | <br><dt><code>--disable-cpp</code>
|
---|
488 | <dd>Specify that a user visible <code>cpp</code> program should not be installed.
|
---|
489 |
|
---|
490 | <br><dt><code>--with-cpp-install-dir=</code><var>dirname</var><code></code>
|
---|
491 | <dd>Specify that the user visible <code>cpp</code> program should be installed
|
---|
492 | in <code></code><var>prefix</var><code>/</code><var>dirname</var><code>/cpp</code>, in addition to <var>bindir</var>.
|
---|
493 |
|
---|
494 | <br><dt><code>--enable-initfini-array</code>
|
---|
495 | <dd>Force the use of sections <code>.init_array</code> and <code>.fini_array</code>
|
---|
496 | (instead of <code>.init</code> and <code>.fini</code>) for constructors and
|
---|
497 | destructors. Option <code>--disable-initfini-array</code> has the
|
---|
498 | opposite effect. If neither option is specified, the configure script
|
---|
499 | will try to guess whether the <code>.init_array</code> and
|
---|
500 | <code>.fini_array</code> sections are supported and, if they are, use them.
|
---|
501 |
|
---|
502 | <br><dt><code>--enable-maintainer-mode</code>
|
---|
503 | <dd>The build rules that
|
---|
504 | regenerate the GCC master message catalog <code>gcc.pot</code> are normally
|
---|
505 | disabled. This is because it can only be rebuilt if the complete source
|
---|
506 | tree is present. If you have changed the sources and want to rebuild the
|
---|
507 | catalog, configuring with <code>--enable-maintainer-mode</code> will enable
|
---|
508 | this. Note that you need a recent version of the <code>gettext</code> tools
|
---|
509 | to do so.
|
---|
510 |
|
---|
511 | <br><dt><code>--enable-version-specific-runtime-libs</code>
|
---|
512 | <dd>Specify
|
---|
513 | that runtime libraries should be installed in the compiler specific
|
---|
514 | subdirectory (<code></code><var>libsubdir</var><code></code>) rather than the usual places. In
|
---|
515 | addition, <code>libstdc++</code>'s include files will be installed in
|
---|
516 | <code></code><var>libsubdir</var><code>/include/g++</code> unless you overruled it by using
|
---|
517 | <code>--with-gxx-include-dir=</code><var>dirname</var><code></code>. Using this option is
|
---|
518 | particularly useful if you intend to use several versions of GCC in
|
---|
519 | parallel. This is currently supported by <code>libf2c</code> and
|
---|
520 | <code>libstdc++</code>, and is the default for <code>libobjc</code> which cannot be
|
---|
521 | changed in this case.
|
---|
522 |
|
---|
523 | <br><dt><code>--enable-languages=</code><var>lang1</var><code>,</code><var>lang2</var><code>,...</code>
|
---|
524 | <dd>Specify that only a particular subset of compilers and
|
---|
525 | their runtime libraries should be built. For a list of valid values for
|
---|
526 | <var>langN</var> you can issue the following command in the
|
---|
527 | <code>gcc</code> directory of your GCC source tree:<br>
|
---|
528 | <pre class="example"> grep language= */config-lang.in
|
---|
529 | </pre>
|
---|
530 | Currently, you can use any of the following:
|
---|
531 | <code>ada</code>, <code>c</code>, <code>c++</code>, <code>f77</code>, <code>java</code>, <code>objc</code>.
|
---|
532 | Building the Ada compiler has special requirements, see below.<br>
|
---|
533 | If you do not pass this flag, all languages available in the <code>gcc</code>
|
---|
534 | sub-tree will be configured. Re-defining <code>LANGUAGES</code> when calling
|
---|
535 | <code>make bootstrap</code> <strong>does not</strong> work anymore, as those
|
---|
536 | language sub-directories might not have been configured!
|
---|
537 |
|
---|
538 | <br><dt><code>--disable-libgcj</code>
|
---|
539 | <dd>Specify that the run-time libraries
|
---|
540 | used by GCJ should not be built. This is useful in case you intend
|
---|
541 | to use GCJ with some other run-time, or you're going to install it
|
---|
542 | separately, or it just happens not to build on your particular
|
---|
543 | machine. In general, if the Java front end is enabled, the GCJ
|
---|
544 | libraries will be enabled too, unless they're known to not work on
|
---|
545 | the target platform. If GCJ is enabled but <code>libgcj</code> isn't built, you
|
---|
546 | may need to port it; in this case, before modifying the top-level
|
---|
547 | <code>configure.in</code> so that <code>libgcj</code> is enabled by default on this platform,
|
---|
548 | you may use <code>--enable-libgcj</code> to override the default.
|
---|
549 |
|
---|
550 | <br><dt><code>--with-dwarf2</code>
|
---|
551 | <dd>Specify that the compiler should
|
---|
552 | use DWARF 2 debugging information as the default.
|
---|
553 |
|
---|
554 | <br><dt><code>--enable-win32-registry</code>
|
---|
555 | <dd><dt><code>--enable-win32-registry=</code><var>key</var><code></code>
|
---|
556 | <dd><dt><code>--disable-win32-registry</code>
|
---|
557 | <dd>The <code>--enable-win32-registry</code> option enables Windows-hosted GCC
|
---|
558 | to look up installations paths in the registry using the following key:
|
---|
559 |
|
---|
560 | <pre class="smallexample"> <code>HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\</code><var>key</var><code></code>
|
---|
561 | </pre>
|
---|
562 |
|
---|
563 | <p><var>key</var> defaults to GCC version number, and can be overridden by the
|
---|
564 | <code>--enable-win32-registry=</code><var>key</var><code></code> option. Vendors and distributors
|
---|
565 | who use custom installers are encouraged to provide a different key,
|
---|
566 | perhaps one comprised of vendor name and GCC version number, to
|
---|
567 | avoid conflict with existing installations. This feature is enabled
|
---|
568 | by default, and can be disabled by <code>--disable-win32-registry</code>
|
---|
569 | option. This option has no effect on the other hosts.
|
---|
570 |
|
---|
571 | <br><dt><code>--nfp</code>
|
---|
572 | <dd>Specify that the machine does not have a floating point unit. This
|
---|
573 | option only applies to <code>m68k-sun-sunos</code><var>n</var><code></code>. On any other
|
---|
574 | system, <code>--nfp</code> has no effect.
|
---|
575 |
|
---|
576 | <br><dt><code>--enable-checking</code>
|
---|
577 | <dd><dt><code>--enable-checking=</code><var>list</var><code></code>
|
---|
578 | <dd>When you specify this option, the compiler is built to perform checking
|
---|
579 | of tree node types when referencing fields of that node, and some other
|
---|
580 | internal consistency checks. This does not change the generated code,
|
---|
581 | but adds error checking within the compiler. This will slow down the
|
---|
582 | compiler and may only work properly if you are building the compiler
|
---|
583 | with GCC. This is on by default when building from CVS or snapshots,
|
---|
584 | but off for releases. More control over the checks may be had by
|
---|
585 | specifying <var>list</var>; the categories of checks available are
|
---|
586 | <code>misc</code>, <code>tree</code>, <code>gc</code>, <code>rtl</code>, <code>rtlflag</code>,
|
---|
587 | <code>gcac</code> and <code>valgrind</code>. The check <code>valgrind</code> requires the
|
---|
588 | external <code>valgrind</code> simulator, available from
|
---|
589 | <a href="http://developer.kde.org/~sewardj/">http://developer.kde.org/~sewardj/</a>. The default when <var>list</var> is
|
---|
590 | not specified is <code>misc,tree,gc,rtlflag</code>; the checks <code>rtl</code>,
|
---|
591 | <code>gcac</code> and <code>valgrind</code> are very expensive.
|
---|
592 |
|
---|
593 | <br><dt><code>--enable-coverage</code>
|
---|
594 | <dd><dt><code>--enable-coverage=</code><var>level</var><code></code>
|
---|
595 | <dd>With this option, the compiler is built to collect self coverage
|
---|
596 | information, every time it is run. This is for internal development
|
---|
597 | purposes, and only works when the compiler is being built with gcc. The
|
---|
598 | <var>level</var> argument controls whether the compiler is built optimized or
|
---|
599 | not, values are <code>opt</code> and <code>noopt</code>. For coverage analysis you
|
---|
600 | want to disable optimization, for performance analysis you want to
|
---|
601 | enable optimization. When coverage is enabled, the default level is
|
---|
602 | without optimization.
|
---|
603 |
|
---|
604 | <br><dt><code>--enable-nls</code>
|
---|
605 | <dd><dt><code>--disable-nls</code>
|
---|
606 | <dd>The <code>--enable-nls</code> option enables Native Language Support (NLS),
|
---|
607 | which lets GCC output diagnostics in languages other than American
|
---|
608 | English. Native Language Support is enabled by default if not doing a
|
---|
609 | canadian cross build. The <code>--disable-nls</code> option disables NLS.
|
---|
610 |
|
---|
611 | <br><dt><code>--with-included-gettext</code>
|
---|
612 | <dd>If NLS is enabled, the <code>--with-included-gettext</code> option causes the build
|
---|
613 | procedure to prefer its copy of GNU <code>gettext</code>.
|
---|
614 |
|
---|
615 | <br><dt><code>--with-catgets</code>
|
---|
616 | <dd>If NLS is enabled, and if the host lacks <code>gettext</code> but has the
|
---|
617 | inferior <code>catgets</code> interface, the GCC build procedure normally
|
---|
618 | ignores <code>catgets</code> and instead uses GCC's copy of the GNU
|
---|
619 | <code>gettext</code> library. The <code>--with-catgets</code> option causes the
|
---|
620 | build procedure to use the host's <code>catgets</code> in this situation.
|
---|
621 |
|
---|
622 | <br><dt><code>--with-libiconv-prefix=</code><var>dir</var><code></code>
|
---|
623 | <dd>Search for libiconv header files in <code></code><var>dir</var><code>/include</code> and
|
---|
624 | libiconv library files in <code></code><var>dir</var><code>/lib</code>.
|
---|
625 |
|
---|
626 | <br><dt><code>--with-system-zlib</code>
|
---|
627 | <dd>Use installed zlib rather than that included with GCC. This option
|
---|
628 | only applies if the Java front end is being built.
|
---|
629 |
|
---|
630 | <br><dt><code>--enable-obsolete</code>
|
---|
631 | <dd>Enable configuration for an obsoleted system. If you attempt to
|
---|
632 | configure GCC for a system (build, host, or target) which has been
|
---|
633 | obsoleted, and you do not specify this flag, configure will halt with an
|
---|
634 | error message.
|
---|
635 |
|
---|
636 | <p>All support for systems which have been obsoleted in one release of GCC
|
---|
637 | is removed entirely in the next major release, unless someone steps
|
---|
638 | forward to maintain the port.
|
---|
639 | </dl>
|
---|
640 |
|
---|
641 | <p>Some options which only apply to building cross compilers:
|
---|
642 | <dl>
|
---|
643 | <dt><code>--with-sysroot</code>
|
---|
644 | <dd><dt><code>--with-sysroot=</code><var>dir</var><code></code>
|
---|
645 | <dd>Tells GCC to consider <var>dir</var> as the root of a tree that contains a
|
---|
646 | (subset of) the root filesystem of the target operating system.
|
---|
647 | Target system headers, libraries and run-time object files will be
|
---|
648 | searched in there. The specified directory is not copied into the
|
---|
649 | install tree, unlike the options <code>--with-headers</code> and
|
---|
650 | <code>--with-libs</code> that this option obsoletes. The default value,
|
---|
651 | in case <code>--with-sysroot</code> is not given an argument, is
|
---|
652 | <code>${gcc_tooldir}/sys-root</code>. If the specified directory is a
|
---|
653 | subdirectory of <code>${exec_prefix}</code>, then it will be found relative to
|
---|
654 | the GCC binaries if the installation tree is moved.
|
---|
655 |
|
---|
656 | <br><dt><code>--with-headers</code>
|
---|
657 | <dd><dt><code>--with-headers=</code><var>dir</var><code></code>
|
---|
658 | <dd>Deprecated in favor of <code>--with-sysroot</code>.
|
---|
659 | Specifies that target headers are available when building a cross compiler.
|
---|
660 | The <var>dir</var> argument specifies a directory which has the target include
|
---|
661 | files. These include files will be copied into the <code>gcc</code> install
|
---|
662 | directory. <em>This option with the </em><var>dir</var><em> argument is required</em> when
|
---|
663 | building a cross compiler, if <code></code><var>prefix</var><code>/</code><var>target</var><code>/sys-include</code>
|
---|
664 | doesn't pre-exist. If <code></code><var>prefix</var><code>/</code><var>target</var><code>/sys-include</code> does
|
---|
665 | pre-exist, the <var>dir</var> argument may be omitted. <code>fixincludes</code>
|
---|
666 | will be run on these files to make them compatible with GCC.
|
---|
667 | <br><dt><code>--with-libs</code>
|
---|
668 | <dd><dt><code>--with-libs=``</code><var>dir1</var><code> </code><var>dir2</var><code> ... </code><var>dirN</var><code>''</code>
|
---|
669 | <dd>Deprecated in favor of <code>--with-sysroot</code>.
|
---|
670 | Specifies a list of directories which contain the target runtime
|
---|
671 | libraries. These libraries will be copied into the <code>gcc</code> install
|
---|
672 | directory. If the directory list is omitted, this option has no
|
---|
673 | effect.
|
---|
674 | <br><dt><code>--with-newlib</code>
|
---|
675 | <dd>Specifies that <code>newlib</code> is
|
---|
676 | being used as the target C library. This causes <code>__eprintf</code> to be
|
---|
677 | omitted from <code>libgcc.a</code> on the assumption that it will be provided by
|
---|
678 | <code>newlib</code>.
|
---|
679 | </dl>
|
---|
680 |
|
---|
681 | <p>Note that each <code>--enable</code> option has a corresponding
|
---|
682 | <code>--disable</code> option and that each <code>--with</code> option has a
|
---|
683 | corresponding <code>--without</code> option.
|
---|
684 |
|
---|
685 | <hr />
|
---|
686 | <p>
|
---|
687 | <a href="./index.html">Return to the GCC Installation page</a>
|
---|
688 |
|
---|
689 | </body></html>
|
---|
690 |
|
---|