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