Installing GCC: Configuration

Like most GNU software, GCC must be configured before it can be built. This document describes the recommended configuration procedure for both native and cross targets.

We use srcdir to refer to the toplevel source directory for GCC; we use objdir to refer to the toplevel build/object directory.

First, we highly recommend that GCC be built into a separate directory than the sources which does not reside within the source tree. This is how we generally build GCC; building where srcdir == objdir should still work, but doesn't get extensive testing; building where objdir is a subdirectory of srcdir is unsupported.

Second, when configuring a native system, either "cc" or "gcc" must be in your path or you must set CC in your environment before running configure. Otherwise the configuration scripts may fail.

To configure GCC:


% mkdir objdir
% cd objdir
% srcdir/configure [target] [options]

target specification

options specification

Use options to override several configure time options for GCC. A partial list of supported options:

Some options which only apply to building cross compilers:

Note that each --enable option has a corresponding --disable option and that each --with option has a corresponding --without option.


Last modified on July 16, 1999.