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">
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>
17
18<h1 class="centered"><a name="top">Interesting <code>configure</code>
19options</a></h1>
20
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>
26
27<p><em>
28   To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
29</em></p>
30
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>
46
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>
56
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
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>
87
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>
93
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>
101
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>
107
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>
118
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>
127
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
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>
144
145 <dt><code>--enable-cheaders=OPTION  </code></dt>
146 <dd><p>This allows the user to define what kind of C headers are
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.
149     </p>
150 </dd>
151
152 <dt><code>--enable-threads  </code></dt>
153 <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
154        (described next). This option can change the library ABI.
155     </p>
156 </dd>
157
158 <dt><code>--enable-threads=OPTION  </code></dt>
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>.
162     </p>
163 </dd>
164
165 <dt><code>--enable-libstdcxx-debug  </code></dt>
166 <dd><p>Build separate debug libraries in addition to what is normally built.
167        By default, the debug libraries are compiled with
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.
172     </p>
173     <p>Note this make command, executed in
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>
177     </p>
178 </dd>
179
180 <dt><code>--enable-libstdcxx-debug-flags=FLAGS</code></dt>
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>
189  --enable-libstdcxx-debug-flags='-g3 -O1 -gdwarf-2'</pre>
190 </dd>
191
192 <dt><code>--enable-cxx-flags=FLAGS</code></dt>
193 <dd><p>With this option, you can pass a string of -f (functionality)
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
197     </p>
198        <pre>
199  --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
200     <p>
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.
204     </p>
205     <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
206        the 'make' environment is that, if files are automatically
207        rebuilt, the same flags will be used when compiling those files
208        as well, so that everything matches.
209     </p>
210     <p>Fun flags to try might include combinations of
211     </p>
212        <pre>
213  -fstrict-aliasing
214  -fno-exceptions
215  -ffunction-sections
216  -fvtable-gc</pre>
217     <p>and opposite forms (-fno-) of the same.  Tell us (the libstdc++
218        mailing list) if you discover more!
219     </p>
220 </dd>
221
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
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.
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.
259     </p>
260 </dd>
261
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
270 <dt><code>--enable-concept-checks  </code></dt>
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>
277 </dd>
278
279 <dt><code>--enable-symvers[=style]  </code></dt>
280
281 <dd><p>In 3.1 and later, tries to turn on symbol versioning in the
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 correct defaults for the host system, probe to see if
289        additional requirements are necessary and present for
290        activation, and if so, will turn symbol versioning on. This
291        option can change the library ABI.
292     </p>
293
294 </dd>
295
296 <dt><code>--enable-visibility  </code></dt>
297 <dd><p> In 4.2 and later, enables or disables visibility attributes.
298        If enabled (as by default), and the compiler seems capable of
299        passing the simple sanity checks thrown at it, adjusts items
300        in namespace std, namespace std::tr1, and namespace __gnu_cxx
301        so that -fvisibility options work.
302    </p>
303 </dd>
304
305 <dt><code>--enable-libstdcxx-pch  </code></dt>
306 <dd><p>In 3.4 and later, tries to turn on the generation of
307        stdc++.h.gch, a pre-compiled file including all the standard
308        C++ includes. If enabled (as by default), and the compiler
309        seems capable of passing the simple sanity checks thrown at
310        it, try to build stdc++.h.gch as part of the make process.
311        In addition, this generated file is used later on (by appending <code>
312        --include bits/stdc++.h </code> to CXXFLAGS) when running the
313        testsuite.
314     </p>
315 </dd>
316
317 <dt><code>--disable-hosted-libstdcxx  </code></dt>
318 <dd><p>By default, a complete <em>hosted</em> C++ library is built.  The
319        C++ Standard also describes a <em>freestanding</em> environment,
320        in which only a minimal set of headers are provided.  This option
321        builds such an environment.
322     </p>
323 </dd>
324</dl>
325<p>Return <a href="#top">to the top of the page</a> or
326   <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
327</p>
328
329
330<!-- ####################################################### -->
331
332<hr />
333<p class="fineprint"><em>
334See <a href="17_intro/license.html">license.html</a> for copying conditions.
335Comments and suggestions are welcome, and may be sent to
336<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
337</em></p>
338
339
340</body>
341</html>
342