1 <?xml version="1.0" encoding="ISO-8859-1"?>
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">
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" />
17 <h1 class="centered"><a name="top">Interesting <code>configure</code>
20 <p class="fineprint"><em>
21 The latest version of this document is always available at
22 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
23 http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</a>.
27 To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
30 <!-- ####################################################### -->
32 <p>Here are some of the non-obvious options to libstdc++'s configure.
34 <!-- This SECnn should be the "Choosing Package Options" section. -->
35 <a href="http://www.gnu.org/manual/autoconf/html_node/Package-Options.html#Package%20Options">they
36 all have opposite forms as well</a>
37 (enable/disable and with/without). The defaults are for current
40 <p>The canonical way to find out the configure options that are
41 available for a given set of libstdc++ sources is to go to the
42 source directory and then type:<code> ./configure --help</code>
46 <dt><code>--enable-multilib </code>[default]</dt>
47 <dd><p>This is part of the generic multilib support for building cross
48 compilers. As such, targets like "powerpc-elf" will have
49 libstdc++ built many different ways: "-msoft-float"
50 and not, etc. A different libstdc++ will be built for each of
51 the different multilib versions. This option is on by default.
55 <dt><code>--enable-sjlj-exceptions </code></dt>
56 <dd><p>Forces old, set-jump/long-jump exception handling model. If
57 at all possible, the new, frame unwinding exception handling routines
58 should be used instead, as they significantly reduce both
59 runtime memory usage and executable size. This option can
60 change the library ABI.
64 <dt><code>--enable-version-specific-runtime-libs </code></dt>
65 <dd><p>Specify that run-time libraries should be installed in the
66 compiler-specific subdirectory (i.e.,
67 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
68 instead of <code>${libdir}</code>. This option is useful if you
69 intend to use several versions of gcc in parallel. In addition,
70 libstdc++'s include files will be installed in
71 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
72 unless you also specify
73 <code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
77 <dt><code>--with-gxx-include-dir=<include-files dir></code></dt>
78 <dd><p>Adds support for named libstdc++ include directory. For instance,
79 the following puts all the libstdc++ headers into a directory
80 called "2.97-20001008" instead of the usual
81 "c++/(version)".
84 --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
86 <dt><code>--enable-cstdio </code></dt>
87 <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
88 (described next). This option can change the library ABI.
92 <dt><code>--enable-cstdio=OPTION </code></dt>
93 <dd><p>Select a target-specific I/O package. At the moment, the only
94 choice is to use 'stdio', a generic "C" abstraction.
95 The default is 'stdio'. A longer explanation is <a
96 href="explanations.html#cstdio">here</a>.
100 <dt><code>--enable-clocale </code></dt>
101 <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
102 (described next). This option can change the library ABI.
106 <dt><code>--enable-clocale=OPTION </code></dt>
107 <dd><p>Select a target-specific underlying locale package. The
108 choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
109 (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
110 'gnu' to specify a model based on functionality from the GNU C
111 library (langinfo/iconv/gettext) (from <a
112 href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
113 library), or 'generic' to use a generic "C"
114 abstraction which consists of "C" locale info.
117 <p>As part of the configuration process, the "C" library is
118 probed both for sufficient vintage, and installed locale
119 data. If either of these elements are not present, the C++
120 locale model default to 'generic.' On glibc-based systems of
121 version 2.2.5 and above with installed locale files, 'gnu' is
122 automatically selected.
126 <dt><code>--enable-cheaders=OPTION </code></dt>
127 <dd><p>This allows the user to define what kind of C headers are
128 used. Options are: c, c_std, and c_shadow. These correspond
129 to the source directory's include/c, include/c_std, and
130 include/c_shadow directories. The default is c_std.
134 <dt><code>--enable-threads </code></dt>
135 <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
136 (described next). This option can change the library ABI.
140 <dt><code>--enable-threads=OPTION </code></dt>
141 <dd><p>Select a threading library. A full description is given in the
142 general <a href="http://gcc.gnu.org/install/configure.html">compiler
143 configuration instructions</a>.
147 <dt><code>--enable-debug </code></dt>
148 <dd><p>Build separate debug libraries in addition to what is normally built.
149 By default, the debug libraries are compiled with
150 <code> CXXFLAGS='-g3 -O0'</code>
151 , are installed in <code>${libdir}/debug</code>, and have the
152 same names and versioning information as the non-debug
153 libraries. This option is off by default.
155 <p>Note this make command, executed in
156 the build directory, will do much the same thing, without the
157 configuration difference and without building everything twice:
158 <code>make CXXFLAGS='-g3 -O0' all</code>
162 <dt><code>--enable-debug-flags=FLAGS</code></dt>
164 <dd><p>This option is only valid when <code> --enable-debug </code>
165 is also specified, and applies to the debug builds only. With
166 this option, you can pass a specific string of flags to the
167 compiler to use when building the debug versions of libstdc++.
168 FLAGS is a quoted string of options, like
171 --enable-debug-flags='-g3 -O1 -gdwarf-2'</pre>
174 <dt><code>--enable-cxx-flags=FLAGS</code></dt>
175 <dd><p>With this option, you can pass a string of -f (functionality)
176 flags to the compiler to use when building libstdc++. This
177 option can change the library ABI. FLAGS is a quoted string of
181 --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
183 Note that the flags don't necessarily have to all be -f flags,
184 as shown, but usually those are the ones that will make sense
185 for experimentation and configure-time overriding.
187 <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
188 the 'make' environment is that, if files are automatically
189 rebuilt, the same flags will be used when compiling those files
190 as well, so that everything matches.
192 <p>Fun flags to try might include combinations of
199 <p>and opposite forms (-fno-) of the same. Tell us (the libstdc++
200 mailing list) if you discover more!
204 <dt><code>--enable-c99 </code></dt>
205 <dd><p>The "long long" type was introduced in C99, along
206 with many other functions for wide characters, and math
207 classification macros, etc. If enabled, all C99 functions not
208 specified by the C++ standard will be put into <code>namespace
209 __gnu_cxx</code>, and then all these names will
210 be injected into namespace std, so that C99 functions can be
211 used "as if" they were in the C++ standard (as they
212 will eventually be in some future revision of the standard,
213 without a doubt). By default, C99 support is on, assuming the
214 configure probes find all the necessary functions and bits
215 necessary. This option can change the library ABI.
219 <dt><code>--enable-c-mbchar </code>[default]</dt>
220 <dd><p>Certain template specializations are required for wide
221 character conversion support. This is tricky and currently
222 changing rapidly, and can cause problems on new platforms.
223 Disabling wide character specializations is useful for initial
224 porting steps, but builds only a subset of what is required by
225 ISO. By default, this option is on. This option can change
230 <dt><code>--enable-long-long </code></dt>
231 <dd><p>The "long long" type was introduced in C99. It is
232 provided as a GNU extension to C++98 in g++. This flag builds
233 support for "long long" into the library (specialized
234 templates and the like for iostreams). This option is on by default:
235 if enabled, users will have to either use the new-style "C"
236 headers by default (i.e., <cmath> not <math.h>)
237 or add appropriate compile-time flags to all compile lines to
238 allow "C" visibility of this feature (on GNU/Linux,
239 the flag is -D_ISOC99_SOURCE, which is added automatically via
240 CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
241 This option can change the library ABI.
245 <dt><code>--enable-concept-checks </code></dt>
246 <dd><p>This turns on additional compile-time checks for instantiated
247 library templates, in the form of specialized templates,
248 <a href="19_diagnostics/howto.html#3">described here</a>. They
249 can help users discover when they break the rules of the STL, before
254 <dt><code>--enable-symvers[=style] </code></dt>
255 <dd><p>In 3.1 and later, tries to turn on symbol versioning in the
256 shared library (if a shared library has been requested). The
257 only 'style' currently supported is 'gnu' which requires that
258 a recent version of the GNU linker be in use. With no style
259 given, the configure script will try to guess if the 'gnu'
260 style can be used, and if so, will turn it on. Hopefully
261 people will volunteer to do other 'style' options.
265 <p>Return <a href="#top">to the top of the page</a> or
266 <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
270 <!-- ####################################################### -->
273 <p class="fineprint"><em>
274 See <a href="17_intro/license.html">license.html</a> for copying conditions.
275 Comments and suggestions are welcome, and may be sent to
276 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.