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