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