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