OSDN Git Service

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