# Interesting `configure` options

The latest version of this document is always available at http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html.

To the libstdc++-v3 homepage.

Here are some of the non-obvious options to libstdc++'s configure. Keep in mind that they all have opposite forms as well (enable/disable and with/without). The defaults are for current development sources.

The canonical way to find out the configure options that are available for a given set of libstdc++ sources is to go to the source directory and then type:`./configure --help`

`--enable-multilib` [default]

  This is part of the generic multilib support for building cross compilers. As such, targets like "powerpc-elf" will have libstdc++ built many different ways: "-msoft-float" and not, etc. A different libstdc++ will be built for each of the different multilib versions. This option is on by default.

`--enable-sjlj-exceptions`

  Forces old, set-jump/long-jump exception handling model. If at all possible, the new, frame unwinding exception handling routines should be used instead, as they significantly reduce both runtime memory usage and executable size. This option can change the library ABI.

`--enable-version-specific-runtime-libs`

  Specify that run-time libraries should be installed in the compiler-specific subdirectory (i.e., `${libdir}/gcc-lib/${target_alias}/${gcc_version}`) instead of `${libdir}`. This option is useful if you intend to use several versions of gcc in parallel. In addition, libstdc++'s include files will be installed in `${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++`, unless you also specify `--with-gxx-include-dir=dirname` during configuration.

`--with-gxx-include-dir=<include-files dir>`

  Adds support for named libstdc++ include directory. For instance, the following puts all the libstdc++ headers into a directory called "2.97-20001008" instead of the usual "c++/(version)".

         --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008

`--enable-cstdio`

  This is an abbreviated form of `'--enable-cstdio=stdio'` (described next). This option can change the library ABI.

`--enable-cstdio=OPTION`

  Select a target-specific I/O package. At the moment, the only choice is to use 'stdio', a generic "C" abstraction. The default is 'stdio'. A longer explanation is here.

`--enable-clocale`

  This is an abbreviated form of `'--enable-clocale=generic'` (described next). This option can change the library ABI.

`--enable-clocale=OPTION`

  Select a target-specific underlying locale package. The choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, 'gnu' to specify a model based on functionality from the GNU C library (langinfo/iconv/gettext) (from glibc, the GNU C library), or 'generic' to use a generic "C" abstraction which consists of "C" locale info.

  As part of the configuration process, the "C" library is probed both for sufficient vintage, and installed locale data. If either of these elements are not present, the C++ locale model default to 'generic.' On glibc-based systems of version 2.2.5 and above with installed locale files, 'gnu' is automatically selected.

`--enable-cheaders=OPTION`

  This allows the user to define what kind of C headers are used. Options are: c, c_std, and c_shadow. These correspond to the source directory's include/c, include/c_std, and include/c_shadow directories. The default is c_std.

`--enable-threads`

  This is an abbreviated form of `'--enable-threads=yes'` (described next). This option can change the library ABI.

`--enable-threads=OPTION`

  Select a threading library. A full description is given in the general compiler configuration instructions.

`--enable-debug`

  Build separate debug libraries in addition to what is normally built. By default, the debug libraries are compiled with `CXXFLAGS='-g3 -O0'` , are installed in `${libdir}/debug`, and have the same names and versioning information as the non-debug libraries. This option is off by default.

  Note this make command, executed in the build directory, will do much the same thing, without the configuration difference and without building everything twice: `make CXXFLAGS='-g3 -O0' all`

`--enable-debug-flags=FLAGS`

  This option is only valid when `--enable-debug` is also specified, and applies to the debug builds only. With this option, you can pass a specific string of flags to the compiler to use when building the debug versions of libstdc++. FLAGS is a quoted string of options, like

        --enable-debug-flags='-g3 -O1 -gdwarf-2'

`--enable-cxx-flags=FLAGS`

  With this option, you can pass a string of -f (functionality) flags to the compiler to use when building libstdc++. This option can change the library ABI. FLAGS is a quoted string of options, like

        --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'

  Note that the flags don't necessarily have to all be -f flags, as shown, but usually those are the ones that will make sense for experimentation and configure-time overriding.

  The advantage of --enable-cxx-flags over setting CXXFLAGS in the 'make' environment is that, if files are automatically rebuilt, the same flags will be used when compiling those files as well, so that everything matches.

  Fun flags to try might include combinations of

        -fstrict-aliasing
        -fno-exceptions
        -ffunction-sections
        -fvtable-gc

  and opposite forms (-fno-) of the same. Tell us (the libstdc++ mailing list) if you discover more!

`--enable-c99`

  The "long long" type was introduced in C99, along with many other functions for wide characters, and math classification macros, etc. If enabled, all C99 functions not specified by the C++ standard will be put into `namespace __gnu_cxx`, and then all these names will be injected into namespace std, so that C99 functions can be used "as if" they were in the C++ standard (as they will eventually be in some future revision of the standard, without a doubt). By default, C99 support is on, assuming the configure probes find all the necessary functions and bits necessary. This option can change the library ABI.

`--enable-c-mbchar` [default]

  Certain template specializations are required for wide character conversion support. This is tricky and currently changing rapidly, and can cause problems on new platforms. Disabling wide character specializations is useful for initial porting steps, but builds only a subset of what is required by ISO. By default, this option is on. This option can change the library ABI.

`--enable-long-long`

  The "long long" type was introduced in C99. It is provided as a GNU extension to C++98 in g++. This flag builds support for "long long" into the library (specialized templates and the like for iostreams). This option is on by default: if enabled, users will have to either use the new-style "C" headers by default (i.e., <cmath> not <math.h>) or add appropriate compile-time flags to all compile lines to allow "C" visibility of this feature (on GNU/Linux, the flag is -D_ISOC99_SOURCE, which is added automatically via CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE). This option can change the library ABI.

`--enable-concept-checks`

  This turns on additional compile-time checks for instantiated library templates, in the form of specialized templates, described here. They can help users discover when they break the rules of the STL, before their programs run.

`--enable-symvers[=style]`

  In 3.1 and later, tries to turn on symbol versioning in the shared library (if a shared library has been requested). The only 'style' currently supported is 'gnu' which requires that a recent version of the GNU linker be in use. With no style given, the configure script will try to guess if the 'gnu' style can be used, and if so, will turn it on. Hopefully people will volunteer to do other 'style' options.

Return to the top of the page or to the libstdc++ homepage.

See license.html for copying conditions. Comments and suggestions are welcome, and may be sent to the libstdc++ mailing list.