1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
<html>
<head>
<title>Installing GCC: Configuration</title>
</head>
<body>
<h1 align="center">Installing GCC: Configuration</h1>
<p>Like most GNU software, GCC must be configured before it can be built.
This document describes the recommended configuration procedure
for both native and cross targets.
<p>We use <i>srcdir</i> to refer to the toplevel source directory for
GCC; we use <i>objdir</i> to refer to the toplevel build/object
directory.
<p>First, we <b>highly</b> recommend that GCC be built into a
separate directory than the sources which does <b>not</b> reside
within the source tree. This is how we generally build GCC; building
where <i>srcdir</i> == <i>objdir</i> should still work, but doesn't
get extensive testing; building where <i>objdir</i> is a subdirectory
of <i>srcdir</i> is unsupported.
<p>Second, when configuring a native system, either "cc" or "gcc" must be in
your path or you must set CC in your environment before running configure.
Otherwise the configuration scripts may fail.
<p>To configure GCC:
<blockquote>
<tt>
<br>% mkdir <i>objdir</i>
<br>% cd <i>objdir</i>
<br>% <i>srcdir</i>/configure <b>[target]</b> <b>[options]</b>
</tt>
</blockquote>
<p><b>target specification</b>
<ul>
<li>GCC has code to correctly determine the correct value for
<b>target</b> for nearly all native systems. Therefore, we highly
recommend you not provide a configure target when configuring a
native compiler.
<li> <b>target</b> must be specified as <tt>--target=</tt><i>target</i>
when configuring a cross compiler;
examples of valid targets would be i960-rtems, m68k-coff, sh-elf, etc.
<li>Specifying just <i>target</i> instead of <tt>--target=</tt><i>target</i>
implies that the host defaults to <i>target</i>.
</ul>
<p><b> options specification</b>
<p>Use <b>options</b> to override several configure time options for
GCC. A partial list of supported <tt>options</tt>:
<ul>
<li> <tt>--prefix=</tt><i>dirname</i> -- Specify the toplevel installation
directory. This is the recommended way to install the tools into a directory
other than the default. The toplevel installation directory defaults to
/usr/local.
<p> We <b>highly</b> recommend against <i>prefix</i> being the same or a
subdirectory of <i>objdir</i> or vice versa.
<p>These additional options control where certain parts of the distribution
are installed. Normally you should not need to use these options.
<ul>
<li> <tt>--with-local-prefix=</tt><i>dirname</i> -- Specify the installation
directory for local include files. The default is /usr/local.
<li> <tt>--with-gxx-include-dir=</tt><i>dirname</i> -- Specify the installation
directory for g++ header files. The default is /usr/local/include/g++.
</ul>
<li> <tt>--enable-shared</tt> -- Build shared versions of the C++ runtime
libraries if supported <tt>--disable-shared</tt> is the default.
<li> <tt>--enable-haifa</tt> -- Enable the new Haifa instruction scheduler
in the compiler; the new scheduler can significantly improve code on some
targets.
<br>For EGCS 1.0.x releases <tt>--disable-haifa</tt> is the default on all
platforms except the HPPA.
<br>For newer releases <tt>--disable-haifa</tt> is the default on all
platforms except the alpha, hppa, powerpc, rs6000, SPARC and m32r.
<li> <tt>--with-gnu-as</tt> -- Specify that the compiler should assume the GNU
assembler (aka gas) is available.
<li> <tt>--with-gnu-ld</tt> -- Specify that the compiler should assume the GNU
linker (aka gld) is available.
<li> <tt>--with-stabs</tt> -- Specify that stabs debugging information should be used
instead of whatever format the host normally uses. Normally GCC uses the
same debug format as the host system.
<li> <tt>--enable-multilib</tt> -- Specify that multiple target libraries
should be built to support different target variants, calling conventions,
etc. This is the default.
<li> <tt>--enable-threads</tt> -- Specify that the target supports threads.
This affects the Objective-C compiler and runtime library, and exception
handling for other languages like C++ and Java.
<li> <tt>--enable-threads=</tt><i>lib</i> -- Specify that <i>lib</i> is the
thread support library. This affects the Objective-C compiler and
runtime library, and exception handling for other languages like C++ and
Java.
<li> <tt>--with-cpu=</tt><i>cpu</i> -- Specify which cpu variant the
compiler should generate code for by default. This is currently
only supported on the some ports, specifically arm, powerpc, and
SPARC. If configure does not recognize the model name (e.g. arm700,
603e, or ultrasparc) you provide, please check the configure script
for a complete list of supported models.
<li> <tt>--enable-target-optspace</tt> -- Specify that target libraries
should be optimized for code space instead of code speed. This is the
default for the m32r platform.
<li> <tt>--enable-cpp</tt> -- Specify that a shell script which emulates
traditional cpp functionality should be installed.
<li> <tt>--enable-cpplib</tt> -- Specify that the functionality of
CPP should be integrated into the compiler itself. This option is
not supported by snapshots since November 2000. In snapshots where
it is supported, it is not enabled by default, except for snapshots
very close to November 2000.
<li> <tt>--without-fast-fixincludes</tt> -- Specify that the old, slower
method of fixing the system header files should be used.
EGCS 1.1.x and older releases default to the slow version. GCC 2.95 and
newer releases will default to the fast version.
<li> <tt>--enable-version-specific-runtime-libs</tt> -- Specify that runtime
libraries should be installed in the compiler specific subdirectory
(<tt>${libsubdir}</tt>) rather than the usual places.
In addition, libstdc++'s include files will be installed in
<tt>${libsubdir}/include/g++</tt> unless you overruled it by using
<tt>--with-gxx-include-dir=</tt><i>dirname</i>.
Using this option is particularly useful if you intend to use several
versions of GCC in parallel. This is currently supported by <tt>libf2c</tt>
and <tt>libstdc++</tt>.
<li> <tt>--enable-languages=</tt><i>lang1</i><tt>,</tt><i>lang2</i><tt>,...</tt>
-- Specify that only a particular subset of compilers and their runtime libraries
should be built. For a list of valid values for <i>lang</i><tt>x</tt> you can issue
the following command in the <tt>gcc</tt> directory of your GCC source tree:<br>
<tt>
grep language= */config-lang.in
</tt><br>
Currently, you can use any of the following: <code>c++</code>,
<code>f77</code>, <code>java</code> and <code>objc</code>.
<code>CHILL</code> is not currently maintained, and will almost
certainly fail to compile. Note that this switch does not work with
EGCS 1.1.2 or older versions of egcs. It is supported in GCC 2.95
and newer versions. <br>
If you do not pass this flag, all languages available in the <tt>gcc</tt> sub-tree
will be configured. Re-defining LANGUAGES when calling <tt>make bootstrap</tt>
<b>*does not*</b> work anymore, as those language sub-directories might not have been
configured!
<li> <tt>--with-dwarf2</tt> -- Specify that the compiler should use DWARF2
debugging information as the default.
</ul>
<p>Some options which only apply to building cross compilers:
<ul>
<li> <tt>--with-headers=</tt><i>dir</i> -- Specifies a directory which has
target include files.
<em>This options is required</em> when building a cross
compiler, if <tt>${prefix}/${target}/sys-include</tt> doesn't pre-exist.
These include files will be copied into the gcc install directory.
Fixincludes will be run on these files to make them compatible with gcc.
<li> <tt>--with-libs=</tt><i>"dir1 dir2 ... dirN"</i> -- Specifies a list of
directories which contain the target runtime libraries. These libraries will
be copied into the gcc install directory.
<li> <tt>--with-newlib</tt> -- Specifies that "newlib" is being used as the target
C library. This causes __eprintf to be omitted from libgcc.a on the
assumption that it will be provided by newlib.
</ul>
<p>Note that each <tt>--enable</tt> option has a corresponding <tt>--disable</tt> option and
that each <tt>--with</tt> option has a corresponding <tt>--without</tt> option.
<hr>
<p><a href="./index.html">Return to the GCC Installation page</a></p>
</body>
</html>
|