OSDN Git Service

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