[ <] | [ >] | [ <<] | [ Up] | [ >>] | [Top] | [Contents] | [Index] | [ ?] |
B.1 Requirements for Building GDB Requirements for building GDB B.2 Invoking the GDB `configure' Script Invoking the GDB `configure' script B.3 Compiling GDB in Another Directory Compiling GDB in another directory B.4 Specifying Names for Hosts and Targets Specifying names for hosts and targets B.5 `configure' Options Summary of options for configure
[ <] | [ >] | [ <<] | [ Up] | [ >>] | [Top] | [Contents] | [Index] | [ ?] |
Building GDB requires various tools and packages to be available. Other packages will be used only if they are found.
GDB can use the Expat XML parsing library. This library may be included with your operating system distribution; if it is not, you can get the latest version from http://expat.sourceforge.net. The `configure' script will search for this library in several standard locations; if it is installed in an unusual path, you can use the `--with-libexpat-prefix' option to specify its location.
Expat is used for:
[ <] | [ >] | [ <<] | [ Up] | [ >>] | [Top] | [Contents] | [Index] | [ ?] |
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 6.8 distribution is in the `gdb-6.8' directory. That directory contains:
gdb-6.8/configure (and supporting files)
gdb-6.8/gdb
gdb-6.8/bfd
gdb-6.8/include
gdb-6.8/libiberty
gdb-6.8/opcodes
gdb-6.8/readline
gdb-6.8/glob
gdb-6.8/mmalloc
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-6.8' 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-6.8 ./configure host make |
sh configure host |
[ <] | [ >] | [ <<] | [ Up] | [ >>] | [Top] | [Contents] | [Index] | [ ?] |
If you want to run GDB versions for several host or target machines,
you need a different gdb
compiled for each combination of
host and target. `configure' is designed to make this easy by
allowing you to generate each configuration in a separate subdirectory,
rather than in the source directory. If your make
program
handles the `VPATH' feature (GNU make
does), running
make
in each of these directories builds the gdb
program specified there.
To build gdb
in a separate directory, run `configure'
with the `--srcdir' option to specify where to find the source.
(You also need to specify a path to find `configure'
itself from your working directory. If the path to `configure'
would be the same as the argument to `--srcdir', you can leave out
the `--srcdir' option; it is assumed.)
For example, with version 6.8, you can build GDB in a separate directory for a Sun 4 like this:
cd gdb-6.8 mkdir ../gdb-sun4 cd ../gdb-sun4 ../gdb-6.8/configure sun4 make |
[ <] | [ >] | [ <<] | [ Up] | [ >>] | [Top] | [Contents] | [Index] | [ ?] |
The specifications used for hosts and targets in the `configure' script are based on a three-part naming scheme, but some short predefined aliases are also supported. The full naming scheme encodes three pieces of information in the following pattern:
architecture-vendor-os |
% sh config.sub i386-linux i386-pc-linux-gnu % sh config.sub alpha-linux alpha-unknown-linux-gnu % sh config.sub hp9k700 hppa1.1-hp-hpux % sh config.sub sun4 sparc-sun-sunos4.1.1 % sh config.sub sun3 m68k-sun-sunos4.1.1 % sh config.sub i986v Invalid configuration `i986v': machine `i986v' not recognized |
[ <] | [ >] | [ <<] | [ Up] | [ >>] | [Top] | [Contents] | [Index] | [ ?] |
Here is a summary of the `configure' options and arguments that are most often useful for building GDB. `configure' also has several other options not listed here. See Info file `configure.info', node `What Configure Does', for a full explanation of `configure'.
configure [--help] [--prefix=dir] [--exec-prefix=dir] [--srcdir=dirname] [--norecursion] [--rm] [--target=target] host |
[ <<] | [ >>] | [Top] | [Contents] | [Index] | [ ?] |
Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways to contact the FSF.
These pages are maintained by the GDB developers.
Copyright Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
This document was generated by GDB Administrator on March, 27 2008 using texi2html