]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/docs/html/configopts.html
c++config: Add in revised namespace associations.
[thirdparty/gcc.git] / libstdc++-v3 / docs / html / configopts.html
CommitLineData
ba43f4eb
JW
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5d5e5e4e 7<head>
64a6f971
JW
8 <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
9 <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
10 <meta name="DESCRIPTION" content="Configuration options for libstdc++-v3." />
11 <meta name="GENERATOR" content="vi and eight fingers" />
5d5e5e4e 12 <title>libstdc++-v3 configure options</title>
bc225f98
JW
13<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
14<link rel="Copyright" href="17_intro/license.html" type="text/html" />
5d5e5e4e
PE
15</head>
16<body>
b2dad0e3 17
0435269a 18<h1 class="centered"><a name="top">Interesting <code>configure</code>
5d5e5e4e 19options</a></h1>
b2dad0e3 20
21c93c39
JW
21<p class="fineprint"><em>
22 The latest version of this document is always available at
5d5e5e4e
PE
23 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
24 http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</a>.
21c93c39 25</em></p>
b2dad0e3 26
21c93c39
JW
27<p><em>
28 To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
29</em></p>
b2dad0e3
BK
30
31<!-- ####################################################### -->
64a6f971 32<hr />
5d5e5e4e 33<p>Here are some of the non-obvious options to libstdc++'s configure.
b2dad0e3 34 Keep in mind that
dcfa0bc8 35 <!-- This SECnn should be the "Choosing Package Options" section. -->
b80ec515 36 <a href="http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_131.html#SEC131">they
5d5e5e4e 37 all have opposite forms as well</a>
20c176ab
PE
38 (enable/disable and with/without). The defaults are for <strong>current
39 development sources</strong>, which may be different than those for
40 released versions.
5d5e5e4e
PE
41</p>
42<p>The canonical way to find out the configure options that are
8901ac21 43 available for a given set of libstdc++ sources is to go to the
5d5e5e4e 44 source directory and then type:<code> ./configure --help</code>
1860e6ab 45</p>
8901ac21 46
5d5e5e4e 47<dl>
64a6f971 48 <dt><code>--enable-multilib </code>[default]</dt>
5d5e5e4e 49 <dd><p>This is part of the generic multilib support for building cross
60ade935
PE
50 compilers. As such, targets like &quot;powerpc-elf&quot; will have
51 libstdc++ built many different ways: &quot;-msoft-float&quot;
52 and not, etc. A different libstdc++ will be built for each of
53 the different multilib versions. This option is on by default.
5d5e5e4e 54 </p>
64a6f971 55 </dd>
b2dad0e3 56
f7be2549
BK
57 <dt><code>--enable-sjlj-exceptions </code></dt>
58 <dd><p>Forces old, set-jump/long-jump exception handling model. If
59 at all possible, the new, frame unwinding exception handling routines
60 should be used instead, as they significantly reduce both
61 runtime memory usage and executable size. This option can
62 change the library ABI.
63 </p>
64 </dd>
65
66 <dt><code>--enable-version-specific-runtime-libs </code></dt>
67 <dd><p>Specify that run-time libraries should be installed in the
68 compiler-specific subdirectory (i.e.,
69 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
70 instead of <code>${libdir}</code>. This option is useful if you
71 intend to use several versions of gcc in parallel. In addition,
72 libstdc++'s include files will be installed in
73 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
74 unless you also specify
75 <code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
76 </p>
77 </dd>
78
79 <dt><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code></dt>
80 <dd><p>Adds support for named libstdc++ include directory. For instance,
81 the following puts all the libstdc++ headers into a directory
82 called &quot;2.97-20001008&quot; instead of the usual
6aa43d99 83 &quot;c++/(version)&quot;.
f7be2549
BK
84 </p>
85 <pre>
86 --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
87
64a6f971 88 <dt><code>--enable-cstdio </code></dt>
5d5e5e4e 89 <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
f7be2549 90 (described next). This option can change the library ABI.
5d5e5e4e 91 </p>
64a6f971 92 </dd>
b2dad0e3 93
f7be2549 94 <dt><code>--enable-cstdio=OPTION </code></dt>
58ac1d7f
BK
95 <dd><p>Select a target-specific I/O package. At the moment, the only
96 choice is to use 'stdio', a generic &quot;C&quot; abstraction.
97 The default is 'stdio'. A longer explanation is <a
98 href="explanations.html#cstdio">here</a>.
5d5e5e4e 99 </p>
64a6f971 100 </dd>
b2dad0e3 101
64a6f971 102 <dt><code>--enable-clocale </code></dt>
5d5e5e4e 103 <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
f7be2549 104 (described next). This option can change the library ABI.
5d5e5e4e 105 </p>
64a6f971 106 </dd>
8d66b99a 107
f7be2549 108 <dt><code>--enable-clocale=OPTION </code></dt>
5d5e5e4e 109 <dd><p>Select a target-specific underlying locale package. The
1fa4bed7
BK
110 choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
111 (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
33590f13 112 'gnu' to specify a model based on functionality from the GNU C
64a6f971 113 library (langinfo/iconv/gettext) (from <a
0435269a 114 href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
33590f13 115 library), or 'generic' to use a generic &quot;C&quot;
f7be2549 116 abstraction which consists of &quot;C&quot; locale info.
5d5e5e4e 117 </p>
0214010c 118
f7be2549
BK
119 <p>As part of the configuration process, the "C" library is
120 probed both for sufficient vintage, and installed locale
121 data. If either of these elements are not present, the C++
122 locale model default to 'generic.' On glibc-based systems of
123 version 2.2.5 and above with installed locale files, 'gnu' is
124 automatically selected.
5d5e5e4e 125 </p>
64a6f971 126 </dd>
b2dad0e3 127
8b0d6051
BK
128 <dt><code>--enable-libstdcxx-allocator </code></dt>
129 <dd><p>This is an abbreviated form of
130 <code>'--enable-libstdcxx-allocator=auto'</code> (described
131 next). This option can change the library ABI.
132 </p>
133 </dd>
134
135 <dt><code>--enable-libstdcxx-allocator=OPTION </code></dt>
136 <dd><p>Select a target-specific underlying std::allocator. The
137 choices are 'new' to specify a wrapper for new, 'malloc' to
138 specify a wrapper for malloc, 'mt' for a fixed power of two allocator
638004cc
PC
139 (<a href="ext/mt_allocator.html">documented</a> under extensions),
140 'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator.
141 This option can change the library ABI.
8b0d6051
BK
142 </p>
143 </dd>
144
64a6f971 145 <dt><code>--enable-cheaders=OPTION </code></dt>
5d5e5e4e 146 <dd><p>This allows the user to define what kind of C headers are
1165dc50
PC
147 used. Options are c and c_std. These correspond to the source
148 directory's include/c and include/c_std. The default is c_std.
5d5e5e4e 149 </p>
64a6f971 150 </dd>
99246c90 151
64a6f971 152 <dt><code>--enable-threads </code></dt>
5d5e5e4e 153 <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
f7be2549 154 (described next). This option can change the library ABI.
5d5e5e4e 155 </p>
64a6f971 156 </dd>
b2dad0e3 157
f7be2549 158 <dt><code>--enable-threads=OPTION </code></dt>
572cd73a
PE
159 <dd><p>Select a threading library. A full description is given in the
160 general <a href="http://gcc.gnu.org/install/configure.html">compiler
161 configuration instructions</a>.
5d5e5e4e 162 </p>
64a6f971 163 </dd>
b2dad0e3 164
d8d81f62 165 <dt><code>--enable-libstdcxx-debug </code></dt>
6aa43d99 166 <dd><p>Build separate debug libraries in addition to what is normally built.
3660e02f 167 By default, the debug libraries are compiled with
6aa43d99
BK
168 <code> CXXFLAGS='-g3 -O0'</code>
169 , are installed in <code>${libdir}/debug</code>, and have the
170 same names and versioning information as the non-debug
171 libraries. This option is off by default.
21c93c39
JW
172 </p>
173 <p>Note this make command, executed in
6aa43d99
BK
174 the build directory, will do much the same thing, without the
175 configuration difference and without building everything twice:
176 <code>make CXXFLAGS='-g3 -O0' all</code>
6aa43d99
BK
177 </p>
178 </dd>
179
d8d81f62 180 <dt><code>--enable-libstdcxx-debug-flags=FLAGS</code></dt>
6aa43d99
BK
181
182 <dd><p>This option is only valid when <code> --enable-debug </code>
183 is also specified, and applies to the debug builds only. With
184 this option, you can pass a specific string of flags to the
185 compiler to use when building the debug versions of libstdc++.
186 FLAGS is a quoted string of options, like
187 </p>
188 <pre>
d8d81f62 189 --enable-libstdcxx-debug-flags='-g3 -O1 -gdwarf-2'</pre>
6aa43d99
BK
190 </dd>
191
64a6f971 192 <dt><code>--enable-cxx-flags=FLAGS</code></dt>
5d5e5e4e 193 <dd><p>With this option, you can pass a string of -f (functionality)
f7be2549
BK
194 flags to the compiler to use when building libstdc++. This
195 option can change the library ABI. FLAGS is a quoted string of
196 options, like
1860e6ab 197 </p>
0435269a
PE
198 <pre>
199 --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
1860e6ab 200 <p>
b2dad0e3
BK
201 Note that the flags don't necessarily have to all be -f flags,
202 as shown, but usually those are the ones that will make sense
203 for experimentation and configure-time overriding.
5d5e5e4e
PE
204 </p>
205 <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
777c9517 206 the 'make' environment is that, if files are automatically
b2dad0e3
BK
207 rebuilt, the same flags will be used when compiling those files
208 as well, so that everything matches.
5d5e5e4e
PE
209 </p>
210 <p>Fun flags to try might include combinations of
1860e6ab 211 </p>
0435269a 212 <pre>
b2dad0e3 213 -fstrict-aliasing
777c9517 214 -fno-exceptions
b2dad0e3 215 -ffunction-sections
0435269a 216 -fvtable-gc</pre>
1860e6ab 217 <p>and opposite forms (-fno-) of the same. Tell us (the libstdc++
0435269a 218 mailing list) if you discover more!
5d5e5e4e 219 </p>
64a6f971 220 </dd>
58fdec72 221
f7be2549
BK
222 <dt><code>--enable-c99 </code></dt>
223 <dd><p>The &quot;long long&quot; type was introduced in C99, along
224 with many other functions for wide characters, and math
225 classification macros, etc. If enabled, all C99 functions not
226 specified by the C++ standard will be put into <code>namespace
227 __gnu_cxx</code>, and then all these names will
228 be injected into namespace std, so that C99 functions can be
229 used &quot;as if&quot; they were in the C++ standard (as they
230 will eventually be in some future revision of the standard,
231 without a doubt). By default, C99 support is on, assuming the
232 configure probes find all the necessary functions and bits
233 necessary. This option can change the library ABI.
234 </p>
235 </dd>
236
347669a0
BK
237 <dt><code>--enable-wchar_t </code>[default]</dt>
238 <dd><p>Template specializations for the &quot;wchar_t&quot; type are
239 required for wide character conversion support. Disabling
240 wide character specializations may be expedient for initial
241 porting efforts, but builds only a subset of what is required by
242 ISO, and is not recommended. By default, this option is on.
243 This option can change the library ABI.
f7be2549
BK
244 </p>
245 </dd>
246
247 <dt><code>--enable-long-long </code></dt>
248 <dd><p>The &quot;long long&quot; type was introduced in C99. It is
249 provided as a GNU extension to C++98 in g++. This flag builds
250 support for &quot;long long&quot; into the library (specialized
251 templates and the like for iostreams). This option is on by default:
252 if enabled, users will have to either use the new-style &quot;C&quot;
253 headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
254 or add appropriate compile-time flags to all compile lines to
255 allow &quot;C&quot; visibility of this feature (on GNU/Linux,
256 the flag is -D_ISOC99_SOURCE, which is added automatically via
257 CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
258 This option can change the library ABI.
5d5e5e4e 259 </p>
64a6f971 260 </dd>
572cd73a 261
1165dc50
PC
262 <dt><code>--enable-fully-dynamic-string </code></dt>
263 <dd><p>This option enables a special version of basic_string avoiding
264 the optimization that allocates empty objects in static memory.
265 Mostly useful together with shared memory allocators, see PR
266 libstdc++/16612 for details.
267 </p>
268 </dd>
269
64a6f971 270 <dt><code>--enable-concept-checks </code></dt>
572cd73a
PE
271 <dd><p>This turns on additional compile-time checks for instantiated
272 library templates, in the form of specialized templates,
273 <a href="19_diagnostics/howto.html#3">described here</a>. They
274 can help users discover when they break the rules of the STL, before
275 their programs run.
276 </p>
64a6f971 277 </dd>
9aa43698 278
64a6f971 279 <dt><code>--enable-symvers[=style] </code></dt>
3cbc7af0 280
6aa43d99 281 <dd><p>In 3.1 and later, tries to turn on symbol versioning in the
3cbc7af0
BK
282 shared library (if a shared library has been
283 requested). Values for 'style' that are currently supported
284 are 'gnu', 'gnu-versioned-namespace', 'darwin', and
285 'darwin-export'. Both gnu- options require that a recent
286 version of the GNU linker be in use. Both darwin options are
287 equivalent. With no style given, the configure script will try
288 to guess if the 'gnu' style can be used, and if so, will turn
289 it on.
9aa43698 290 </p>
3cbc7af0 291
64a6f971 292 </dd>
44f0760e 293
d8d81f62 294 <dt><code>--enable-libstdcxx-pch </code></dt>
44f0760e
BK
295 <dd><p>In 3.4 and later, tries to turn on the generation of
296 stdc++.h.gch, a pre-compiled file including all the standard
297 C++ includes. If enabled (as by default), and the compiler
298 seems capable of passing the simple sanity checks thrown at
299 it, try to build stdc++.h.gch as part of the make process.
300 In addition, this generated file is used later on (by appending <code>
301 --include bits/stdc++.h </code> to CXXFLAGS) when running the
302 testsuite.
303 </p>
304 </dd>
3660e02f
PE
305
306 <dt><code>--disable-hosted-libstdcxx </code></dt>
307 <dd><p>By default, a complete <em>hosted</em> C++ library is built. The
308 C++ Standard also describes a <em>freestanding</em> environment,
309 in which only a minimal set of headers are provided. This option
310 builds such an environment.
311 </p>
312 </dd>
5d5e5e4e 313</dl>
5d5e5e4e 314<p>Return <a href="#top">to the top of the page</a> or
0435269a 315 <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
5d5e5e4e 316</p>
b2dad0e3
BK
317
318
319<!-- ####################################################### -->
320
64a6f971 321<hr />
0435269a 322<p class="fineprint"><em>
c9fe10db 323See <a href="17_intro/license.html">license.html</a> for copying conditions.
8ddad08b 324Comments and suggestions are welcome, and may be sent to
0435269a 325<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
5d5e5e4e 326</em></p>
b2dad0e3
BK
327
328
5d5e5e4e
PE
329</body>
330</html>