# 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-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 'stdio' to use a generic "C" abstraction.

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

`--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-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 "g++-v3".

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

`--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!
`--enable-wchar` [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.

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

$Id: configopts.html,v 1.1 2000/12/10 04:03:08 pme Exp $