Installing GCC: Final installation

Now that GCC has been built (and optionally tested), you can install it with

    cd objdir && make install

We strongly recommend to install into a target directory where there is no previous version of GCC present. Also, the GNAT runtime should not be stripped, as this would break certain features of the debugger that depend on this debugging information (catching Ada exceptions for instance).

That step completes the installation of GCC; user level binaries can be found in `prefix/bin` where prefix is the value you specified with the `--prefix` to configure (or `/usr/local` by default). (If you specified `--bindir`, that directory will be used instead; otherwise, if you specified `--exec-prefix`, `exec-prefix/bin` will be used.) Headers for the C++ library are installed in `prefix/include`; libraries in `libdir` (normally `prefix/lib`); internal parts of the compiler in `libdir/gcc` and `libexecdir/gcc`; documentation in info format in `infodir` (normally `prefix/info`).

When installing cross-compilers, GCC’s executables are not only installed into `bindir`, that is, `exec-prefix/bin`, but additionally into `exec-prefix/target-alias/bin`, if that directory exists. Typically, such tooldirs hold target-specific binutils, including assembler and linker.

Installation into a temporary staging area or into a `chroot` jail can be achieved with the command

    make DESTDIR=path-to-rootdir install

where path-to-rootdir is the absolute path of a directory relative to which all installation paths will be interpreted. Note that the directory specified by `DESTDIR` need not exist yet; it will be created if necessary.

There is a subtle point with tooldirs and `DESTDIR`: If you relocate a cross-compiler installation with e.g. ‘`DESTDIR=rootdir`’, then the directory `rootdir/exec-prefix/target-alias/bin` will be filled with duplicated GCC executables only if it already exists, it will not be created otherwise. This is regarded as a feature, not as a bug, because it gives slightly more control to the packagers using the `DESTDIR` feature.

You can install stripped programs and libraries with

    make install-strip

By default, only the man pages and info-format GCC documentation are built and installed. If you want to generate the GCC manuals in other formats, use commands like

    make dvi
    make pdf
    make html

to build the manuals in the corresponding formats, and

    make install-dvi
    make install-pdf
    make install-html

to install them. Alternatively, there are prebuilt online versions of the manuals for released versions of GCC on the GCC web site.

If you built GCC yourself we would like to know if the host/target specific installation notes didn’t include your host/target information or if that information is incomplete or out of date. Send a note to gcc@gcc.gnu.org detailing how the information should be changed.

If you find a bug, please report it following the bug reporting guidelines.

Return to the GCC Installation page