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