2008-01-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / libstdc++-v3 / docs / html / configopts.html
blob215a1ab3b81e96d3cf5c1cb74395a834677aa0b5
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">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
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" />
12 <title>libstdc++-v3 configure options</title>
13 <link rel="StyleSheet" href="lib3styles.css" type="text/css" />
14 <link rel="Copyright" href="17_intro/license.html" type="text/html" />
15 </head>
16 <body>
18 <h1 class="centered"><a name="top">Interesting <code>configure</code>
19 options</a></h1>
21 <p class="fineprint"><em>
22 The latest version of this document is always available at
23 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
24 http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</a>.
25 </em></p>
27 <p><em>
28 To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
29 </em></p>
31 <!-- ####################################################### -->
32 <hr />
33 <p>Here are some of the non-obvious options to libstdc++'s configure.
34 Keep in mind that
35 <!-- This SECnn should be the "Choosing Package Options" section. -->
36 <a href="http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_131.html#SEC131">they
37 all have opposite forms as well</a>
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.
41 </p>
42 <p>The canonical way to find out the configure options that are
43 available for a given set of libstdc++ sources is to go to the
44 source directory and then type:<code> ./configure --help</code>
45 </p>
47 <dl>
48 <dt><code>--enable-multilib </code>[default]</dt>
49 <dd><p>This is part of the generic multilib support for building cross
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.
54 </p>
55 </dd>
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>
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>
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
83 &quot;c++/(version)&quot;.
84 </p>
85 <pre>
86 --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
88 <dt><code>--enable-cstdio </code></dt>
89 <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
90 (described next). This option can change the library ABI.
91 </p>
92 </dd>
94 <dt><code>--enable-cstdio=OPTION </code></dt>
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>.
99 </p>
100 </dd>
102 <dt><code>--enable-clocale </code></dt>
103 <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
104 (described next). This option can change the library ABI.
105 </p>
106 </dd>
108 <dt><code>--enable-clocale=OPTION </code></dt>
109 <dd><p>Select a target-specific underlying locale package. The
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,
112 'gnu' to specify a model based on functionality from the GNU C
113 library (langinfo/iconv/gettext) (from <a
114 href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
115 library), or 'generic' to use a generic &quot;C&quot;
116 abstraction which consists of &quot;C&quot; locale info.
117 </p>
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.
125 </p>
126 </dd>
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>
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
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.
142 </p>
143 </dd>
145 <dt><code>--enable-cheaders=OPTION </code></dt>
146 <dd><p>This allows the user to define the approach taken for C header
147 compatibility with C++. Options are c, c_std, and c_global.
148 These correspond to the source directory's include/c,
149 include/c_std, and include/c_global, and may also include
150 include/c_compatibility. The default is c_global.
151 </p>
152 </dd>
154 <dt><code>--enable-threads </code></dt>
155 <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
156 (described next). This option can change the library ABI.
157 </p>
158 </dd>
160 <dt><code>--enable-threads=OPTION </code></dt>
161 <dd><p>Select a threading library. A full description is given in the
162 general <a href="http://gcc.gnu.org/install/configure.html">compiler
163 configuration instructions</a>.
164 </p>
165 </dd>
167 <dt><code>--enable-libstdcxx-debug </code></dt>
168 <dd><p>Build separate debug libraries in addition to what is normally built.
169 By default, the debug libraries are compiled with
170 <code> CXXFLAGS='-g3 -O0'</code>
171 , are installed in <code>${libdir}/debug</code>, and have the
172 same names and versioning information as the non-debug
173 libraries. This option is off by default.
174 </p>
175 <p>Note this make command, executed in
176 the build directory, will do much the same thing, without the
177 configuration difference and without building everything twice:
178 <code>make CXXFLAGS='-g3 -O0' all</code>
179 </p>
180 </dd>
182 <dt><code>--enable-libstdcxx-debug-flags=FLAGS</code></dt>
184 <dd><p>This option is only valid when <code> --enable-debug </code>
185 is also specified, and applies to the debug builds only. With
186 this option, you can pass a specific string of flags to the
187 compiler to use when building the debug versions of libstdc++.
188 FLAGS is a quoted string of options, like
189 </p>
190 <pre>
191 --enable-libstdcxx-debug-flags='-g3 -O1 -gdwarf-2'</pre>
192 </dd>
194 <dt><code>--enable-cxx-flags=FLAGS</code></dt>
195 <dd><p>With this option, you can pass a string of -f (functionality)
196 flags to the compiler to use when building libstdc++. This
197 option can change the library ABI. FLAGS is a quoted string of
198 options, like
199 </p>
200 <pre>
201 --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
203 Note that the flags don't necessarily have to all be -f flags,
204 as shown, but usually those are the ones that will make sense
205 for experimentation and configure-time overriding.
206 </p>
207 <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
208 the 'make' environment is that, if files are automatically
209 rebuilt, the same flags will be used when compiling those files
210 as well, so that everything matches.
211 </p>
212 <p>Fun flags to try might include combinations of
213 </p>
214 <pre>
215 -fstrict-aliasing
216 -fno-exceptions
217 -ffunction-sections
218 -fvtable-gc</pre>
219 <p>and opposite forms (-fno-) of the same. Tell us (the libstdc++
220 mailing list) if you discover more!
221 </p>
222 </dd>
224 <dt><code>--enable-c99 </code></dt>
225 <dd><p>The &quot;long long&quot; type was introduced in C99, along
226 with many other functions for wide characters, and math
227 classification macros, etc. If enabled, all C99 functions not
228 specified by the C++ standard will be put into <code>namespace
229 __gnu_cxx</code>, and then all these names will
230 be injected into namespace std, so that C99 functions can be
231 used &quot;as if&quot; they were in the C++ standard (as they
232 will eventually be in some future revision of the standard,
233 without a doubt). By default, C99 support is on, assuming the
234 configure probes find all the necessary functions and bits
235 necessary. This option can change the library ABI.
236 </p>
237 </dd>
239 <dt><code>--enable-wchar_t </code>[default]</dt>
240 <dd><p>Template specializations for the &quot;wchar_t&quot; type are
241 required for wide character conversion support. Disabling
242 wide character specializations may be expedient for initial
243 porting efforts, but builds only a subset of what is required by
244 ISO, and is not recommended. By default, this option is on.
245 This option can change the library ABI.
246 </p>
247 </dd>
249 <dt><code>--enable-long-long </code></dt>
250 <dd><p>The &quot;long long&quot; type was introduced in C99. It is
251 provided as a GNU extension to C++98 in g++. This flag builds
252 support for &quot;long long&quot; into the library (specialized
253 templates and the like for iostreams). This option is on by default:
254 if enabled, users will have to either use the new-style &quot;C&quot;
255 headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
256 or add appropriate compile-time flags to all compile lines to
257 allow &quot;C&quot; visibility of this feature (on GNU/Linux,
258 the flag is -D_ISOC99_SOURCE, which is added automatically via
259 CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
260 This option can change the library ABI.
261 </p>
262 </dd>
264 <dt><code>--enable-fully-dynamic-string </code></dt>
265 <dd><p>This option enables a special version of basic_string avoiding
266 the optimization that allocates empty objects in static memory.
267 Mostly useful together with shared memory allocators, see PR
268 libstdc++/16612 for details.
269 </p>
270 </dd>
272 <dt><code>--enable-concept-checks </code></dt>
273 <dd><p>This turns on additional compile-time checks for instantiated
274 library templates, in the form of specialized templates,
275 <a href="19_diagnostics/howto.html#3">described here</a>. They
276 can help users discover when they break the rules of the STL, before
277 their programs run.
278 </p>
279 </dd>
281 <dt><code>--enable-symvers[=style] </code></dt>
283 <dd><p>In 3.1 and later, tries to turn on symbol versioning in the
284 shared library (if a shared library has been
285 requested). Values for 'style' that are currently supported
286 are 'gnu', 'gnu-versioned-namespace', 'darwin', and
287 'darwin-export'. Both gnu- options require that a recent
288 version of the GNU linker be in use. Both darwin options are
289 equivalent. With no style given, the configure script will try
290 to guess correct defaults for the host system, probe to see if
291 additional requirements are necessary and present for
292 activation, and if so, will turn symbol versioning on. This
293 option can change the library ABI.
294 </p>
296 </dd>
298 <dt><code>--enable-visibility </code></dt>
299 <dd><p> In 4.2 and later, enables or disables visibility attributes.
300 If enabled (as by default), and the compiler seems capable of
301 passing the simple sanity checks thrown at it, adjusts items
302 in namespace std, namespace std::tr1, and namespace __gnu_cxx
303 so that -fvisibility options work.
304 </p>
305 </dd>
307 <dt><code>--enable-libstdcxx-pch </code></dt>
308 <dd><p>In 3.4 and later, tries to turn on the generation of
309 stdc++.h.gch, a pre-compiled file including all the standard
310 C++ includes. If enabled (as by default), and the compiler
311 seems capable of passing the simple sanity checks thrown at
312 it, try to build stdc++.h.gch as part of the make process.
313 In addition, this generated file is used later on (by appending <code>
314 --include bits/stdc++.h </code> to CXXFLAGS) when running the
315 testsuite.
316 </p>
317 </dd>
319 <dt><code>--disable-hosted-libstdcxx </code></dt>
320 <dd><p>By default, a complete <em>hosted</em> C++ library is built. The
321 C++ Standard also describes a <em>freestanding</em> environment,
322 in which only a minimal set of headers are provided. This option
323 builds such an environment.
324 </p>
325 </dd>
326 </dl>
327 <p>Return <a href="#top">to the top of the page</a> or
328 <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
329 </p>
332 <!-- ####################################################### -->
334 <hr />
335 <p class="fineprint"><em>
336 See <a href="17_intro/license.html">license.html</a> for copying conditions.
337 Comments and suggestions are welcome, and may be sent to
338 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
339 </em></p>
342 </body>
343 </html>