1 |
424 |
jeremybenn |
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
ISO C++
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
configure
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
options
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
Configure
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
When configuring libstdc++, you'll have to configure the entire
|
22 |
|
|
gccsrcdir directory. Consider using the
|
23 |
|
|
toplevel gcc configuration option
|
24 |
|
|
--enable-languages=c++, which saves time by only
|
25 |
|
|
building the C++ toolchain.
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
Here are all of the configure options specific to libstdc++. Keep
|
30 |
|
|
in mind that
|
31 |
|
|
|
32 |
|
|
they
|
33 |
|
|
all have opposite forms as well (enable/disable and
|
34 |
|
|
with/without). The defaults are for the current
|
35 |
|
|
development sources, which may be different than those
|
36 |
|
|
for released versions.
|
37 |
|
|
|
38 |
|
|
The canonical way to find out the configure options that are
|
39 |
|
|
available for a given set of libstdc++ sources is to go to the
|
40 |
|
|
source directory and then type:./configure --help.
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
--enable-multilib [default]
|
45 |
|
|
This is part of the generic multilib support for building cross
|
46 |
|
|
compilers. As such, targets like "powerpc-elf" will have
|
47 |
|
|
libstdc++ built many different ways: "-msoft-float"
|
48 |
|
|
and not, etc. A different libstdc++ will be built for each of
|
49 |
|
|
the different multilib versions. This option is on by default.
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
--enable-sjlj-exceptions
|
54 |
|
|
Forces old, set-jump/long-jump exception handling model. If
|
55 |
|
|
at all possible, the new, frame unwinding exception handling routines
|
56 |
|
|
should be used instead, as they significantly reduce both
|
57 |
|
|
runtime memory usage and executable size. This option can
|
58 |
|
|
change the library ABI.
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
--enable-version-specific-runtime-libs
|
63 |
|
|
Specify that run-time libraries should be installed in the
|
64 |
|
|
compiler-specific subdirectory (i.e.,
|
65 |
|
|
${libdir}/gcc-lib/${target_alias}/${gcc_version} )
|
66 |
|
|
instead of ${libdir} . This option is useful if you
|
67 |
|
|
intend to use several versions of gcc in parallel. In addition,
|
68 |
|
|
libstdc++'s include files will be installed in
|
69 |
|
|
${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++ ,
|
70 |
|
|
unless you also specify
|
71 |
|
|
--with-gxx-include-dir=dirname during configuration.
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
--with-gxx-include-dir=<include-files dir>
|
76 |
|
|
Adds support for named libstdc++ include directory. For instance,
|
77 |
|
|
the following puts all the libstdc++ headers into a directory
|
78 |
|
|
called "4.4-20090404" instead of the usual
|
79 |
|
|
"c++/(version)".
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
--with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/4.4-20090404
|
83 |
|
|
|
84 |
|
|
--enable-cstdio
|
85 |
|
|
This is an abbreviated form of '--enable-cstdio=stdio'
|
86 |
|
|
(described next).
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
--enable-cstdio=OPTION
|
91 |
|
|
Select a target-specific I/O package. At the moment, the only
|
92 |
|
|
choice is to use 'stdio', a generic "C" abstraction.
|
93 |
|
|
The default is 'stdio'. This option can change the library ABI.
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
--enable-clocale
|
98 |
|
|
This is an abbreviated form of '--enable-clocale=generic'
|
99 |
|
|
(described next).
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
--enable-clocale=OPTION
|
104 |
|
|
Select a target-specific underlying locale package. The
|
105 |
|
|
choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
|
106 |
|
|
(IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
|
107 |
|
|
'gnu' to specify a model based on functionality from the GNU C
|
108 |
|
|
library (langinfo/iconv/gettext) (from glibc, the GNU C
|
109 |
|
|
library), or 'generic' to use a generic "C"
|
110 |
|
|
abstraction which consists of "C" locale info.
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
If not explicitly specified, the configure proccess tries
|
114 |
|
|
to guess the most suitable package from the choices above. The
|
115 |
|
|
default is 'generic'. On glibc-based systems of sufficient
|
116 |
|
|
vintage (2.2.5 and newer) and capability (with installed DE and
|
117 |
|
|
FR locale data), 'gnu' is automatically selected. This option
|
118 |
|
|
can change the library ABI.
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
--enable-libstdcxx-allocator
|
123 |
|
|
This is an abbreviated form of
|
124 |
|
|
'--enable-libstdcxx-allocator=auto' (described
|
125 |
|
|
next).
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
--enable-libstdcxx-allocator=OPTION
|
130 |
|
|
Select a target-specific underlying std::allocator. The
|
131 |
|
|
choices are 'new' to specify a wrapper for new, 'malloc' to
|
132 |
|
|
specify a wrapper for malloc, 'mt' for a fixed power of two allocator,
|
133 |
|
|
'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator.
|
134 |
|
|
See this page for more information on allocator
|
135 |
|
|
extensions. This option
|
136 |
|
|
can change the library ABI.
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
|
140 |
|
|
--enable-cheaders=OPTION
|
141 |
|
|
This allows the user to define the approach taken for C header
|
142 |
|
|
compatibility with C++. Options are c, c_std, and c_global.
|
143 |
|
|
These correspond to the source directory's include/c,
|
144 |
|
|
include/c_std, and include/c_global, and may also include
|
145 |
|
|
include/c_compatibility. The default is 'c_global'.
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
--enable-threads
|
150 |
|
|
This is an abbreviated form of '--enable-threads=yes'
|
151 |
|
|
(described next).
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
--enable-threads=OPTION
|
156 |
|
|
Select a threading library. A full description is
|
157 |
|
|
given in the
|
158 |
|
|
general compiler
|
159 |
|
|
configuration instructions. This option can change the
|
160 |
|
|
library ABI.
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
--enable-libstdcxx-debug
|
165 |
|
|
Build separate debug libraries in addition to what is normally built.
|
166 |
|
|
By default, the debug libraries are compiled with
|
167 |
|
|
CXXFLAGS='-g3 -O0 -fno-inline'
|
168 |
|
|
, are installed in ${libdir}/debug , and have the
|
169 |
|
|
same names and versioning information as the non-debug
|
170 |
|
|
libraries. This option is off by default.
|
171 |
|
|
|
172 |
|
|
Note this make command, executed in
|
173 |
|
|
the build directory, will do much the same thing, without the
|
174 |
|
|
configuration difference and without building everything twice:
|
175 |
|
|
make CXXFLAGS='-g3 -O0 -fno-inline' all
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
--enable-libstdcxx-debug-flags=FLAGS
|
180 |
|
|
|
181 |
|
|
This option is only valid when --enable-debug
|
182 |
|
|
is also specified, and applies to the debug builds only. With
|
183 |
|
|
this option, you can pass a specific string of flags to the
|
184 |
|
|
compiler to use when building the debug versions of libstdc++.
|
185 |
|
|
FLAGS is a quoted string of options, like
|
186 |
|
|
|
187 |
|
|
|
188 |
|
|
--enable-libstdcxx-debug-flags='-g3 -O1 -fno-inline'
|
189 |
|
|
|
190 |
|
|
|
191 |
|
|
--enable-cxx-flags=FLAGS
|
192 |
|
|
With this option, you can pass a string of -f (functionality)
|
193 |
|
|
flags to the compiler to use when building libstdc++. This
|
194 |
|
|
option can change the library ABI. FLAGS is a quoted string of
|
195 |
|
|
options, like
|
196 |
|
|
|
197 |
|
|
|
198 |
|
|
--enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'
|
199 |
|
|
|
200 |
|
|
Note that the flags don't necessarily have to all be -f flags,
|
201 |
|
|
as shown, but usually those are the ones that will make sense
|
202 |
|
|
for experimentation and configure-time overriding.
|
203 |
|
|
|
204 |
|
|
The advantage of --enable-cxx-flags over setting CXXFLAGS in
|
205 |
|
|
the 'make' environment is that, if files are automatically
|
206 |
|
|
rebuilt, the same flags will be used when compiling those files
|
207 |
|
|
as well, so that everything matches.
|
208 |
|
|
|
209 |
|
|
Fun flags to try might include combinations of
|
210 |
|
|
|
211 |
|
|
|
212 |
|
|
-fstrict-aliasing
|
213 |
|
|
-fno-exceptions
|
214 |
|
|
-ffunction-sections
|
215 |
|
|
-fvtable-gc
|
216 |
|
|
and opposite forms (-fno-) of the same. Tell us (the libstdc++
|
217 |
|
|
mailing list) if you discover more!
|
218 |
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
--enable-c99
|
222 |
|
|
The "long long" type was introduced in C99, along
|
223 |
|
|
with many other functions for wide characters, and math
|
224 |
|
|
classification macros, etc. If enabled, all C99 functions not
|
225 |
|
|
specified by the C++ standard will be put into namespace
|
226 |
|
|
__gnu_cxx , and then all these names will
|
227 |
|
|
be injected into namespace std, so that C99 functions can be
|
228 |
|
|
used "as if" they were in the C++ standard (as they
|
229 |
|
|
will eventually be in some future revision of the standard,
|
230 |
|
|
without a doubt). By default, C99 support is on, assuming the
|
231 |
|
|
configure probes find all the necessary functions and bits
|
232 |
|
|
necessary. This option can change the library ABI.
|
233 |
|
|
|
234 |
|
|
|
235 |
|
|
|
236 |
|
|
--enable-wchar_t [default]
|
237 |
|
|
Template specializations for the "wchar_t" type are
|
238 |
|
|
required for wide character conversion support. Disabling
|
239 |
|
|
wide character specializations may be expedient for initial
|
240 |
|
|
porting efforts, but builds only a subset of what is required by
|
241 |
|
|
ISO, and is not recommended. By default, this option is on.
|
242 |
|
|
This option can change the library ABI.
|
243 |
|
|
|
244 |
|
|
|
245 |
|
|
|
246 |
|
|
--enable-long-long
|
247 |
|
|
The "long long" type was introduced in C99. It is
|
248 |
|
|
provided as a GNU extension to C++98 in g++. This flag builds
|
249 |
|
|
support for "long long" into the library (specialized
|
250 |
|
|
templates and the like for iostreams). This option is on by default:
|
251 |
|
|
if enabled, users will have to either use the new-style "C"
|
252 |
|
|
headers by default (i.e., <cmath> not <math.h>)
|
253 |
|
|
or add appropriate compile-time flags to all compile lines to
|
254 |
|
|
allow "C" visibility of this feature (on GNU/Linux,
|
255 |
|
|
the flag is -D_ISOC99_SOURCE, which is added automatically via
|
256 |
|
|
CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
|
257 |
|
|
This option can change the library ABI.
|
258 |
|
|
|
259 |
|
|
|
260 |
|
|
|
261 |
|
|
--enable-fully-dynamic-string
|
262 |
|
|
This option enables a special version of basic_string avoiding
|
263 |
|
|
the optimization that allocates empty objects in static memory.
|
264 |
|
|
Mostly useful together with shared memory allocators, see PR
|
265 |
|
|
libstdc++/16612 for details.
|
266 |
|
|
|
267 |
|
|
|
268 |
|
|
|
269 |
|
|
--enable-concept-checks
|
270 |
|
|
This turns on additional compile-time checks for instantiated
|
271 |
|
|
library templates, in the form of specialized templates,
|
272 |
|
|
described here. They
|
273 |
|
|
can help users discover when they break the rules of the STL, before
|
274 |
|
|
their programs run.
|
275 |
|
|
|
276 |
|
|
|
277 |
|
|
|
278 |
|
|
--enable-symvers[=style]
|
279 |
|
|
|
280 |
|
|
In 3.1 and later, tries to turn on symbol versioning in the
|
281 |
|
|
shared library (if a shared library has been
|
282 |
|
|
requested). Values for 'style' that are currently supported
|
283 |
|
|
are 'gnu', 'gnu-versioned-namespace', 'darwin', and
|
284 |
|
|
'darwin-export'. Both gnu- options require that a recent
|
285 |
|
|
version of the GNU linker be in use. Both darwin options are
|
286 |
|
|
equivalent. With no style given, the configure script will try
|
287 |
|
|
to guess correct defaults for the host system, probe to see if
|
288 |
|
|
additional requirements are necessary and present for
|
289 |
|
|
activation, and if so, will turn symbol versioning on. This
|
290 |
|
|
option can change the library ABI.
|
291 |
|
|
|
292 |
|
|
|
293 |
|
|
|
294 |
|
|
|
295 |
|
|
--enable-visibility
|
296 |
|
|
In 4.2 and later, enables or disables visibility attributes.
|
297 |
|
|
If enabled (as by default), and the compiler seems capable of
|
298 |
|
|
passing the simple sanity checks thrown at it, adjusts items
|
299 |
|
|
in namespace std, namespace std::tr1, and namespace __gnu_cxx
|
300 |
|
|
so that -fvisibility options work.
|
301 |
|
|
|
302 |
|
|
|
303 |
|
|
|
304 |
|
|
--enable-libstdcxx-pch
|
305 |
|
|
In 3.4 and later, tries to turn on the generation of
|
306 |
|
|
stdc++.h.gch, a pre-compiled file including all the standard
|
307 |
|
|
C++ includes. If enabled (as by default), and the compiler
|
308 |
|
|
seems capable of passing the simple sanity checks thrown at
|
309 |
|
|
it, try to build stdc++.h.gch as part of the make process.
|
310 |
|
|
In addition, this generated file is used later on (by appending
|
311 |
|
|
--include bits/stdc++.h to CXXFLAGS) when running the
|
312 |
|
|
testsuite.
|
313 |
|
|
|
314 |
|
|
|
315 |
|
|
|
316 |
|
|
--disable-hosted-libstdcxx
|
317 |
|
|
|
318 |
|
|
|
319 |
|
|
By default, a complete hosted C++ library is
|
320 |
|
|
built. The C++ Standard also describes a
|
321 |
|
|
freestanding environment, in which only a
|
322 |
|
|
minimal set of headers are provided. This option builds such an
|
323 |
|
|
environment.
|
324 |
|
|
|
325 |
|
|
|
326 |
|
|
|
327 |
|
|
--enable-libstdcxx-time
|
328 |
|
|
This is an abbreviated form of
|
329 |
|
|
'--enable-libstdcxx-time=yes' (described next).
|
330 |
|
|
|
331 |
|
|
|
332 |
|
|
|
333 |
|
|
--enable-libstdcxx-time=OPTION
|
334 |
|
|
Enables link-type checks for the availability of the
|
335 |
|
|
clock_gettime clocks, used in the implementation of [time.clock],
|
336 |
|
|
and of the nanosleep and sched_yield functions, used in the
|
337 |
|
|
implementation of [thread.thread.this] of the current C++0x draft.
|
338 |
|
|
The choice OPTION=yes checks for the availability of the facilities
|
339 |
|
|
in libc and libposix4. In case of need the latter is also linked
|
340 |
|
|
to libstdc++ as part of the build process. OPTION=rt also searches
|
341 |
|
|
(and, in case, links) librt. Note that the latter is not always
|
342 |
|
|
desirable because, in glibc, for example, in turn it triggers the
|
343 |
|
|
linking of libpthread too, which activates locking, a large overhead
|
344 |
|
|
for single-thread programs. OPTION=no skips the tests completely.
|
345 |
|
|
The default is OPTION=no.
|
346 |
|
|
|
347 |
|
|
|
348 |
|
|
|
349 |
|
|
|
350 |
|
|
|
351 |
|
|
|