OSDN Git Service

2011-05-02 Jonathan Wakely <jwakely.gcc@gmail.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / doc / html / manual / configure.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Configure</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10;      ISO C++&#10;    , &#10;      configure&#10;    , &#10;      options&#10;    "/><meta name="keywords" content="&#10;      ISO C++&#10;    , &#10;      library&#10;    "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="setup.html" title="Chapter 2. Setup"/><link rel="prev" href="setup.html" title="Chapter 2. Setup"/><link rel="next" href="make.html" title="Make"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configure</th></tr><tr><td align="left"><a accesskey="p" href="setup.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td align="right"> <a accesskey="n" href="make.html">Next</a></td></tr></table><hr/></div><div class="section" title="Configure"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup.configure"/>Configure</h2></div></div></div><p>
4   When configuring libstdc++, you'll have to configure the entire
5   <span class="emphasis"><em>gccsrcdir</em></span> directory. Consider using the
6   toplevel gcc configuration option
7   <code class="literal">--enable-languages=c++</code>, which saves time by only
8   building the C++ toolchain.
9 </p><p>
10   Here are all of the configure options specific to libstdc++.  Keep
11   in mind that
12    
13    <a class="link" href="http://sourceware.org/autobook/autobook/autobook_14.html">they
14    all have opposite forms as well</a> (enable/disable and
15    with/without).  The defaults are for the <span class="emphasis"><em>current
16    development sources</em></span>, which may be different than those
17    for released versions.
18 </p><p>The canonical way to find out the configure options that are
19    available for a given set of libstdc++ sources is to go to the
20    source directory and then type:<span class="command"><strong>./configure --help</strong></span>.
21 </p><div class="variablelist"><dl><dt><span class="term"><code class="code">--enable-multilib</code>[default]</span></dt><dd><p>This is part of the generic multilib support for building cross
22         compilers.  As such, targets like "powerpc-elf" will have
23         libstdc++ built many different ways:  "-msoft-float"
24         and not, etc.  A different libstdc++ will be built for each of
25         the different multilib versions.  This option is on by default.
26      </p></dd><dt><span class="term"><code class="code">--enable-sjlj-exceptions</code></span></dt><dd><p>Forces old, set-jump/long-jump exception handling model.  If
27         at all possible, the new, frame unwinding exception handling routines
28         should be used instead, as they significantly reduce both
29         runtime memory usage and executable size. This option can
30         change the library ABI.
31      </p></dd><dt><span class="term"><code class="code">--enable-version-specific-runtime-libs</code></span></dt><dd><p>Specify that run-time libraries should be installed in the
32         compiler-specific subdirectory (i.e.,
33         <code class="code">${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
34         instead of <code class="code">${libdir}</code>.  This option is useful if you
35         intend to use several versions of gcc in parallel.  In addition,
36         libstdc++'s include files will be installed in
37         <code class="code">${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
38         unless you also specify
39        <code class="literal">--with-gxx-include-dir=</code><code class="filename">dirname</code> during configuration.
40      </p></dd><dt><span class="term"><code class="code">--with-gxx-include-dir=&lt;include-files dir&gt;</code></span></dt><dd><p>Adds support for named libstdc++ include directory.  For instance,
41         the following puts all the libstdc++ headers into a directory
42         called "4.4-20090404" instead of the usual
43         "c++/(version)".
44      </p><pre class="programlisting">
45    --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/4.4-20090404</pre></dd><dt><span class="term"><code class="code">--enable-cstdio</code></span></dt><dd><p>This is an abbreviated form of <code class="code">'--enable-cstdio=stdio'</code>
46         (described next).
47      </p></dd><dt><span class="term"><code class="code">--enable-cstdio=OPTION</code></span></dt><dd><p>Select a target-specific I/O package. At the moment, the only
48         choice is to use 'stdio', a generic "C" abstraction.
49         The default is 'stdio'. This option can change the library ABI.
50      </p></dd><dt><span class="term"><code class="code">--enable-clocale</code></span></dt><dd><p>This is an abbreviated form of <code class="code">'--enable-clocale=generic'</code>
51         (described next).
52      </p></dd><dt><span class="term"><code class="code">--enable-clocale=OPTION</code></span></dt><dd><p>Select a target-specific underlying locale package.  The
53         choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
54         (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
55         'gnu' to specify a model based on functionality from the GNU C
56         library (langinfo/iconv/gettext) (from <a class="link" href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
57         library), or 'generic' to use a generic "C"
58         abstraction which consists of "C" locale info.
59      </p><p>If not explicitly specified, the configure proccess tries
60       to guess the most suitable package from the choices above. The
61       default is 'generic'. On glibc-based systems of sufficient
62       vintage (2.3 and newer), 'gnu' is automatically selected. This option
63       can change the library ABI.
64      </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-allocator</code></span></dt><dd><p>This is an abbreviated form of
65         <code class="code">'--enable-libstdcxx-allocator=auto'</code> (described
66         next).
67      </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-allocator=OPTION  </code></span></dt><dd><p>Select a target-specific underlying std::allocator.  The
68         choices are 'new' to specify a wrapper for new, 'malloc' to
69         specify a wrapper for malloc, 'mt' for a fixed power of two allocator,
70         'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator.
71         See this page for more information on allocator
72         <a class="link" href="memory.html#allocator.ext" title="Extension Allocators">extensions</a>. This option
73         can change the library ABI.
74      </p></dd><dt><span class="term"><code class="code">--enable-cheaders=OPTION</code></span></dt><dd><p>This allows the user to define the approach taken for C header
75         compatibility with C++. Options are c, c_std, and c_global.
76         These correspond to the source directory's include/c,
77         include/c_std, and include/c_global, and may also include
78         include/c_compatibility.  The default is 'c_global'.
79      </p></dd><dt><span class="term"><code class="code">--enable-threads</code></span></dt><dd><p>This is an abbreviated form of <code class="code">'--enable-threads=yes'</code>
80         (described next).
81      </p></dd><dt><span class="term"><code class="code">--enable-threads=OPTION</code></span></dt><dd><p>Select a threading library.  A full description is
82         given in the
83         general <a class="link" href="http://gcc.gnu.org/install/configure.html">compiler
84         configuration instructions</a>. This option can change the
85         library ABI.
86      </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-time</code></span></dt><dd><p>This is an abbreviated form of
87         <code class="code">'--enable-libstdcxx-time=yes'</code>(described next).
88      </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-time=OPTION</code></span></dt><dd><p>Enables link-type checks for the availability of the
89         clock_gettime clocks, used in the implementation of [time.clock],
90         and of the nanosleep and sched_yield functions, used in the
91         implementation of [thread.thread.this] of the current C++0x draft.
92         The choice OPTION=yes checks for the availability of the facilities
93         in libc and libposix4.  In case of need the latter is also linked
94         to libstdc++ as part of the build process.  OPTION=rt also searches
95         (and, in case, links) librt.   Note that the latter is not always
96         desirable because, in glibc, for example, in turn it triggers the
97         linking of libpthread too, which activates locking, a large overhead
98         for single-thread programs.  OPTION=no skips the tests completely.
99         The default is OPTION=no.
100     </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-debug</code></span></dt><dd><p>Build separate debug libraries in addition to what is normally built.
101         By default, the debug libraries are compiled with
102         <code class="code"> CXXFLAGS='-g3 -O0 -fno-inline'</code>
103         , are installed in <code class="code">${libdir}/debug</code>, and have the
104         same names and versioning information as the non-debug
105         libraries. This option is off by default.
106      </p><p>Note this make command, executed in
107         the build directory, will do much the same thing, without the
108         configuration difference and without building everything twice:
109         <code class="code">make CXXFLAGS='-g3 -O0 -fno-inline' all</code>
110      </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-debug-flags=FLAGS</code></span></dt><dd><p>This option is only valid when <code class="code"> --enable-debug </code>
111         is also specified, and applies to the debug builds only. With
112         this option, you can pass a specific string of flags to the
113         compiler to use when building the debug versions of libstdc++.
114         FLAGS is a quoted string of options, like
115      </p><pre class="programlisting">
116   --enable-libstdcxx-debug-flags='-g3 -O1 -fno-inline'</pre></dd><dt><span class="term"><code class="code">--enable-cxx-flags=FLAGS</code></span></dt><dd><p>With this option, you can pass a string of -f (functionality)
117         flags to the compiler to use when building libstdc++. This
118         option can change the library ABI. FLAGS is a quoted string of
119         options, like
120      </p><pre class="programlisting">
121   --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre><p>
122         Note that the flags don't necessarily have to all be -f flags,
123         as shown, but usually those are the ones that will make sense
124         for experimentation and configure-time overriding.
125      </p><p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
126         the 'make' environment is that, if files are automatically
127         rebuilt, the same flags will be used when compiling those files
128         as well, so that everything matches.
129      </p><p>Fun flags to try might include combinations of
130      </p><pre class="programlisting">
131   -fstrict-aliasing
132   -fno-exceptions
133   -ffunction-sections
134   -fvtable-gc</pre><p>and opposite forms (-fno-) of the same.  Tell us (the libstdc++
135         mailing list) if you discover more!
136      </p></dd><dt><span class="term"><code class="code">--enable-c99</code></span></dt><dd><p>The "long long" type was introduced in C99, along
137         with many other functions for wide characters, and math
138         classification macros, etc.  If enabled, all C99 functions not
139         specified by the C++ standard will be put into <code class="code">namespace
140         __gnu_cxx</code>, and then all these names will
141         be injected into namespace std, so that C99 functions can be
142         used "as if" they were in the C++ standard (as they
143         will eventually be in some future revision of the standard,
144         without a doubt).  By default, C99 support is on, assuming the
145         configure probes find all the necessary functions and bits
146         necessary. This option can change the library ABI.
147     </p></dd><dt><span class="term"><code class="code">--enable-wchar_t</code>[default]</span></dt><dd><p>Template specializations for the "wchar_t" type are
148         required for wide character conversion support.  Disabling
149         wide character specializations may be expedient for initial
150         porting efforts, but builds only a subset of what is required by
151         ISO, and is not recommended.  By default, this option is on.
152         This option can change the library ABI.
153      </p></dd><dt><span class="term"><code class="code">--enable-long-long  </code></span></dt><dd><p>The "long long" type was introduced in C99.  It is
154         provided as a GNU extension to C++98 in g++.  This flag builds
155         support for "long long" into the library (specialized
156         templates and the like for iostreams).  This option is on by default:
157         if enabled, users will have to either use the new-style "C"
158         headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
159         or add appropriate compile-time flags to all compile lines to
160         allow "C" visibility of this feature (on GNU/Linux,
161         the flag is -D_ISOC99_SOURCE, which is added automatically via
162         CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
163         This option can change the library ABI.
164      </p></dd><dt><span class="term"><code class="code">--enable-fully-dynamic-string</code></span></dt><dd><p>This option enables a special version of basic_string avoiding
165         the optimization that allocates empty objects in static memory.
166         Mostly useful together with shared memory allocators, see PR
167         libstdc++/16612 for details.
168      </p></dd><dt><span class="term"><code class="code">--enable-concept-checks</code></span></dt><dd><p>This turns on additional compile-time checks for instantiated
169         library templates, in the form of specialized templates,
170         <a class="link" href="bk01pt02ch05s02.html" title="Concept Checking">described here</a>.  They
171         can help users discover when they break the rules of the STL, before
172         their programs run.
173      </p></dd><dt><span class="term"><code class="code">--enable-symvers[=style]</code></span></dt><dd><p>In 3.1 and later, tries to turn on symbol versioning in the
174         shared library (if a shared library has been
175         requested). Values for 'style' that are currently supported
176         are 'gnu', 'gnu-versioned-namespace', 'darwin',
177         'darwin-export', and 'sun'. Both gnu- options require that a recent
178         version of the GNU linker be in use. Both darwin options are
179         equivalent. With no style given, the configure script will try
180         to guess correct defaults for the host system, probe to see if
181         additional requirements are necessary and present for
182         activation, and if so, will turn symbol versioning on. This
183         option can change the library ABI.
184      </p></dd><dt><span class="term"><code class="code">--enable-visibility</code></span></dt><dd><p> In 4.2 and later, enables or disables visibility attributes.
185         If enabled (as by default), and the compiler seems capable of
186         passing the simple sanity checks thrown at it, adjusts items
187         in namespace std, namespace std::tr1, and namespace __gnu_cxx
188         so that -fvisibility options work.
189     </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-pch</code></span></dt><dd><p>In 3.4 and later, tries to turn on the generation of
190         stdc++.h.gch, a pre-compiled file including all the standard
191         C++ includes. If enabled (as by default), and the compiler
192         seems capable of passing the simple sanity checks thrown at
193         it, try to build stdc++.h.gch as part of the make process.
194         In addition, this generated file is used later on (by appending <code class="code">
195         --include bits/stdc++.h </code> to CXXFLAGS) when running the
196         testsuite.
197      </p></dd><dt><span class="term"><code class="code">--enable-extern-template</code>[default]</span></dt><dd><p>Use extern template to pre-instantiate all required
198         specializations for certain types defined in the standard libraries. 
199         These types include <code class="classname">string</code> and dependents like
200         <code class="classname">char_traits</code>, the templateized io classes,
201         <code class="classname">allocator</code>, and others.  
202         Disabling means that implicit
203         template generation will be used when compiling these types.  By
204         default, this option is on. This option can change the library ABI.
205      </p></dd><dt><span class="term"><code class="code">--disable-hosted-libstdcxx</code></span></dt><dd><p>
206      By default, a complete <span class="emphasis"><em>hosted</em></span> C++ library is
207      built.  The C++ Standard also describes a
208      <span class="emphasis"><em>freestanding</em></span> environment, in which only a
209      minimal set of headers are provided.  This option builds such an
210      environment.
211      </p></dd></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="setup.html">Prev</a> </td><td align="center"><a accesskey="u" href="setup.html">Up</a></td><td align="right"> <a accesskey="n" href="make.html">Next</a></td></tr><tr><td align="left" valign="top">Chapter 2. Setup </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Make</td></tr></table></div></body></html>