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>The latest version of this document is always available at
21 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
22 http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</a>.
25 <p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
28 <!-- ####################################################### -->
30 <p>Here are some of the non-obvious options to libstdc++'s configure.
32 <!-- This SECnn should be the "Choosing Package Options" section. -->
33 <a href="http://www.gnu.org/manual/autoconf/html_node/Package-Options.html#Package%20Options">they
34 all have opposite forms as well</a>
35 (enable/disable and with/without). The defaults are for current
38 <p>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:<code> ./configure --help</code>
44 <dt><code>--enable-multilib </code>[default]</dt>
45 <dd><p>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.
53 <dt><code>--enable-sjlj-exceptions </code></dt>
54 <dd><p>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.
62 <dt><code>--enable-version-specific-runtime-libs </code></dt>
63 <dd><p>Specify that run-time libraries should be installed in the
64 compiler-specific subdirectory (i.e.,
65 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
66 instead of <code>${libdir}</code>. 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 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
70 unless you also specify
71 <code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
75 <dt><code>--with-gxx-include-dir=<include-files dir></code></dt>
76 <dd><p>Adds support for named libstdc++ include directory. For instance,
77 the following puts all the libstdc++ headers into a directory
78 called "2.97-20001008" instead of the usual
79 "c++/(version)".
82 --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
84 <dt><code>--enable-cstdio </code></dt>
85 <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
86 (described next). This option can change the library ABI.
90 <dt><code>--enable-cstdio=OPTION </code></dt>
91 <dd><p>Select a target-specific I/O package. As of libstdc++-v3
92 snapshot 3.0.96, the choices are 'libio' to specify the GNU
94 <a href="http://sources.redhat.com/glibc/">glibc</a>, the
95 GNU C library), or 'stdio' to use a generic "C"
96 abstraction. The default is 'stdio'. A longer explanation
97 is <a href="explanations.html#cstdio">here</a>.
101 <dt><code>--enable-clocale </code></dt>
102 <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
103 (described next). This option can change the library ABI.
107 <dt><code>--enable-clocale=OPTION </code></dt>
108 <dd><p>Select a target-specific underlying locale package. The
109 choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
110 (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
111 'gnu' to specify a model based on functionality from the GNU C
112 library (langinfo/iconv/gettext) (from <a
113 href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
114 library), or 'generic' to use a generic "C"
115 abstraction which consists of "C" locale info.
118 <p>As part of the configuration process, the "C" library is
119 probed both for sufficient vintage, and installed locale
120 data. If either of these elements are not present, the C++
121 locale model default to 'generic.' On glibc-based systems of
122 version 2.2.5 and above with installed locale files, 'gnu' is
123 automatically selected.
127 <dt><code>--enable-cheaders=OPTION </code></dt>
128 <dd><p>This allows the user to define what kind of C headers are
129 used. Options are: c, c_std, and c_shadow. These correspond
130 to the source directory's include/c, include/c_std, and
131 include/c_shadow directories. The default is c_std.
135 <dt><code>--enable-threads </code></dt>
136 <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
137 (described next). This option can change the library ABI.
141 <dt><code>--enable-threads=OPTION </code></dt>
142 <dd><p>Select a threading library. A full description is given in the
143 general <a href="http://gcc.gnu.org/install/configure.html">compiler
144 configuration instructions</a>.
148 <dt><code>--enable-debug </code></dt>
149 <dd><p>Build separate debug libraries in addition to what is normally built.
150 By default, the debug libraries are compiled with
151 <code> CXXFLAGS='-g3 -O0'</code>
152 , are installed in <code>${libdir}/debug</code>, and have the
153 same names and versioning information as the non-debug
154 libraries. This option is off by default.
156 Note this make command, executed in
157 the build directory, will do much the same thing, without the
158 configuration difference and without building everything twice:
159 <code>make CXXFLAGS='-g3 -O0' all</code>
164 <dt><code>--enable-debug-flags=FLAGS</code></dt>
166 <dd><p>This option is only valid when <code> --enable-debug </code>
167 is also specified, and applies to the debug builds only. With
168 this option, you can pass a specific string of flags to the
169 compiler to use when building the debug versions of libstdc++.
170 FLAGS is a quoted string of options, like
173 --enable-debug-flags='-g3 -O1 -gdwarf-2'</pre>
176 <dt><code>--enable-cxx-flags=FLAGS</code></dt>
177 <dd><p>With this option, you can pass a string of -f (functionality)
178 flags to the compiler to use when building libstdc++. This
179 option can change the library ABI. FLAGS is a quoted string of
183 --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
185 Note that the flags don't necessarily have to all be -f flags,
186 as shown, but usually those are the ones that will make sense
187 for experimentation and configure-time overriding.
189 <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
190 the 'make' environment is that, if files are automatically
191 rebuilt, the same flags will be used when compiling those files
192 as well, so that everything matches.
194 <p>Fun flags to try might include combinations of
201 <p>and opposite forms (-fno-) of the same. Tell us (the libstdc++
202 mailing list) if you discover more!
206 <dt><code>--enable-c99 </code></dt>
207 <dd><p>The "long long" type was introduced in C99, along
208 with many other functions for wide characters, and math
209 classification macros, etc. If enabled, all C99 functions not
210 specified by the C++ standard will be put into <code>namespace
211 __gnu_cxx</code>, and then all these names will
212 be injected into namespace std, so that C99 functions can be
213 used "as if" they were in the C++ standard (as they
214 will eventually be in some future revision of the standard,
215 without a doubt). By default, C99 support is on, assuming the
216 configure probes find all the necessary functions and bits
217 necessary. This option can change the library ABI.
221 <dt><code>--enable-c-mbchar </code>[default]</dt>
222 <dd><p>Certain template specializations are required for wide
223 character conversion support. This is tricky and currently
224 changing rapidly, and can cause problems on new platforms.
225 Disabling wide character specializations is useful for initial
226 porting steps, but builds only a subset of what is required by
227 ISO. By default, this option is on. This option can change
232 <dt><code>--enable-long-long </code></dt>
233 <dd><p>The "long long" type was introduced in C99. It is
234 provided as a GNU extension to C++98 in g++. This flag builds
235 support for "long long" into the library (specialized
236 templates and the like for iostreams). This option is on by default:
237 if enabled, users will have to either use the new-style "C"
238 headers by default (i.e., <cmath> not <math.h>)
239 or add appropriate compile-time flags to all compile lines to
240 allow "C" visibility of this feature (on GNU/Linux,
241 the flag is -D_ISOC99_SOURCE, which is added automatically via
242 CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
243 This option can change the library ABI.
247 <dt><code>--enable-concept-checks </code></dt>
248 <dd><p>This turns on additional compile-time checks for instantiated
249 library templates, in the form of specialized templates,
250 <a href="19_diagnostics/howto.html#3">described here</a>. They
251 can help users discover when they break the rules of the STL, before
256 <dt><code>--enable-symvers[=style] </code></dt>
257 <dd><p>In 3.1 and later, tries to turn on symbol versioning in the
258 shared library (if a shared library has been requested). The
259 only 'style' currently supported is 'gnu' which requires that
260 a recent version of the GNU linker be in use. With no style
261 given, the configure script will try to guess if the 'gnu'
262 style can be used, and if so, will turn it on. Hopefully
263 people will volunteer to do other 'style' options.
267 <p>Return <a href="#top">to the top of the page</a> or
268 <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
272 <!-- ####################################################### -->
275 <p class="fineprint"><em>
276 See <a href="17_intro/license.html">license.html</a> for copying conditions.
277 Comments and suggestions are welcome, and may be sent to
278 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.