# Interesting `configure` options

The latest version of this document is always available at http://sources.redhat.com/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 the latest snapshot, 2.90.8.

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: `./config --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-debug`

  The configure script will automatically detect the highest level of optimization that the compiler in use can use (certain versions of g++ will ICE if given the `-O2` option, but this is fixed in later versions of the compiler). This --enable flag will disable all optimizations and instruct the compiler to emit as much extra debugging information as it can, for use inside GDB.

`--enable-cstdio` [default]

  This is an abbreviated form of `'--enable-cstdio=libio'` (described next).

`--enable-cstdio=LIB`

  Select a target-specific I/O package. As of libstdc++-v3 snapshot 2.90.8, the choices are 'libio' to specify the GNU I/O package (from glibc, the GNU C library), or 'wince' to specify the Microsoft Windows CE library. Eventually a generic cstdio interface will be added so that people who want to use libstdc++-v3 with say, the Palm Pilot, will be able to use libstdc++-v3 without libio.

`--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).

`--enable-namespaces` [default]

  By default, g++ currently ignores namespace `std` for backwards compatibility. It can be turned on with the `-fhonor-std` flag to the compiler. As of libstdc++-v3 snapshot 2.90.8, that flag is passed to g++ when building the library. (In g++ 2.96 and later, this flag is on by default if libstdc++-v3 is used.) The --disable variant will put all std:: symbols into the global namespace.

`--enable-cshadow-headers`

  This turns on the code to construct shadowed C headers. Very experimental as of this writing.

`--enable-threads`

  This is an abbreviated form of `'--enable-threads=yes'` (described next).

`--enable-threads=LIB`

  Select a threading library. As of libstdc++-v3 snapshot 2.90.8, the choices are: 'yes' for some kind of default (hmmmmm); 'decosf1', 'irix', 'mach', 'os2', 'posix'/'pthreads' (same thing), 'solaris', 'win32', 'dce', or 'vxworks' to select the corresponding interface; and 'single', 'no', or 'none' for the null-case, single-threaded library.

  All of this is currently undergoing a lot of changes. As of 2.90.8, 'single' and 'posix' are the only implemented models.

`--enable-libgcc-rebuild=DIR / --disable-libgcc-rebuild`

  This is a grueling temporary hack no matter which way you look at it. It's described in its own little page. Note that other --enable flags will interact with this one. In libstdc++-v3 snapshot 2.90.8, this is enabled by default, with DIR set to `'../..'` , so that building the complete GCC sources with libstdc++-v3 in place works transparently. Since then, library sources have been merged into the compiler sources, and this option has been removed.

`--enable-cxx-flags=FLAGS`

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

        --enable-cxx-flags='-fsquangle -fvtable-gc -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 libgcc is 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
        -fnew-abi
        -fnew-exceptions
        -ffunction-sections
        -fvtable-gc

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

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

$Id: configopts.html,v 1.6 2000/07/11 21:45:07 pme Exp $