[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. Installing GNU CC

Note most of this information is out of date and superseded by the new GCC install manual `gcc/doc/install.texi'. It is provided for historical reference only.

4.1 Files Created by configure  Files created by running configure.
4.2 Configurations Supported by GNU CC  
4.3 Building and Installing a Cross-Compiler  Building and installing a cross-compiler.
4.4 Installing GNU CC on VMS  See below for installation on VMS.
4.5 collect2  How collect2 works; how it finds ld.
4.6 Standard Header File Directories  Understanding the standard header file directories.

Here is the procedure for installing GNU CC on a GNU or Unix system. See 4.4 Installing GNU CC on VMS, for VMS systems.

  1. If you have chosen a configuration for GNU CC which requires other GNU tools (such as GAS or the GNU linker) instead of the standard system tools, install the required tools in the build directory under the names `as', `ld' or whatever is appropriate. This will enable the compiler to find the proper tools for compilation of the program `enquire'.

    Alternatively, you can do subsequent compilation using a value of the PATH environment variable such that the necessary GNU tools come before the standard system tools.

  2. Specify the host, build and target machine configurations. You do this when you run the `configure' script.

    The build machine is the system which you are using, the host machine is the system where you want to run the resulting compiler (normally the build machine), and the target machine is the system for which you want the compiler to generate code.

    If you are building a compiler to produce code for the machine it runs on (a native compiler), you normally do not need to specify any operands to `configure'; it will try to guess the type of machine you are on and use that as the build, host and target machines. So you don't need to specify a configuration when building a native compiler unless `configure' cannot figure out what your configuration is or guesses wrong.

    In those cases, specify the build machine's configuration name with the `--host' option; the host and target will default to be the same as the host machine. (If you are building a cross-compiler, see 4.3 Building and Installing a Cross-Compiler.)

    Here is an example:

    ./configure --host=sparc-sun-sunos4.1

    A configuration name may be canonical or it may be more or less abbreviated.

    A canonical configuration name has three parts, separated by dashes. It looks like this: `cpu-company-system'. (The three parts may themselves contain dashes; `configure' can figure out which dashes serve which purpose.) For example, `m68k-sun-sunos4.1' specifies a Sun 3.

    You can also replace parts of the configuration by nicknames or aliases. For example, `sun3' stands for `m68k-sun', so `sun3-sunos4.1' is another way to specify a Sun 3.

    You can specify a version number after any of the system types, and some of the CPU types. In most cases, the version is irrelevant, and will be ignored. So you might as well specify the version if you know it.

    See 4.2 Configurations Supported by GNU CC, for a list of supported configuration names and notes on many of the configurations. You should check the notes in that section before proceeding any further with the installation of GNU CC.

  3. When running configure, you may also need to specify certain additional options that describe variant hardware and software configurations. These are `--with-gnu-as', `--with-gnu-ld', `--with-stabs' and `--nfp'.

    If you will use GNU CC with the GNU assembler (GAS), you should declare this by using the `--with-gnu-as' option when you run `configure'.

    Using this option does not install GAS. It only modifies the output of GNU CC to work with GAS. Building and installing GAS is up to you.

    Conversely, if you do not wish to use GAS and do not specify `--with-gnu-as' when building GNU CC, it is up to you to make sure that GAS is not installed. GNU CC searches for a program named as in various directories; if the program it finds is GAS, then it runs GAS. If you are not sure where GNU CC finds the assembler it is using, try specifying `-v' when you run it.

    The systems where it makes a difference whether you use GAS are
    `hppa1.0-any-any', `hppa1.1-any-any', `i386-any-sysv', `i386-any-isc',
    `i860-any-bsd', `m68k-bull-sysv',
    `m68k-hp-hpux', `m68k-sony-bsd',
    `m68k-altos-sysv', `m68000-hp-hpux',
    `m68000-att-sysv', `any-lynx-lynxos', and `mips-any'). On any other system, `--with-gnu-as' has no effect.

    On the systems listed above (except for the HP-PA, for ISC on the 386, and for `mips-sgi-irix5.*'), if you use GAS, you should also use the GNU linker (and specify `--with-gnu-ld').

    Specify the option `--with-gnu-ld' if you plan to use the GNU linker with GNU CC.

    This option does not cause the GNU linker to be installed; it just modifies the behavior of GNU CC to work with the GNU linker.

    On MIPS based systems and on Alphas, you must specify whether you want GNU CC to create the normal ECOFF debugging format, or to use BSD-style stabs passed through the ECOFF symbol table. The normal ECOFF debug format cannot fully handle languages other than C. BSD stabs format can handle other languages, but it only works with the GNU debugger GDB.

    Normally, GNU CC uses the ECOFF debugging format by default; if you prefer BSD stabs, specify `--with-stabs' when you configure GNU CC.

    No matter which default you choose when you configure GNU CC, the user can use the `-gcoff' and `-gstabs+' options to specify explicitly the debug format for a particular compilation.

    `--with-stabs' is meaningful on the ISC system on the 386, also, if `--with-gas' is used. It selects use of stabs debugging information embedded in COFF output. This kind of debugging information supports C++ well; ordinary COFF debugging information does not.

    `--with-stabs' is also meaningful on 386 systems running SVR4. It selects use of stabs debugging information embedded in ELF output. The C++ compiler currently (2.6.0) does not support the DWARF debugging information normally used on 386 SVR4 platforms; stabs provide a workable alternative. This requires gas and gdb, as the normal SVR4 tools can not generate or interpret stabs.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Vincent Chung on June, 26 2001 using texi2html