manpagez: man pages & more
info gdb
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

B.3 Compiling No value for GDBN in Another Directory

If you want to run No value for GDBN 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 No value for GDBVN, you can build No value for GDBN in a separate directory for a Sun 4 like this:

cd gdb-No value for GDBVN
mkdir ../gdb-sun4
cd ../gdb-sun4
../gdb-No value for GDBVN/configure sun4

When ‘configure’ builds a configuration using a remote source directory, it creates a tree for the binaries with the same structure (and using the same names) as the tree under the source directory. In the example, you'd find the Sun 4 library ‘libiberty.a’ in the directory ‘gdb-sun4/libiberty’, and No value for GDBN itself in ‘gdb-sun4/gdb’.

Make sure that your path to the ‘configure’ script has just one instance of ‘gdb’ in it. If your path to ‘configure’ looks like ‘../gdb-No value for GDBVN/gdb/configure’, you are configuring only one subdirectory of No value for GDBN, not the whole package. This leads to build errors about missing include files such as ‘bfd/bfd.h’.

One popular reason to build several No value for GDBN configurations in separate directories is to configure No value for GDBN for cross-compiling (where No value for GDBN runs on one machine—the host—while debugging programs that run on another machine—the target). You specify a cross-debugging target by giving the ‘--target=target’ option to ‘configure’.

When you run make to build a program or library, you must run it in a configured directory—whatever directory you were in when you called ‘configure’ (or one of its subdirectories).

The Makefile that ‘configure’ generates in each source directory also runs recursively. If you type make in a source directory such as ‘gdb-No value for GDBVN’ (or in a separate configured directory configured with ‘--srcdir=dirname/gdb-No value for GDBVN’), you will build all the required libraries, and then build GDB.

When you have multiple hosts or targets configured in separate directories, you can run make on them in parallel (for example, if they are NFS-mounted on each of the hosts); they will not interfere with each other.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© 2000-2021
Individual documents may contain additional copyright information.