fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / INSTALL / configure.html
blob38698a48b6fa72f1cad9747c01c570569e947216
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.7">
7 <link title="Top" rel="top" href="#Top">
8 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9 <!--
10 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
11 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
13 Permission is granted to copy, distribute and/or modify this document
14 under the terms of the GNU Free Documentation License, Version 1.2 or
15 any later version published by the Free Software Foundation; with no
16 Invariant Sections, the Front-Cover texts being (a) (see below), and
17 with the Back-Cover Texts being (b) (see below). A copy of the
18 license is included in the section entitled "GNU Free Documentation License".
20 (a) The FSF's Front-Cover Text is:
22 A GNU Manual
24 (b) The FSF's Back-Cover Text is:
26 You have freedom to copy and modify this GNU Manual, like GNU
27 software. Copies published by the Free Software Foundation raise
28 funds for GNU development.-->
29 <meta http-equiv="Content-Style-Type" content="text/css">
30 <style type="text/css"><!--
31 pre.display { font-family:inherit }
32 pre.format { font-family:inherit }
33 pre.smalldisplay { font-family:inherit; font-size:smaller }
34 pre.smallformat { font-family:inherit; font-size:smaller }
35 pre.smallexample { font-size:smaller }
36 pre.smalllisp { font-size:smaller }
37 span.sc { font-variant:small-caps }
38 span.roman { font-family: serif; font-weight: normal; }
39 --></style>
40 </head>
41 <body>
42 <h1 class="settitle">Installing GCC: Configuration</h1>
43 <a name="index-Configuration-1"></a><a name="index-Installing-GCC_003a-Configuration-2"></a>
44 Like most GNU software, GCC must be configured before it can be built.
45 This document describes the recommended configuration procedure
46 for both native and cross targets.
48 <p>We use <var>srcdir</var> to refer to the toplevel source directory for
49 GCC; we use <var>objdir</var> to refer to the toplevel build/object directory.
51 <p>If you obtained the sources via CVS, <var>srcdir</var> must refer to the top
52 <span class="file">gcc</span> directory, the one where the <span class="file">MAINTAINERS</span> can be found,
53 and not its <span class="file">gcc</span> subdirectory, otherwise the build will fail.
55 <p>If either <var>srcdir</var> or <var>objdir</var> is located on an automounted NFS
56 file system, the shell's built-in <span class="command">pwd</span> command will return
57 temporary pathnames. Using these can lead to various sorts of build
58 problems. To avoid this issue, set the <span class="env">PWDCMD</span> environment
59 variable to an automounter-aware <span class="command">pwd</span> command, e.g.,
60 <span class="command">pawd</span> or <span class="samp">amq -w</span>, during the configuration and build
61 phases.
63 <p>First, we <strong>highly</strong> recommend that GCC be built into a
64 separate directory than the sources which does <strong>not</strong> reside
65 within the source tree. This is how we generally build GCC; building
66 where <var>srcdir</var> == <var>objdir</var> should still work, but doesn't
67 get extensive testing; building where <var>objdir</var> is a subdirectory
68 of <var>srcdir</var> is unsupported.
70 <p>If you have previously built GCC in the same directory for a
71 different target machine, do <span class="samp">make distclean</span> to delete all files
72 that might be invalid. One of the files this deletes is <span class="file">Makefile</span>;
73 if <span class="samp">make distclean</span> complains that <span class="file">Makefile</span> does not exist
74 or issues a message like &ldquo;don't know how to make distclean&rdquo; it probably
75 means that the directory is already suitably clean. However, with the
76 recommended method of building in a separate <var>objdir</var>, you should
77 simply use a different <var>objdir</var> for each target.
79 <p>Second, when configuring a native system, either <span class="command">cc</span> or
80 <span class="command">gcc</span> must be in your path or you must set <span class="env">CC</span> in
81 your environment before running configure. Otherwise the configuration
82 scripts may fail.
84 <p>Note that the bootstrap compiler and the resulting GCC must be link
85 compatible, else the bootstrap will fail with linker errors about
86 incompatible object file formats. Several multilibed targets are
87 affected by this requirement, see
88 <a href="specific.html">host/target specific installation notes</a>.
90 <p>To configure GCC:
92 <pre class="smallexample"> % mkdir <var>objdir</var>
93 % cd <var>objdir</var>
94 % <var>srcdir</var>/configure [<var>options</var>] [<var>target</var>]
95 </pre>
96 <h3 class="heading"><a name="TOC0"></a>Target specification</h3>
98 <ul>
99 <li>GCC has code to correctly determine the correct value for <var>target</var>
100 for nearly all native systems. Therefore, we highly recommend you not
101 provide a configure target when configuring a native compiler.
103 <li><var>target</var> must be specified as <span class="option">--target=</span><var>target</var>
104 when configuring a cross compiler; examples of valid targets would be
105 i960-rtems, m68k-coff, sh-elf, etc.
107 <li>Specifying just <var>target</var> instead of <span class="option">--target=</span><var>target</var>
108 implies that the host defaults to <var>target</var>.
109 </ul>
111 <h3 class="heading"><a name="TOC1"></a>Options specification</h3>
113 <p>Use <var>options</var> to override several configure time options for
114 GCC. A list of supported <var>options</var> follows; <span class="samp">configure
115 --help</span> may list other options, but those not listed below may not
116 work and should not normally be used.
118 <p>Note that each <span class="option">--enable</span> option has a corresponding
119 <span class="option">--disable</span> option and that each <span class="option">--with</span> option has a
120 corresponding <span class="option">--without</span> option.
122 <dl>
123 <dt><code>--prefix=</code><var>dirname</var><dd>Specify the toplevel installation
124 directory. This is the recommended way to install the tools into a directory
125 other than the default. The toplevel installation directory defaults to
126 <span class="file">/usr/local</span>.
128 <p>We <strong>highly</strong> recommend against <var>dirname</var> being the same or a
129 subdirectory of <var>objdir</var> or vice versa. If specifying a directory
130 beneath a user's home directory tree, some shells will not expand
131 <var>dirname</var> correctly if it contains the <span class="samp">~</span> metacharacter; use
132 <span class="env">$HOME</span> instead.
134 <p>The following standard <span class="command">autoconf</span> options are supported. Normally you
135 should not need to use these options.
136 <dl>
137 <dt><code>--exec-prefix=</code><var>dirname</var><dd>Specify the toplevel installation directory for architecture-dependent
138 files. The default is <var>prefix</var>.
140 <br><dt><code>--bindir=</code><var>dirname</var><dd>Specify the installation directory for the executables called by users
141 (such as <span class="command">gcc</span> and <span class="command">g++</span>). The default is
142 <var>exec-prefix</var><span class="file">/bin</span>.
144 <br><dt><code>--libdir=</code><var>dirname</var><dd>Specify the installation directory for object code libraries and
145 internal data files of GCC. The default is <var>exec-prefix</var><span class="file">/lib</span>.
147 <br><dt><code>--libexecdir=</code><var>dirname</var><dd>Specify the installation directory for internal executables of GCC.
148 The default is <var>exec-prefix</var><span class="file">/libexec</span>.
150 <br><dt><code>--with-slibdir=</code><var>dirname</var><dd>Specify the installation directory for the shared libgcc library. The
151 default is <var>libdir</var>.
153 <br><dt><code>--infodir=</code><var>dirname</var><dd>Specify the installation directory for documentation in info format.
154 The default is <var>prefix</var><span class="file">/info</span>.
156 <br><dt><code>--datadir=</code><var>dirname</var><dd>Specify the installation directory for some architecture-independent
157 data files referenced by GCC. The default is <var>prefix</var><span class="file">/share</span>.
159 <br><dt><code>--mandir=</code><var>dirname</var><dd>Specify the installation directory for manual pages. The default is
160 <var>prefix</var><span class="file">/man</span>. (Note that the manual pages are only extracts from
161 the full GCC manuals, which are provided in Texinfo format. The manpages
162 are derived by an automatic conversion process from parts of the full
163 manual.)
165 <br><dt><code>--with-gxx-include-dir=</code><var>dirname</var><dd>Specify
166 the installation directory for G++ header files. The default is
167 <var>prefix</var><span class="file">/include/c++/</span><var>version</var>.
169 </dl>
171 <br><dt><code>--program-prefix=</code><var>prefix</var><dd>GCC supports some transformations of the names of its programs when
172 installing them. This option prepends <var>prefix</var> to the names of
173 programs to install in <var>bindir</var> (see above). For example, specifying
174 <span class="option">--program-prefix=foo-</span> would result in <span class="samp">gcc</span>
175 being installed as <span class="file">/usr/local/bin/foo-gcc</span>.
177 <br><dt><code>--program-suffix=</code><var>suffix</var><dd>Appends <var>suffix</var> to the names of programs to install in <var>bindir</var>
178 (see above). For example, specifying <span class="option">--program-suffix=-3.1</span>
179 would result in <span class="samp">gcc</span> being installed as
180 <span class="file">/usr/local/bin/gcc-3.1</span>.
182 <br><dt><code>--program-transform-name=</code><var>pattern</var><dd>Applies the <span class="samp">sed</span> script <var>pattern</var> to be applied to the names
183 of programs to install in <var>bindir</var> (see above). <var>pattern</var> has to
184 consist of one or more basic <span class="samp">sed</span> editing commands, separated by
185 semicolons. For example, if you want the <span class="samp">gcc</span> program name to be
186 transformed to the installed program <span class="file">/usr/local/bin/myowngcc</span> and
187 the <span class="samp">g++</span> program name to be transformed to
188 <span class="file">/usr/local/bin/gspecial++</span> without changing other program names,
189 you could use the pattern
190 <span class="option">--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/'</span>
191 to achieve this effect.
193 <p>All three options can be combined and used together, resulting in more
194 complex conversion patterns. As a basic rule, <var>prefix</var> (and
195 <var>suffix</var>) are prepended (appended) before further transformations
196 can happen with a special transformation script <var>pattern</var>.
198 <p>As currently implemented, this option only takes effect for native
199 builds; cross compiler binaries' names are not transformed even when a
200 transformation is explicitly asked for by one of these options.
202 <p>For native builds, some of the installed programs are also installed
203 with the target alias in front of their name, as in
204 <span class="samp">i686-pc-linux-gnu-gcc</span>. All of the above transformations happen
205 before the target alias is prepended to the name - so, specifying
206 <span class="option">--program-prefix=foo-</span> and <span class="option">program-suffix=-3.1</span>, the
207 resulting binary would be installed as
208 <span class="file">/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1</span>.
210 <p>As a last shortcoming, none of the installed Ada programs are
211 transformed yet, which will be fixed in some time.
213 <br><dt><code>--with-local-prefix=</code><var>dirname</var><dd>Specify the
214 installation directory for local include files. The default is
215 <span class="file">/usr/local</span>. Specify this option if you want the compiler to
216 search directory <var>dirname</var><span class="file">/include</span> for locally installed
217 header files <em>instead</em> of <span class="file">/usr/local/include</span>.
219 <p>You should specify <span class="option">--with-local-prefix</span> <strong>only</strong> if your
220 site has a different convention (not <span class="file">/usr/local</span>) for where to put
221 site-specific files.
223 <p>The default value for <span class="option">--with-local-prefix</span> is <span class="file">/usr/local</span>
224 regardless of the value of <span class="option">--prefix</span>. Specifying
225 <span class="option">--prefix</span> has no effect on which directory GCC searches for
226 local header files. This may seem counterintuitive, but actually it is
227 logical.
229 <p>The purpose of <span class="option">--prefix</span> is to specify where to <em>install
230 GCC</em>. The local header files in <span class="file">/usr/local/include</span>&mdash;if you put
231 any in that directory&mdash;are not part of GCC. They are part of other
232 programs&mdash;perhaps many others. (GCC installs its own header files in
233 another directory which is based on the <span class="option">--prefix</span> value.)
235 <p>Both the local-prefix include directory and the GCC-prefix include
236 directory are part of GCC's "system include" directories. Although these
237 two directories are not fixed, they need to be searched in the proper
238 order for the correct processing of the include_next directive. The
239 local-prefix include directory is searched before the GCC-prefix
240 include directory. Another characteristic of system include directories
241 is that pedantic warnings are turned off for headers in these directories.
243 <p>Some autoconf macros add <span class="option">-I </span><var>directory</var> options to the
244 compiler command line, to ensure that directories containing installed
245 packages' headers are searched. When <var>directory</var> is one of GCC's
246 system include directories, GCC will ignore the option so that system
247 directories continue to be processed in the correct order. This
248 may result in a search order different from what was specified but the
249 directory will still be searched.
251 <p>GCC automatically searches for ordinary libraries using
252 <span class="env">GCC_EXEC_PREFIX</span>. Thus, when the same installation prefix is
253 used for both GCC and packages, GCC will automatically search for
254 both headers and libraries. This provides a configuration that is
255 easy to use. GCC behaves in a manner similar to that when it is
256 installed as a system compiler in <span class="file">/usr</span>.
258 <p>Sites that need to install multiple versions of GCC may not want to
259 use the above simple configuration. It is possible to use the
260 <span class="option">--program-prefix</span>, <span class="option">--program-suffix</span> and
261 <span class="option">--program-transform-name</span> options to install multiple versions
262 into a single directory, but it may be simpler to use different prefixes
263 and the <span class="option">--with-local-prefix</span> option to specify the location of the
264 site-specific files for each version. It will then be necessary for
265 users to specify explicitly the location of local site libraries
266 (e.g., with <span class="env">LIBRARY_PATH</span>).
268 <p>The same value can be used for both <span class="option">--with-local-prefix</span> and
269 <span class="option">--prefix</span> provided it is not <span class="file">/usr</span>. This can be used
270 to avoid the default search of <span class="file">/usr/local/include</span>.
272 <p><strong>Do not</strong> specify <span class="file">/usr</span> as the <span class="option">--with-local-prefix</span>!
273 The directory you use for <span class="option">--with-local-prefix</span> <strong>must not</strong>
274 contain any of the system's standard header files. If it did contain
275 them, certain programs would be miscompiled (including GNU Emacs, on
276 certain targets), because this would override and nullify the header
277 file corrections made by the <span class="command">fixincludes</span> script.
279 <p>Indications are that people who use this option use it based on mistaken
280 ideas of what it is for. People use it as if it specified where to
281 install part of GCC. Perhaps they make this assumption because
282 installing GCC creates the directory.
284 <br><dt><code>--enable-shared[=</code><var>package</var><code>[,...]]</code><dd>Build shared versions of libraries, if shared libraries are supported on
285 the target platform. Unlike GCC 2.95.x and earlier, shared libraries
286 are enabled by default on all platforms that support shared libraries,
287 except for <span class="samp">libobjc</span> which is built as a static library only by
288 default.
290 <p>If a list of packages is given as an argument, build shared libraries
291 only for the listed packages. For other packages, only static libraries
292 will be built. Package names currently recognized in the GCC tree are
293 <span class="samp">libgcc</span> (also known as <span class="samp">gcc</span>), <span class="samp">libstdc++</span> (not
294 <span class="samp">libstdc++-v3</span>), <span class="samp">libffi</span>, <span class="samp">zlib</span>, <span class="samp">boehm-gc</span> and
295 <span class="samp">libjava</span>. Note that <span class="samp">libobjc</span> does not recognize itself by
296 any name, so, if you list package names in <span class="option">--enable-shared</span>,
297 you will only get static Objective-C libraries. <span class="samp">libf2c</span> and
298 <span class="samp">libiberty</span> do not support shared libraries at all.
300 <p>Use <span class="option">--disable-shared</span> to build only static libraries. Note that
301 <span class="option">--disable-shared</span> does not accept a list of package names as
302 argument, only <span class="option">--enable-shared</span> does.
304 <br><dt><code><a name="with_002dgnu_002das"></a>--with-gnu-as</code><dd>Specify that the compiler should assume that the
305 assembler it finds is the GNU assembler. However, this does not modify
306 the rules to find an assembler and will result in confusion if the
307 assembler found is not actually the GNU assembler. (Confusion may also
308 result if the compiler finds the GNU assembler but has not been
309 configured with <span class="option">--with-gnu-as</span>.) If you have more than one
310 assembler installed on your system, you may want to use this option in
311 connection with <span class="option">--with-as=</span><var>pathname</var>.
313 <p>The following systems are the only ones where it makes a difference
314 whether you use the GNU assembler. On any other system,
315 <span class="option">--with-gnu-as</span> has no effect.
317 <ul>
318 <li><span class="samp">hppa1.0-</span><var>any</var><span class="samp">-</span><var>any</var>
319 <li><span class="samp">hppa1.1-</span><var>any</var><span class="samp">-</span><var>any</var>
320 <li><span class="samp">i386-</span><var>any</var><span class="samp">-sysv</span>
321 <li><span class="samp">m68k-bull-sysv</span>
322 <li><span class="samp">m68k-hp-hpux</span>
323 <li><span class="samp">m68000-hp-hpux</span>
324 <li><span class="samp">m68000-att-sysv</span>
325 <li><var>any</var><span class="samp">-lynx-lynxos</span>
326 <li><span class="samp">mips-</span><var>any</var>
327 <li><span class="samp">sparc-sun-solaris2.</span><var>any</var>
328 <li><span class="samp">sparc64-</span><var>any</var><span class="samp">-solaris2.</span><var>any</var>
329 </ul>
331 <p>On the systems listed above (except for the HP-PA, the SPARC, for ISC on
332 the 386, and for <span class="samp">mips-sgi-irix5.*</span>), if you use the GNU assembler,
333 you should also use the GNU linker (and specify <span class="option">--with-gnu-ld</span>).
335 <br><dt><code><a name="with_002das"></a>--with-as=</code><var>pathname</var><dd>Specify that the
336 compiler should use the assembler pointed to by <var>pathname</var>, rather
337 than the one found by the standard rules to find an assembler, which
338 are:
339 <ul>
340 <li>Check the <var>libexec</var><span class="file">/gcc/</span><var>target</var><span class="file">/</span><var>version</var>
341 directory, where <var>libexec</var> defaults to
342 <var>exec-prefix</var><span class="file">/libexec</span> and <var>exec-prefix</var> defaults to
343 <var>prefix</var> which defaults to <span class="file">/usr/local</span> unless overridden by
344 the <span class="option">--prefix=</span><var>pathname</var> switch described
345 above. <var>target</var> is the target system triple, such as
346 <span class="samp">sparc-sun-solaris2.7</span>, and <var>version</var> denotes the GCC
347 version, such as 3.0.
348 <li>Check operating system specific directories (e.g. <span class="file">/usr/ccs/bin</span> on
349 Sun Solaris 2).
350 </ul>
351 Note that these rules do not check for the value of <span class="env">PATH</span>. You may
352 want to use <span class="option">--with-as</span> if no assembler is installed in the
353 directories listed above, or if you have multiple assemblers installed
354 and want to choose one that is not found by the above rules.
356 <br><dt><code><a name="with_002dgnu_002dld"></a>--with-gnu-ld</code><dd>Same as <a href="#with-gnu-as"><span class="option">--with-gnu-as</span></a>
357 but for the linker.
359 <br><dt><code>--with-ld=</code><var>pathname</var><dd>Same as <a href="#with-as"><span class="option">--with-as</span></a>
360 but for the linker.
362 <br><dt><code>--with-stabs</code><dd>Specify that stabs debugging
363 information should be used instead of whatever format the host normally
364 uses. Normally GCC uses the same debug format as the host system.
366 <p>On MIPS based systems and on Alphas, you must specify whether you want
367 GCC to create the normal ECOFF debugging format, or to use BSD-style
368 stabs passed through the ECOFF symbol table. The normal ECOFF debug
369 format cannot fully handle languages other than C. BSD stabs format can
370 handle other languages, but it only works with the GNU debugger GDB.
372 <p>Normally, GCC uses the ECOFF debugging format by default; if you
373 prefer BSD stabs, specify <span class="option">--with-stabs</span> when you configure GCC.
375 <p>No matter which default you choose when you configure GCC, the user
376 can use the <span class="option">-gcoff</span> and <span class="option">-gstabs+</span> options to specify explicitly
377 the debug format for a particular compilation.
379 <p><span class="option">--with-stabs</span> is meaningful on the ISC system on the 386, also, if
380 <span class="option">--with-gas</span> is used. It selects use of stabs debugging
381 information embedded in COFF output. This kind of debugging information
382 supports C++ well; ordinary COFF debugging information does not.
384 <p><span class="option">--with-stabs</span> is also meaningful on 386 systems running SVR4. It
385 selects use of stabs debugging information embedded in ELF output. The
386 C++ compiler currently (2.6.0) does not support the DWARF debugging
387 information normally used on 386 SVR4 platforms; stabs provide a
388 workable alternative. This requires gas and gdb, as the normal SVR4
389 tools can not generate or interpret stabs.
391 <br><dt><code>--disable-multilib</code><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.
396 <p>Some targets provide finer-grained control over which multilibs are built
397 (e.g., <span class="option">--disable-softfloat</span>):
398 <dl>
399 <dt><code>arc-*-elf*</code><dd>biendian.
401 <br><dt><code>arm-*-*</code><dd>fpu, 26bit, underscore, interwork, biendian, nofmult.
403 <br><dt><code>m68*-*-*</code><dd>softfloat, m68881, m68000, m68020.
405 <br><dt><code>mips*-*-*</code><dd>single-float, biendian, softfloat.
407 <br><dt><code>powerpc*-*-*, rs6000*-*-*</code><dd>aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian,
408 sysv, aix.
410 </dl>
412 <br><dt><code>--enable-threads</code><dd>Specify that the target
413 supports threads. This affects the Objective-C compiler and runtime
414 library, and exception handling for other languages like C++ and Java.
415 On some systems, this is the default.
417 <p>In general, the best (and, in many cases, the only known) threading
418 model available will be configured for use. Beware that on some
419 systems, GCC has not been taught what threading models are generally
420 available for the system. In this case, <span class="option">--enable-threads</span> is an
421 alias for <span class="option">--enable-threads=single</span>.
423 <br><dt><code>--disable-threads</code><dd>Specify that threading support should be disabled for the system.
424 This is an alias for <span class="option">--enable-threads=single</span>.
426 <br><dt><code>--enable-threads=</code><var>lib</var><dd>Specify that
427 <var>lib</var> is the thread support library. This affects the Objective-C
428 compiler and runtime library, and exception handling for other languages
429 like C++ and Java. The possibilities for <var>lib</var> are:
431 <dl>
432 <dt><code>aix</code><dd>AIX thread support.
433 <br><dt><code>dce</code><dd>DCE thread support.
434 <br><dt><code>gnat</code><dd>Ada tasking support. For non-Ada programs, this setting is equivalent
435 to <span class="samp">single</span>. When used in conjunction with the Ada run time, it
436 causes GCC to use the same thread primitives as Ada uses. This option
437 is necessary when using both Ada and the back end exception handling,
438 which is the default for most Ada targets.
439 <br><dt><code>mach</code><dd>Generic MACH thread support, known to work on NeXTSTEP. (Please note
440 that the file needed to support this configuration, <span class="file">gthr-mach.h</span>, is
441 missing and thus this setting will cause a known bootstrap failure.)
442 <br><dt><code>no</code><dd>This is an alias for <span class="samp">single</span>.
443 <br><dt><code>posix</code><dd>Generic POSIX thread support.
444 <br><dt><code>rtems</code><dd>RTEMS thread support.
445 <br><dt><code>single</code><dd>Disable thread support, should work for all platforms.
446 <br><dt><code>solaris</code><dd>Sun Solaris 2 thread support.
447 <br><dt><code>vxworks</code><dd>VxWorks thread support.
448 <br><dt><code>win32</code><dd>Microsoft Win32 API thread support.
449 </dl>
451 <br><dt><code>--with-cpu=</code><var>cpu</var><dd>Specify which cpu variant the compiler should generate code for by default.
452 <var>cpu</var> will be used as the default value of the <span class="option">-mcpu=</span> switch.
453 This option is only supported on some targets, including ARM, i386, PowerPC,
454 and SPARC.
456 <br><dt><code>--with-schedule=</code><var>cpu</var><dt><code>--with-arch=</code><var>cpu</var><dt><code>--with-tune=</code><var>cpu</var><dt><code>--with-abi=</code><var>abi</var><dt><code>--with-float=</code><var>type</var><dd>These configure options provide default values for the <span class="option">-mschedule=</span>,
457 <span class="option">-march=</span>, <span class="option">-mtune=</span>, and <span class="option">-mabi=</span> options and for
458 <span class="option">-mhard-float</span> or <span class="option">-msoft-float</span>. As with <span class="option">--with-cpu</span>,
459 which switches will be accepted and acceptable values of the arguments depend
460 on the target.
462 <br><dt><code>--enable-altivec</code><dd>Specify that the target supports AltiVec vector enhancements. This
463 option will adjust the ABI for AltiVec enhancements, as well as generate
464 AltiVec code when appropriate. This option is only available for
465 PowerPC systems.
467 <br><dt><code>--enable-__cxa_atexit</code><dd>Define if you want to use __cxa_atexit, rather than atexit, to
468 register C++ destructors for local statics and global objects.
469 This is essential for fully standards-compliant handling of
470 destructors, but requires __cxa_atexit in libc. This option is currently
471 only available on systems with GNU libc. When enabled, this will cause
472 <span class="option">-fuse-cxa-exit</span> to be passed by default.
474 <br><dt><code>--enable-target-optspace</code><dd>Specify that target
475 libraries should be optimized for code space instead of code speed.
476 This is the default for the m32r platform.
478 <br><dt><code>--disable-cpp</code><dd>Specify that a user visible <span class="command">cpp</span> program should not be installed.
480 <br><dt><code>--with-cpp-install-dir=</code><var>dirname</var><dd>Specify that the user visible <span class="command">cpp</span> program should be installed
481 in <var>prefix</var><span class="file">/</span><var>dirname</var><span class="file">/cpp</span>, in addition to <var>bindir</var>.
483 <br><dt><code>--enable-initfini-array</code><dd>Force the use of sections <code>.init_array</code> and <code>.fini_array</code>
484 (instead of <code>.init</code> and <code>.fini</code>) for constructors and
485 destructors. Option <span class="option">--disable-initfini-array</span> has the
486 opposite effect. If neither option is specified, the configure script
487 will try to guess whether the <code>.init_array</code> and
488 <code>.fini_array</code> sections are supported and, if they are, use them.
490 <br><dt><code>--enable-maintainer-mode</code><dd>The build rules that
491 regenerate the GCC master message catalog <span class="file">gcc.pot</span> are normally
492 disabled. This is because it can only be rebuilt if the complete source
493 tree is present. If you have changed the sources and want to rebuild the
494 catalog, configuring with <span class="option">--enable-maintainer-mode</span> will enable
495 this. Note that you need a recent version of the <code>gettext</code> tools
496 to do so.
498 <br><dt><code>--enable-generated-files-in-srcdir</code><dd>Neither the .c and .h files that are generated from bison and flex nor the
499 info manuals and man pages that are built from the .texi files are present
500 in the CVS development tree. When building GCC from that development tree,
501 or from a snapshot which are created from CVS, then those generated files
502 are placed in your build directory, which allows for the source to be in a
503 readonly directory.
505 <p>If you configure with <span class="option">--enable-generated-files-in-srcdir</span> then those
506 generated files will go into the source directory. This is mainly intended
507 for generating release or prerelease tarballs of the GCC sources, since it
508 is not a requirement that the users of source releases to have flex, bison, or
509 makeinfo.
511 <br><dt><code>--enable-version-specific-runtime-libs</code><dd>Specify
512 that runtime libraries should be installed in the compiler specific
513 subdirectory (<var>libdir</var><span class="file">/gcc</span>) rather than the usual places. In
514 addition, <span class="samp">libstdc++</span>'s include files will be installed into
515 <var>libdir</var> unless you overruled it by using
516 <span class="option">--with-gxx-include-dir=</span><var>dirname</var>. Using this option is
517 particularly useful if you intend to use several versions of GCC in
518 parallel. This is currently supported by <span class="samp">libf2c</span> and
519 <span class="samp">libstdc++</span>, and is the default for <span class="samp">libobjc</span> which cannot be
520 changed in this case.
522 <br><dt><code>--enable-languages=</code><var>lang1</var><code>,</code><var>lang2</var><code>,...</code><dd>Specify that only a particular subset of compilers and
523 their runtime libraries should be built. For a list of valid values for
524 <var>langN</var> you can issue the following command in the
525 <span class="file">gcc</span> directory of your GCC source tree:<br>
526 <pre class="smallexample"> grep language= */config-lang.in
527 </pre>
528 <p>Currently, you can use any of the following:
529 <code>ada</code>, <code>c</code>, <code>c++</code>, <code>f77</code>, <code>java</code>, <code>objc</code>.
530 Building the Ada compiler has special requirements, see below.<br>
531 If you do not pass this flag, all languages available in the <span class="file">gcc</span>
532 sub-tree will be configured. Re-defining <code>LANGUAGES</code> when calling
533 <span class="samp">make bootstrap</span> <strong>does not</strong> work anymore, as those
534 language sub-directories might not have been configured!
536 <br><dt><code>--with-dwarf2</code><dd>Specify that the compiler should
537 use DWARF 2 debugging information as the default.
539 <br><dt><code>--enable-win32-registry</code><dt><code>--enable-win32-registry=</code><var>key</var><dt><code>--disable-win32-registry</code><dd>The <span class="option">--enable-win32-registry</span> option enables Microsoft Windows-hosted GCC
540 to look up installations paths in the registry using the following key:
542 <pre class="smallexample"> <code>HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\</code><var>key</var>
543 </pre>
544 <p><var>key</var> defaults to GCC version number, and can be overridden by the
545 <span class="option">--enable-win32-registry=</span><var>key</var> option. Vendors and distributors
546 who use custom installers are encouraged to provide a different key,
547 perhaps one comprised of vendor name and GCC version number, to
548 avoid conflict with existing installations. This feature is enabled
549 by default, and can be disabled by <span class="option">--disable-win32-registry</span>
550 option. This option has no effect on the other hosts.
552 <br><dt><code>--nfp</code><dd>Specify that the machine does not have a floating point unit. This
553 option only applies to <span class="samp">m68k-sun-sunos</span><var>n</var>. On any other
554 system, <span class="option">--nfp</span> has no effect.
556 <br><dt><code>--enable-werror</code><dt><code>--disable-werror</code><dt><code>--enable-werror=yes</code><dt><code>--enable-werror=no</code><dd>When you specify this option, it controls whether certain files in the
557 compiler are built with <span class="option">-Werror</span> in bootstrap stage2 and later.
558 If you don't specify it, <span class="option">-Werror</span> is turned on for the main
559 development trunk. However it defaults to off for release branches and
560 final releases. The specific files which get <span class="option">-Werror</span> are
561 controlled by the Makefiles.
563 <br><dt><code>--enable-checking</code><dt><code>--enable-checking=</code><var>list</var><dd>When you specify this option, the compiler is built to perform checking
564 of tree node types when referencing fields of that node, and some other
565 internal consistency checks. This does not change the generated code,
566 but adds error checking within the compiler. This will slow down the
567 compiler and may only work properly if you are building the compiler
568 with GCC. This is on by default when building from CVS or snapshots,
569 but off for releases. More control over the checks may be had by
570 specifying <var>list</var>; the categories of checks available are
571 <span class="samp">misc</span>, <span class="samp">tree</span>, <span class="samp">gc</span>, <span class="samp">rtl</span>, <span class="samp">rtlflag</span>,
572 <span class="samp">fold</span>, <span class="samp">gcac</span> and <span class="samp">valgrind</span>. The check <span class="samp">valgrind</span>
573 requires the external <span class="command">valgrind</span> simulator, available from
574 <a href="http://valgrind.kde.org/">http://valgrind.kde.org/</a>. The default when <var>list</var> is
575 not specified is <span class="samp">misc,tree,gc,rtlflag</span>; the checks <span class="samp">rtl</span>,
576 <span class="samp">gcac</span> and <span class="samp">valgrind</span> are very expensive.
578 <br><dt><code>--enable-coverage</code><dt><code>--enable-coverage=</code><var>level</var><dd>With this option, the compiler is built to collect self coverage
579 information, every time it is run. This is for internal development
580 purposes, and only works when the compiler is being built with gcc. The
581 <var>level</var> argument controls whether the compiler is built optimized or
582 not, values are <span class="samp">opt</span> and <span class="samp">noopt</span>. For coverage analysis you
583 want to disable optimization, for performance analysis you want to
584 enable optimization. When coverage is enabled, the default level is
585 without optimization.
587 <br><dt><code>--enable-gather-detailed-mem-stats</code><dd>When this option is specified more detailed information on memory
588 allocation is gathered. This information is printed when using
589 <span class="option">-fmem-report</span>.
591 <br><dt><code>--enable-nls</code><dt><code>--disable-nls</code><dd>The <span class="option">--enable-nls</span> option enables Native Language Support (NLS),
592 which lets GCC output diagnostics in languages other than American
593 English. Native Language Support is enabled by default if not doing a
594 canadian cross build. The <span class="option">--disable-nls</span> option disables NLS.
596 <br><dt><code>--with-included-gettext</code><dd>If NLS is enabled, the <span class="option">--with-included-gettext</span> option causes the build
597 procedure to prefer its copy of GNU <span class="command">gettext</span>.
599 <br><dt><code>--with-catgets</code><dd>If NLS is enabled, and if the host lacks <code>gettext</code> but has the
600 inferior <code>catgets</code> interface, the GCC build procedure normally
601 ignores <code>catgets</code> and instead uses GCC's copy of the GNU
602 <code>gettext</code> library. The <span class="option">--with-catgets</span> option causes the
603 build procedure to use the host's <code>catgets</code> in this situation.
605 <br><dt><code>--with-libiconv-prefix=</code><var>dir</var><dd>Search for libiconv header files in <var>dir</var><span class="file">/include</span> and
606 libiconv library files in <var>dir</var><span class="file">/lib</span>.
608 <br><dt><code>--enable-obsolete</code><dd>Enable configuration for an obsoleted system. If you attempt to
609 configure GCC for a system (build, host, or target) which has been
610 obsoleted, and you do not specify this flag, configure will halt with an
611 error message.
613 <p>All support for systems which have been obsoleted in one release of GCC
614 is removed entirely in the next major release, unless someone steps
615 forward to maintain the port.
616 </dl>
618 <h4 class="subheading"><a name="TOC2"></a>Cross-Compiler-Specific Options</h4>
620 <p>The following options only apply to building cross compilers.
621 <dl>
622 <dt><code>--with-sysroot</code><dt><code>--with-sysroot=</code><var>dir</var><dd>Tells GCC to consider <var>dir</var> as the root of a tree that contains a
623 (subset of) the root filesystem of the target operating system.
624 Target system headers, libraries and run-time object files will be
625 searched in there. The specified directory is not copied into the
626 install tree, unlike the options <span class="option">--with-headers</span> and
627 <span class="option">--with-libs</span> that this option obsoletes. The default value,
628 in case <span class="option">--with-sysroot</span> is not given an argument, is
629 <span class="option">${gcc_tooldir}/sys-root</span>. If the specified directory is a
630 subdirectory of <span class="option">${exec_prefix}</span>, then it will be found relative to
631 the GCC binaries if the installation tree is moved.
633 <br><dt><code>--with-headers</code><dt><code>--with-headers=</code><var>dir</var><dd>Deprecated in favor of <span class="option">--with-sysroot</span>.
634 Specifies that target headers are available when building a cross compiler.
635 The <var>dir</var> argument specifies a directory which has the target include
636 files. These include files will be copied into the <span class="file">gcc</span> install
637 directory. <em>This option with the </em><var>dir</var><em> argument is required</em> when
638 building a cross compiler, if <var>prefix</var><span class="file">/</span><var>target</var><span class="file">/sys-include</span>
639 doesn't pre-exist. If <var>prefix</var><span class="file">/</span><var>target</var><span class="file">/sys-include</span> does
640 pre-exist, the <var>dir</var> argument may be omitted. <span class="command">fixincludes</span>
641 will be run on these files to make them compatible with GCC.
643 <br><dt><code>--without-headers</code><dd>Tells GCC not use any target headers from a libc when building a cross
644 compiler. When crossing to GNU/Linux, you need the headers so GCC
645 can build the exception handling for libgcc.
646 See <a href="http://www.objsw.com/CrossGCC/">CrossGCC</a> for more information
647 on this option.
649 <br><dt><code>--with-libs</code><dt><code>--with-libs=``</code><var>dir1</var> <var>dir2</var><code> ... </code><var>dirN</var><code>''</code><dd>Deprecated in favor of <span class="option">--with-sysroot</span>.
650 Specifies a list of directories which contain the target runtime
651 libraries. These libraries will be copied into the <span class="file">gcc</span> install
652 directory. If the directory list is omitted, this option has no
653 effect.
654 <br><dt><code>--with-newlib</code><dd>Specifies that <span class="samp">newlib</span> is
655 being used as the target C library. This causes <code>__eprintf</code> to be
656 omitted from <span class="file">libgcc.a</span> on the assumption that it will be provided by
657 <span class="samp">newlib</span>.
658 </dl>
660 <h4 class="subheading"><a name="TOC3"></a>Java-Specific Options</h4>
662 <p>The following option applies to the build of the Java front end.
664 <dl>
665 <dt><code>--disable-libgcj</code><dd>Specify that the run-time libraries
666 used by GCJ should not be built. This is useful in case you intend
667 to use GCJ with some other run-time, or you're going to install it
668 separately, or it just happens not to build on your particular
669 machine. In general, if the Java front end is enabled, the GCJ
670 libraries will be enabled too, unless they're known to not work on
671 the target platform. If GCJ is enabled but <span class="samp">libgcj</span> isn't built, you
672 may need to port it; in this case, before modifying the top-level
673 <span class="file">configure.in</span> so that <span class="samp">libgcj</span> is enabled by default on this platform,
674 you may use <span class="option">--enable-libgcj</span> to override the default.
676 </dl>
678 <p>The following options apply to building <span class="samp">libgcj</span>.
680 <h5 class="subsubheading"><a name="TOC4"></a>General Options</h5>
682 <dl>
683 <dt><code>--disable-getenv-properties</code><dd>Don't set system properties from <span class="env">GCJ_PROPERTIES</span>.
685 <br><dt><code>--enable-hash-synchronization</code><dd>Use a global hash table for monitor locks. Ordinarily,
686 <span class="samp">libgcj</span>'s <span class="samp">configure</span> script automatically makes
687 the correct choice for this option for your platform. Only use
688 this if you know you need the library to be configured differently.
690 <br><dt><code>--enable-interpreter</code><dd>Enable the Java interpreter. The interpreter is automatically
691 enabled by default on all platforms that support it. This option
692 is really only useful if you want to disable the interpreter
693 (using <span class="option">--disable-interpreter</span>).
695 <br><dt><code>--disable-java-net</code><dd>Disable java.net. This disables the native part of java.net only,
696 using non-functional stubs for native method implementations.
698 <br><dt><code>--disable-jvmpi</code><dd>Disable JVMPI support.
700 <br><dt><code>--with-ecos</code><dd>Enable runtime eCos target support.
702 <br><dt><code>--without-libffi</code><dd>Don't use <span class="samp">libffi</span>. This will disable the interpreter and JNI
703 support as well, as these require <span class="samp">libffi</span> to work.
705 <br><dt><code>--enable-libgcj-debug</code><dd>Enable runtime debugging code.
707 <br><dt><code>--enable-libgcj-multifile</code><dd>If specified, causes all <span class="file">.java</span> source files to be
708 compiled into <span class="file">.class</span> files in one invocation of
709 <span class="samp">gcj</span>. This can speed up build time, but is more
710 resource-intensive. If this option is unspecified or
711 disabled, <span class="samp">gcj</span> is invoked once for each <span class="file">.java</span>
712 file to compile into a <span class="file">.class</span> file.
714 <br><dt><code>--with-libiconv-prefix=DIR</code><dd>Search for libiconv in <span class="file">DIR/include</span> and <span class="file">DIR/lib</span>.
716 <br><dt><code>--enable-sjlj-exceptions</code><dd>Force use of <code>builtin_setjmp</code> for exceptions. <span class="samp">configure</span>
717 ordinarily picks the correct value based on the platform. Only use
718 this option if you are sure you need a different setting.
720 <br><dt><code>--with-system-zlib</code><dd>Use installed <span class="samp">zlib</span> rather than that included with GCC.
722 <br><dt><code>--with-win32-nlsapi=ansi, unicows or unicode</code><dd>Indicates how MinGW <span class="samp">libgcj</span> translates between UNICODE
723 characters and the Win32 API.
724 <dl>
725 <dt><code>ansi</code><dd>Use the single-byte <code>char</code> and the Win32 A functions natively,
726 translating to and from UNICODE when using these functions. If
727 unspecified, this is the default.
729 <br><dt><code>unicows</code><dd>Use the <code>WCHAR</code> and Win32 W functions natively. Adds
730 <code>-lunicows</code> to <span class="file">libgcj.spec</span> to link with <span class="samp">libunicows</span>.
731 <span class="file">unicows.dll</span> needs to be deployed on Microsoft Windows 9X machines
732 running built executables. <span class="file">libunicows.a</span>, an open-source
733 import library around Microsoft's <code>unicows.dll</code>, is obtained from
734 <a href="http://libunicows.sourceforge.net/">http://libunicows.sourceforge.net/</a>, which also gives details
735 on getting <span class="file">unicows.dll</span> from Microsoft.
737 <br><dt><code>unicode</code><dd>Use the <code>WCHAR</code> and Win32 W functions natively. Does <em>not</em>
738 add <code>-lunicows</code> to <span class="file">libgcj.spec</span>. The built executables will
739 only run on Microsoft Windows NT and above.
740 </dl>
741 </dl>
743 <h5 class="subsubheading"><a name="TOC5"></a>AWT-Specific Options</h5>
745 <dl>
746 <dt><code>--with-x</code><dd>Use the X Window System.
748 <br><dt><code>--enable-java-awt=PEER(S)</code><dd>Specifies the AWT peer library or libraries to build alongside
749 <span class="samp">libgcj</span>. If this option is unspecified or disabled, AWT
750 will be non-functional. Current valid values are <span class="option">gtk</span> and
751 <span class="option">xlib</span>. Multiple libraries should be separated by a
752 comma (i.e. <span class="option">--enable-java-awt=gtk,xlib</span>).
754 <br><dt><code>--enable-gtk-cairo</code><dd>Build the cairo Graphics2D implementation on GTK.
756 <br><dt><code>--enable-java-gc=TYPE</code><dd>Choose garbage collector. Defaults to <span class="option">boehm</span> if unspecified.
758 <br><dt><code>--disable-gtktest</code><dd>Do not try to compile and run a test GTK+ program.
760 <br><dt><code>--disable-glibtest</code><dd>Do not try to compile and run a test GLIB program.
762 <br><dt><code>--with-libart-prefix=PFX</code><dd>Prefix where libart is installed (optional).
764 <br><dt><code>--with-libart-exec-prefix=PFX</code><dd>Exec prefix where libart is installed (optional).
766 <br><dt><code>--disable-libarttest</code><dd>Do not try to compile and run a test libart program.
768 </dl>
770 <p><hr />
771 <p><a href="./index.html">Return to the GCC Installation page</a>
773 <!-- ***Building**************************************************************** -->
774 <!-- ***Testing***************************************************************** -->
775 <!-- ***Final install*********************************************************** -->
776 <!-- ***Binaries**************************************************************** -->
777 <!-- ***Specific**************************************************************** -->
778 <!-- ***Old documentation****************************************************** -->
779 <!-- ***GFDL******************************************************************** -->
780 <!-- *************************************************************************** -->
781 <!-- Part 6 The End of the Document -->
782 </body></html>