xref: /openbsd-src/gnu/gcc/libstdc++-v3/docs/html/configopts.html (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1*404b540aSrobert<?xml version="1.0" encoding="ISO-8859-1"?>
2*404b540aSrobert<!DOCTYPE html
3*404b540aSrobert          PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4*404b540aSrobert          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5*404b540aSrobert
6*404b540aSrobert<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7*404b540aSrobert<head>
8*404b540aSrobert   <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
9*404b540aSrobert   <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
10*404b540aSrobert   <meta name="DESCRIPTION" content="Configuration options for libstdc++-v3." />
11*404b540aSrobert   <meta name="GENERATOR" content="vi and eight fingers" />
12*404b540aSrobert   <title>libstdc++-v3 configure options</title>
13*404b540aSrobert<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
14*404b540aSrobert<link rel="Copyright" href="17_intro/license.html" type="text/html" />
15*404b540aSrobert</head>
16*404b540aSrobert<body>
17*404b540aSrobert
18*404b540aSrobert<h1 class="centered"><a name="top">Interesting <code>configure</code>
19*404b540aSrobertoptions</a></h1>
20*404b540aSrobert
21*404b540aSrobert<p class="fineprint"><em>
22*404b540aSrobert   The latest version of this document is always available at
23*404b540aSrobert   <a href="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
24*404b540aSrobert   http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</a>.
25*404b540aSrobert</em></p>
26*404b540aSrobert
27*404b540aSrobert<p><em>
28*404b540aSrobert   To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
29*404b540aSrobert</em></p>
30*404b540aSrobert
31*404b540aSrobert<!-- ####################################################### -->
32*404b540aSrobert<hr />
33*404b540aSrobert<p>Here are some of the non-obvious options to libstdc++'s configure.
34*404b540aSrobert   Keep in mind that
35*404b540aSrobert   <!-- This SECnn should be the "Choosing Package Options" section. -->
36*404b540aSrobert   <a href="http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_131.html#SEC131">they
37*404b540aSrobert   all have opposite forms as well</a>
38*404b540aSrobert   (enable/disable and with/without).  The defaults are for <strong>current
39*404b540aSrobert   development sources</strong>, which may be different than those for
40*404b540aSrobert   released versions.
41*404b540aSrobert</p>
42*404b540aSrobert<p>The canonical way to find out the configure options that are
43*404b540aSrobert   available for a given set of libstdc++ sources is to go to the
44*404b540aSrobert   source directory and then type:<code>  ./configure --help</code>
45*404b540aSrobert</p>
46*404b540aSrobert
47*404b540aSrobert<dl>
48*404b540aSrobert <dt><code>--enable-multilib  </code>[default]</dt>
49*404b540aSrobert <dd><p>This is part of the generic multilib support for building cross
50*404b540aSrobert        compilers.  As such, targets like &quot;powerpc-elf&quot; will have
51*404b540aSrobert        libstdc++ built many different ways:  &quot;-msoft-float&quot;
52*404b540aSrobert        and not, etc.  A different libstdc++ will be built for each of
53*404b540aSrobert        the different multilib versions.  This option is on by default.
54*404b540aSrobert     </p>
55*404b540aSrobert </dd>
56*404b540aSrobert
57*404b540aSrobert <dt><code>--enable-sjlj-exceptions  </code></dt>
58*404b540aSrobert <dd><p>Forces old, set-jump/long-jump exception handling model.  If
59*404b540aSrobert        at all possible, the new, frame unwinding exception handling routines
60*404b540aSrobert        should be used instead, as they significantly reduce both
61*404b540aSrobert        runtime memory usage and executable size. This option can
62*404b540aSrobert        change the library ABI.
63*404b540aSrobert     </p>
64*404b540aSrobert </dd>
65*404b540aSrobert
66*404b540aSrobert <dt><code>--enable-version-specific-runtime-libs  </code></dt>
67*404b540aSrobert <dd><p>Specify that run-time libraries should be installed in the
68*404b540aSrobert        compiler-specific subdirectory (i.e.,
69*404b540aSrobert        <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
70*404b540aSrobert        instead of <code>${libdir}</code>.  This option is useful if you
71*404b540aSrobert        intend to use several versions of gcc in parallel.  In addition,
72*404b540aSrobert        libstdc++'s include files will be installed in
73*404b540aSrobert        <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
74*404b540aSrobert        unless you also specify
75*404b540aSrobert       <code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
76*404b540aSrobert     </p>
77*404b540aSrobert </dd>
78*404b540aSrobert
79*404b540aSrobert <dt><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code></dt>
80*404b540aSrobert <dd><p>Adds support for named libstdc++ include directory.  For instance,
81*404b540aSrobert        the following puts all the libstdc++ headers into a directory
82*404b540aSrobert        called &quot;2.97-20001008&quot; instead of the usual
83*404b540aSrobert        &quot;c++/(version)&quot;.
84*404b540aSrobert     </p>
85*404b540aSrobert        <pre>
86*404b540aSrobert   --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
87*404b540aSrobert
88*404b540aSrobert <dt><code>--enable-cstdio  </code></dt>
89*404b540aSrobert <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
90*404b540aSrobert        (described next). This option can change the library ABI.
91*404b540aSrobert     </p>
92*404b540aSrobert </dd>
93*404b540aSrobert
94*404b540aSrobert <dt><code>--enable-cstdio=OPTION  </code></dt>
95*404b540aSrobert <dd><p>Select a target-specific I/O package. At the moment, the only
96*404b540aSrobert        choice is to use 'stdio', a generic &quot;C&quot; abstraction.
97*404b540aSrobert        The default is 'stdio'.  A longer explanation is <a
98*404b540aSrobert        href="explanations.html#cstdio">here</a>.
99*404b540aSrobert     </p>
100*404b540aSrobert </dd>
101*404b540aSrobert
102*404b540aSrobert <dt><code>--enable-clocale  </code></dt>
103*404b540aSrobert <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
104*404b540aSrobert        (described next). This option can change the library ABI.
105*404b540aSrobert     </p>
106*404b540aSrobert </dd>
107*404b540aSrobert
108*404b540aSrobert <dt><code>--enable-clocale=OPTION  </code></dt>
109*404b540aSrobert <dd><p>Select a target-specific underlying locale package.  The
110*404b540aSrobert        choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
111*404b540aSrobert        (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
112*404b540aSrobert        'gnu' to specify a model based on functionality from the GNU C
113*404b540aSrobert        library (langinfo/iconv/gettext) (from <a
114*404b540aSrobert        href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
115*404b540aSrobert        library), or 'generic' to use a generic &quot;C&quot;
116*404b540aSrobert        abstraction which consists of &quot;C&quot; locale info.
117*404b540aSrobert     </p>
118*404b540aSrobert
119*404b540aSrobert     <p>As part of the configuration process, the "C" library is
120*404b540aSrobert      probed both for sufficient vintage, and installed locale
121*404b540aSrobert      data. If either of these elements are not present, the C++
122*404b540aSrobert      locale model default to 'generic.' On glibc-based systems of
123*404b540aSrobert      version 2.2.5 and above with installed locale files, 'gnu' is
124*404b540aSrobert      automatically selected.
125*404b540aSrobert     </p>
126*404b540aSrobert </dd>
127*404b540aSrobert
128*404b540aSrobert <dt><code>--enable-libstdcxx-allocator  </code></dt>
129*404b540aSrobert <dd><p>This is an abbreviated form of
130*404b540aSrobert        <code>'--enable-libstdcxx-allocator=auto'</code> (described
131*404b540aSrobert        next). This option can change the library ABI.
132*404b540aSrobert     </p>
133*404b540aSrobert </dd>
134*404b540aSrobert
135*404b540aSrobert <dt><code>--enable-libstdcxx-allocator=OPTION  </code></dt>
136*404b540aSrobert <dd><p>Select a target-specific underlying std::allocator.  The
137*404b540aSrobert        choices are 'new' to specify a wrapper for new, 'malloc' to
138*404b540aSrobert        specify a wrapper for malloc, 'mt' for a fixed power of two allocator
139*404b540aSrobert        (<a href="ext/mt_allocator.html">documented</a> under extensions),
140*404b540aSrobert	'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator.
141*404b540aSrobert	This option can change the library ABI.
142*404b540aSrobert     </p>
143*404b540aSrobert </dd>
144*404b540aSrobert
145*404b540aSrobert <dt><code>--enable-cheaders=OPTION  </code></dt>
146*404b540aSrobert <dd><p>This allows the user to define what kind of C headers are
147*404b540aSrobert        used.  Options are c and c_std.  These correspond to the source
148*404b540aSrobert	directory's include/c and include/c_std.  The default is c_std.
149*404b540aSrobert     </p>
150*404b540aSrobert </dd>
151*404b540aSrobert
152*404b540aSrobert <dt><code>--enable-threads  </code></dt>
153*404b540aSrobert <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
154*404b540aSrobert        (described next). This option can change the library ABI.
155*404b540aSrobert     </p>
156*404b540aSrobert </dd>
157*404b540aSrobert
158*404b540aSrobert <dt><code>--enable-threads=OPTION  </code></dt>
159*404b540aSrobert <dd><p>Select a threading library.  A full description is given in the
160*404b540aSrobert        general <a href="http://gcc.gnu.org/install/configure.html">compiler
161*404b540aSrobert        configuration instructions</a>.
162*404b540aSrobert     </p>
163*404b540aSrobert </dd>
164*404b540aSrobert
165*404b540aSrobert <dt><code>--enable-libstdcxx-debug  </code></dt>
166*404b540aSrobert <dd><p>Build separate debug libraries in addition to what is normally built.
167*404b540aSrobert        By default, the debug libraries are compiled with
168*404b540aSrobert        <code> CXXFLAGS='-g3 -O0'</code>
169*404b540aSrobert        , are installed in <code>${libdir}/debug</code>, and have the
170*404b540aSrobert        same names and versioning information as the non-debug
171*404b540aSrobert        libraries. This option is off by default.
172*404b540aSrobert     </p>
173*404b540aSrobert     <p>Note this make command, executed in
174*404b540aSrobert        the build directory, will do much the same thing, without the
175*404b540aSrobert        configuration difference and without building everything twice:
176*404b540aSrobert        <code>make CXXFLAGS='-g3 -O0' all</code>
177*404b540aSrobert     </p>
178*404b540aSrobert </dd>
179*404b540aSrobert
180*404b540aSrobert <dt><code>--enable-libstdcxx-debug-flags=FLAGS</code></dt>
181*404b540aSrobert
182*404b540aSrobert <dd><p>This option is only valid when <code> --enable-debug </code>
183*404b540aSrobert        is also specified, and applies to the debug builds only. With
184*404b540aSrobert        this option, you can pass a specific string of flags to the
185*404b540aSrobert        compiler to use when building the debug versions of libstdc++.
186*404b540aSrobert        FLAGS is a quoted string of options, like
187*404b540aSrobert     </p>
188*404b540aSrobert        <pre>
189*404b540aSrobert  --enable-libstdcxx-debug-flags='-g3 -O1 -gdwarf-2'</pre>
190*404b540aSrobert </dd>
191*404b540aSrobert
192*404b540aSrobert <dt><code>--enable-cxx-flags=FLAGS</code></dt>
193*404b540aSrobert <dd><p>With this option, you can pass a string of -f (functionality)
194*404b540aSrobert        flags to the compiler to use when building libstdc++. This
195*404b540aSrobert        option can change the library ABI. FLAGS is a quoted string of
196*404b540aSrobert        options, like
197*404b540aSrobert     </p>
198*404b540aSrobert        <pre>
199*404b540aSrobert  --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
200*404b540aSrobert     <p>
201*404b540aSrobert        Note that the flags don't necessarily have to all be -f flags,
202*404b540aSrobert        as shown, but usually those are the ones that will make sense
203*404b540aSrobert        for experimentation and configure-time overriding.
204*404b540aSrobert     </p>
205*404b540aSrobert     <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
206*404b540aSrobert        the 'make' environment is that, if files are automatically
207*404b540aSrobert        rebuilt, the same flags will be used when compiling those files
208*404b540aSrobert        as well, so that everything matches.
209*404b540aSrobert     </p>
210*404b540aSrobert     <p>Fun flags to try might include combinations of
211*404b540aSrobert     </p>
212*404b540aSrobert        <pre>
213*404b540aSrobert  -fstrict-aliasing
214*404b540aSrobert  -fno-exceptions
215*404b540aSrobert  -ffunction-sections
216*404b540aSrobert  -fvtable-gc</pre>
217*404b540aSrobert     <p>and opposite forms (-fno-) of the same.  Tell us (the libstdc++
218*404b540aSrobert        mailing list) if you discover more!
219*404b540aSrobert     </p>
220*404b540aSrobert </dd>
221*404b540aSrobert
222*404b540aSrobert <dt><code>--enable-c99  </code></dt>
223*404b540aSrobert <dd><p>The &quot;long long&quot; type was introduced in C99, along
224*404b540aSrobert        with many other functions for wide characters, and math
225*404b540aSrobert        classification macros, etc.  If enabled, all C99 functions not
226*404b540aSrobert        specified by the C++ standard will be put into <code>namespace
227*404b540aSrobert        __gnu_cxx</code>, and then all these names will
228*404b540aSrobert        be injected into namespace std, so that C99 functions can be
229*404b540aSrobert        used &quot;as if&quot; they were in the C++ standard (as they
230*404b540aSrobert        will eventually be in some future revision of the standard,
231*404b540aSrobert        without a doubt).  By default, C99 support is on, assuming the
232*404b540aSrobert        configure probes find all the necessary functions and bits
233*404b540aSrobert        necessary. This option can change the library ABI.
234*404b540aSrobert    </p>
235*404b540aSrobert </dd>
236*404b540aSrobert
237*404b540aSrobert <dt><code>--enable-wchar_t  </code>[default]</dt>
238*404b540aSrobert <dd><p>Template specializations for the &quot;wchar_t&quot; type are
239*404b540aSrobert        required for wide character conversion support.  Disabling
240*404b540aSrobert        wide character specializations may be expedient for initial
241*404b540aSrobert        porting efforts, but builds only a subset of what is required by
242*404b540aSrobert        ISO, and is not recommended.  By default, this option is on.
243*404b540aSrobert        This option can change the library ABI.
244*404b540aSrobert     </p>
245*404b540aSrobert </dd>
246*404b540aSrobert
247*404b540aSrobert <dt><code>--enable-long-long  </code></dt>
248*404b540aSrobert <dd><p>The &quot;long long&quot; type was introduced in C99.  It is
249*404b540aSrobert        provided as a GNU extension to C++98 in g++.  This flag builds
250*404b540aSrobert        support for &quot;long long&quot; into the library (specialized
251*404b540aSrobert        templates and the like for iostreams).  This option is on by default:
252*404b540aSrobert        if enabled, users will have to either use the new-style &quot;C&quot;
253*404b540aSrobert        headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
254*404b540aSrobert        or add appropriate compile-time flags to all compile lines to
255*404b540aSrobert        allow &quot;C&quot; visibility of this feature (on GNU/Linux,
256*404b540aSrobert        the flag is -D_ISOC99_SOURCE, which is added automatically via
257*404b540aSrobert        CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
258*404b540aSrobert        This option can change the library ABI.
259*404b540aSrobert     </p>
260*404b540aSrobert </dd>
261*404b540aSrobert
262*404b540aSrobert <dt><code>--enable-fully-dynamic-string  </code></dt>
263*404b540aSrobert <dd><p>This option enables a special version of basic_string avoiding
264*404b540aSrobert        the optimization that allocates empty objects in static memory.
265*404b540aSrobert	Mostly useful together with shared memory allocators, see PR
266*404b540aSrobert	libstdc++/16612 for details.
267*404b540aSrobert     </p>
268*404b540aSrobert </dd>
269*404b540aSrobert
270*404b540aSrobert <dt><code>--enable-concept-checks  </code></dt>
271*404b540aSrobert <dd><p>This turns on additional compile-time checks for instantiated
272*404b540aSrobert        library templates, in the form of specialized templates,
273*404b540aSrobert        <a href="19_diagnostics/howto.html#3">described here</a>.  They
274*404b540aSrobert        can help users discover when they break the rules of the STL, before
275*404b540aSrobert        their programs run.
276*404b540aSrobert     </p>
277*404b540aSrobert </dd>
278*404b540aSrobert
279*404b540aSrobert <dt><code>--enable-symvers[=style]  </code></dt>
280*404b540aSrobert
281*404b540aSrobert <dd><p>In 3.1 and later, tries to turn on symbol versioning in the
282*404b540aSrobert        shared library (if a shared library has been
283*404b540aSrobert        requested). Values for 'style' that are currently supported
284*404b540aSrobert        are 'gnu', 'gnu-versioned-namespace', 'darwin', and
285*404b540aSrobert        'darwin-export'. Both gnu- options require that a recent
286*404b540aSrobert        version of the GNU linker be in use. Both darwin options are
287*404b540aSrobert        equivalent. With no style given, the configure script will try
288*404b540aSrobert        to guess correct defaults for the host system, probe to see if
289*404b540aSrobert        additional requirements are necessary and present for
290*404b540aSrobert        activation, and if so, will turn symbol versioning on. This
291*404b540aSrobert        option can change the library ABI.
292*404b540aSrobert     </p>
293*404b540aSrobert
294*404b540aSrobert </dd>
295*404b540aSrobert
296*404b540aSrobert <dt><code>--enable-visibility  </code></dt>
297*404b540aSrobert <dd><p> In 4.2 and later, enables or disables visibility attributes.
298*404b540aSrobert        If enabled (as by default), and the compiler seems capable of
299*404b540aSrobert        passing the simple sanity checks thrown at it, adjusts items
300*404b540aSrobert        in namespace std, namespace std::tr1, and namespace __gnu_cxx
301*404b540aSrobert        so that -fvisibility options work.
302*404b540aSrobert    </p>
303*404b540aSrobert </dd>
304*404b540aSrobert
305*404b540aSrobert <dt><code>--enable-libstdcxx-pch  </code></dt>
306*404b540aSrobert <dd><p>In 3.4 and later, tries to turn on the generation of
307*404b540aSrobert        stdc++.h.gch, a pre-compiled file including all the standard
308*404b540aSrobert        C++ includes. If enabled (as by default), and the compiler
309*404b540aSrobert        seems capable of passing the simple sanity checks thrown at
310*404b540aSrobert        it, try to build stdc++.h.gch as part of the make process.
311*404b540aSrobert        In addition, this generated file is used later on (by appending <code>
312*404b540aSrobert        --include bits/stdc++.h </code> to CXXFLAGS) when running the
313*404b540aSrobert        testsuite.
314*404b540aSrobert     </p>
315*404b540aSrobert </dd>
316*404b540aSrobert
317*404b540aSrobert <dt><code>--disable-hosted-libstdcxx  </code></dt>
318*404b540aSrobert <dd><p>By default, a complete <em>hosted</em> C++ library is built.  The
319*404b540aSrobert        C++ Standard also describes a <em>freestanding</em> environment,
320*404b540aSrobert        in which only a minimal set of headers are provided.  This option
321*404b540aSrobert        builds such an environment.
322*404b540aSrobert     </p>
323*404b540aSrobert </dd>
324*404b540aSrobert</dl>
325*404b540aSrobert<p>Return <a href="#top">to the top of the page</a> or
326*404b540aSrobert   <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
327*404b540aSrobert</p>
328*404b540aSrobert
329*404b540aSrobert
330*404b540aSrobert<!-- ####################################################### -->
331*404b540aSrobert
332*404b540aSrobert<hr />
333*404b540aSrobert<p class="fineprint"><em>
334*404b540aSrobertSee <a href="17_intro/license.html">license.html</a> for copying conditions.
335*404b540aSrobertComments and suggestions are welcome, and may be sent to
336*404b540aSrobert<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
337*404b540aSrobert</em></p>
338*404b540aSrobert
339*404b540aSrobert
340*404b540aSrobert</body>
341*404b540aSrobert</html>
342