1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
4 <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
5 <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++">
6 <meta name="DESCRIPTION" content="Configuration options for libstdc++-v3.">
7 <meta name="GENERATOR" content="vi and eight fingers">
8 <title>libstdc++-v3 configure options</title>
9 <link rel="StyleSheet" href="lib3styles.css">
13 <h1 class="centered"><a name="top">Interesting <code>configure</code>
16 <p>The latest version of this document is always available at
17 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
18 http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</a>.
21 <p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
24 <!-- ####################################################### -->
26 <p>Here are some of the non-obvious options to libstdc++'s configure.
28 <!-- This SECnn should be the "Choosing Package Options" section. -->
29 <a href="http://sources.redhat.com/autoconf/autoconf.html#SEC74">they
30 all have opposite forms as well</a>
31 (enable/disable and with/without). The defaults are for current
34 <p>The canonical way to find out the configure options that are
35 available for a given set of libstdc++ sources is to go to the
36 source directory and then type:<code> ./configure --help</code>
39 <dt><code>--enable-multilib </code>[default]
40 <dd><p>This is part of the generic multilib support for building cross
41 compilers. As such, targets like "powerpc-elf" will have
42 libstdc++ built many different ways: "-msoft-float"
43 and not, etc. A different libstdc++ will be built for each of
44 the different multilib versions. This option is on by default.
47 <dt><code>--enable-debug </code>
48 <dd><p>The configure script will automatically detect the highest
49 level of optimization that the compiler in use can use
50 (certain versions of g++ will ICE if given the <code>-O2</code>
51 option, but this is fixed in later versions of the compiler).
52 This --enable flag will disable all optimizations and instruct
53 the compiler to emit as much extra debugging information as it
54 can, for use inside GDB. Note this make command, executed in
55 the build directory, will do much the same thing, without the
56 configuration difference:<code>make CXXFLAGS='-g -O0' all</code>
59 <dt><code>--enable-cstdio </code>
60 <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
64 <dt><code>--enable-cstdio=LIB </code>
65 <dd><p>Select a target-specific I/O package. As of libstdc++-v3
66 snapshot 3.0.96, the choices are 'libio' to specify the GNU
68 <a href="http://sources.redhat.com/glibc/">glibc</a>, the
69 GNU C library), or 'stdio' to use a generic "C"
70 abstraction. The default is 'stdio'. A longer explanation
71 is <a href="explanations.html#cstdio">here</a>.
74 <dt><code>--enable-sjlj-exceptions </code>
75 <dd><p>Forces old, set-jump/long-jump exception handling model. If
76 at all possible, the new, frame unwinding exception handling routines
77 should be used instead, as they significantly reduce both runtime
78 memory usage and executable size.
81 <dt><code>--enable-clocale </code>
82 <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
86 <dt><code>--enable-clocale=MODEL </code>
87 <dd><p>Select a target-specific underlying locale package. The
88 choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
89 (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
90 'gnu' to specify a model based on functionality from the GNU C
91 library (langinfo/iconv/gettext) (from <A
92 href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
93 library), or 'generic' to use a generic "C"
94 abstraction which consists of "C" locale info. The
98 <dt><code>--enable-c99 </code>
99 <dd><p>The "long long" type was introduced in C99, along
100 with many other functions for wide characters, and math
101 classification macros, etc. If enabled, all C99 functions not
102 specified by the C++ standard will be put into <code>namespace
103 __gnu_cxx</code>, and then all these names will
104 be injected into namespace std, so that C99 functions can be
105 used "as if" they were in the C++ standard (as they
106 will eventually be in some future revision of the standard,
107 without a doubt). By default, C99 support is on, assuming the
108 configure probes find all the necessary functions and bits
112 <dt><code>--enable-long-long </code>
113 <dd><p>The "long long" type was introduced in C99. It is
114 provided as a GNU extension to C++98 in g++. This flag builds
115 support for "long long" into the library (specialized
116 templates and the like for iostreams). This option is on by default:
117 if enabled, users will have to either use the new-style "C"
118 headers by default (i.e., <cmath> not <math.h>)
119 or add appropriate compile-time flags to all compile lines to
120 allow "C" visibility of this feature (on GNU/Linux,
121 the flag is -D_ISOC99_SOURCE, which is added automatically via
122 CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
125 <dt><code>--enable-cheaders=OPTION </code>
126 <dd><p>This allows the user to define what kind of C headers are
127 used. Options are: c, c_std, and c_shadow. These correspond
128 to the source directory's include/c, include/c_std, and
129 include/c_shadow directories. The default is c_std.
132 <dt><code>--enable-threads </code>
133 <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
137 <dt><code>--enable-threads=LIB </code>
138 <dd><p>Select a threading library. A full description is given in the
139 general <a href="http://gcc.gnu.org/install/configure.html">compiler
140 configuration instructions</a>.
143 <dt><code>--enable-version-specific-runtime-libs </code>
144 <dd><p>Specify that run-time libraries should be installed in the
145 compiler-specific subdirectory (i.e.,
146 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
147 instead of <code>${libdir}</code>. This option is useful if you
148 intend to use several versions of gcc in parallel. In addition,
149 libstdc++'s include files will be installed in
150 <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
151 unless you also specify
152 <code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
155 <dt><code>--with-gxx-include-dir=<include-files dir></code>
156 <dd><p>Adds support for named libstdc++ include directory. For instance,
157 the following puts all the libstdc++ headers into a directory
158 called "2.97-20001008" instead of the usual
161 --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre>
164 <dt><code>--enable-cxx-flags=FLAGS</code>
165 <dd><p>With this option, you can pass a string of -f (functionality)
166 flags to the compiler to use when building libstdc++. FLAGS
167 is a quoted string of options, like
169 --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
170 Note that the flags don't necessarily have to all be -f flags,
171 as shown, but usually those are the ones that will make sense
172 for experimentation and configure-time overriding.
174 <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
175 the 'make' environment is that, if files are automatically
176 rebuilt, the same flags will be used when compiling those files
177 as well, so that everything matches.
179 <p>Fun flags to try might include combinations of
185 and opposite forms (-fno-) of the same. Tell us (the libstdc++
186 mailing list) if you discover more!
189 <dt><code>--enable-c-mbchar </code>[default]
190 <dd><p>Certain template specializations are required for wide
191 character conversion support. This is tricky and currently
192 changing rapidly, and can cause problems on new platforms.
193 Disabling wide character specializations is useful for initial
194 porting steps, but builds only a subset of what is required by
195 ISO. By default, this option is on.
198 <dt><code>--enable-concept-checks </code>
199 <dd><p>This turns on additional compile-time checks for instantiated
200 library templates, in the form of specialized templates,
201 <a href="19_diagnostics/howto.html#3">described here</a>. They
202 can help users discover when they break the rules of the STL, before
206 <dt><code>--enable-symvers[=style] </code>
207 <dd><p>In 3.1, tries to turn on symbol versioning in the shared library (if a
208 shared library has been requested). The only 'style' currently
209 supported is 'gnu' which requires that a recent version of the GNU
210 linker be in use. With no style given, the configure script will
211 try to guess if the 'gnu' style can be used, and if so, will turn it
212 on. Hopefully people will volunteer to do other 'style' options.
216 <p>Return <a href="#top">to the top of the page</a> or
217 <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
221 <!-- ####################################################### -->
224 <p class="fineprint"><em>
225 See <a href="17_intro/license.html">license.html</a> for copying conditions.
226 Comments and suggestions are welcome, and may be sent to
227 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.