GNU Info

Info Node: (gdb.info)Installing GDB

(gdb.info)Installing GDB


Next: Maintenance Commands Prev: Using History Interactively Up: Top
Enter node , (file) or (file)node

Installing GDB
**************

   GDB comes with a `configure' script that automates the process of
preparing GDB for installation; you can then use `make' to build the
`gdb' program.

   The GDB distribution includes all the source code you need for GDB
in a single directory, whose name is usually composed by appending the
version number to `gdb'.

   For example, the GDB version 2002-04-01-cvs distribution is in the
`gdb-2002-04-01-cvs' directory.  That directory contains:

`gdb-2002-04-01-cvs/configure (and supporting files)'
     script for configuring GDB and all its supporting libraries

`gdb-2002-04-01-cvs/gdb'
     the source specific to GDB itself

`gdb-2002-04-01-cvs/bfd'
     source for the Binary File Descriptor library

`gdb-2002-04-01-cvs/include'
     GNU include files

`gdb-2002-04-01-cvs/libiberty'
     source for the `-liberty' free software library

`gdb-2002-04-01-cvs/opcodes'
     source for the library of opcode tables and disassemblers

`gdb-2002-04-01-cvs/readline'
     source for the GNU command-line interface

`gdb-2002-04-01-cvs/glob'
     source for the GNU filename pattern-matching subroutine

`gdb-2002-04-01-cvs/mmalloc'
     source for the GNU memory-mapped malloc package

   The simplest way to configure and build GDB is to run `configure'
from the `gdb-VERSION-NUMBER' source directory, which in this example
is the `gdb-2002-04-01-cvs' directory.

   First switch to the `gdb-VERSION-NUMBER' source directory if you are
not already in it; then run `configure'.  Pass the identifier for the
platform on which GDB will run as an argument.

   For example:

     cd gdb-2002-04-01-cvs
     ./configure HOST
     make

where HOST is an identifier such as `sun4' or `decstation', that
identifies the platform where GDB will run.  (You can often leave off
HOST; `configure' tries to guess the correct value by examining your
system.)

   Running `configure HOST' and then running `make' builds the `bfd',
`readline', `mmalloc', and `libiberty' libraries, then `gdb' itself.
The configured source files, and the binaries, are left in the
corresponding source directories.

   `configure' is a Bourne-shell (`/bin/sh') script; if your system
does not recognize this automatically when you run a different shell,
you may need to run `sh' on it explicitly:

     sh configure HOST

   If you run `configure' from a directory that contains source
directories for multiple libraries or programs, such as the
`gdb-2002-04-01-cvs' source directory for version 2002-04-01-cvs,
`configure' creates configuration files for every directory level
underneath (unless you tell it not to, with the `--norecursion' option).

   You can run the `configure' script from any of the subordinate
directories in the GDB distribution if you only want to configure that
subdirectory, but be sure to specify a path to it.

   For example, with version 2002-04-01-cvs, type the following to
configure only the `bfd' subdirectory:

     cd gdb-2002-04-01-cvs/bfd
     ../configure HOST

   You can install `gdb' anywhere; it has no hardwired paths.  However,
you should make sure that the shell on your path (named by the `SHELL'
environment variable) is publicly readable.  Remember that GDB uses the
shell to start your program--some systems refuse to let GDB debug child
processes whose programs are not readable.

Separate Objdir
Compiling GDB in another directory
Config Names
Specifying names for hosts and targets
Configure Options
Summary of options for configure

automatically generated by info2www version 1.2.2.9