blob: e042f086abc86305b6c2ca41610b8116588a4f79 [file] [log] [blame]
<html lang="en">
<head>
<title>Running Configure - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Installing-GDB.html#Installing-GDB" title="Installing GDB">
<link rel="prev" href="Requirements.html#Requirements" title="Requirements">
<link rel="next" href="Separate-Objdir.html#Separate-Objdir" title="Separate Objdir">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="Running-Configure"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Separate-Objdir.html#Separate-Objdir">Separate Objdir</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Requirements.html#Requirements">Requirements</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Installing-GDB.html#Installing-GDB">Installing GDB</a>
<hr>
</div>
<h3 class="section">B.2 Invoking the <span class="sc">gdb</span> <samp><span class="file">configure</span></samp> Script</h3>
<p><a name="index-configuring-_0040value_007bGDBN_007d-2298"></a><span class="sc">gdb</span> comes with a <samp><span class="file">configure</span></samp> script that automates the process
of preparing <span class="sc">gdb</span> for installation; you can then use <code>make</code> to
build the <code>gdb</code> program.
<p>The <span class="sc">gdb</span> distribution includes all the source code you need for
<span class="sc">gdb</span> in a single directory, whose name is usually composed by
appending the version number to &lsquo;<samp><span class="samp">gdb</span></samp>&rsquo;.
<p>For example, the <span class="sc">gdb</span> version 7.2.50.20100908-cvs distribution is in the
<samp><span class="file">gdb-7.2.50.20100908-cvs</span></samp> directory. That directory contains:
<dl>
<dt><code>gdb-7.2.50.20100908-cvs/configure </code><span class="roman">(and supporting files)</span><dd>script for configuring <span class="sc">gdb</span> and all its supporting libraries
<br><dt><code>gdb-7.2.50.20100908-cvs/gdb</code><dd>the source specific to <span class="sc">gdb</span> itself
<br><dt><code>gdb-7.2.50.20100908-cvs/bfd</code><dd>source for the Binary File Descriptor library
<br><dt><code>gdb-7.2.50.20100908-cvs/include</code><dd><span class="sc">gnu</span> include files
<br><dt><code>gdb-7.2.50.20100908-cvs/libiberty</code><dd>source for the &lsquo;<samp><span class="samp">-liberty</span></samp>&rsquo; free software library
<br><dt><code>gdb-7.2.50.20100908-cvs/opcodes</code><dd>source for the library of opcode tables and disassemblers
<br><dt><code>gdb-7.2.50.20100908-cvs/readline</code><dd>source for the <span class="sc">gnu</span> command-line interface
<br><dt><code>gdb-7.2.50.20100908-cvs/glob</code><dd>source for the <span class="sc">gnu</span> filename pattern-matching subroutine
<br><dt><code>gdb-7.2.50.20100908-cvs/mmalloc</code><dd>source for the <span class="sc">gnu</span> memory-mapped malloc package
</dl>
<p>The simplest way to configure and build <span class="sc">gdb</span> is to run <samp><span class="file">configure</span></samp>
from the <samp><span class="file">gdb-</span><var>version-number</var></samp> source directory, which in
this example is the <samp><span class="file">gdb-7.2.50.20100908-cvs</span></samp> directory.
<p>First switch to the <samp><span class="file">gdb-</span><var>version-number</var></samp> source directory
if you are not already in it; then run <samp><span class="file">configure</span></samp>. Pass the
identifier for the platform on which <span class="sc">gdb</span> will run as an
argument.
<p>For example:
<pre class="smallexample"> cd gdb-7.2.50.20100908-cvs
./configure <var>host</var>
make
</pre>
<p class="noindent">where <var>host</var> is an identifier such as &lsquo;<samp><span class="samp">sun4</span></samp>&rsquo; or
&lsquo;<samp><span class="samp">decstation</span></samp>&rsquo;, that identifies the platform where <span class="sc">gdb</span> will run.
(You can often leave off <var>host</var>; <samp><span class="file">configure</span></samp> tries to guess the
correct value by examining your system.)
<p>Running &lsquo;<samp><span class="samp">configure </span><var>host</var></samp>&rsquo; and then running <code>make</code> builds the
<samp><span class="file">bfd</span></samp>, <samp><span class="file">readline</span></samp>, <samp><span class="file">mmalloc</span></samp>, and <samp><span class="file">libiberty</span></samp>
libraries, then <code>gdb</code> itself. The configured source files, and the
binaries, are left in the corresponding source directories.
<p><samp><span class="file">configure</span></samp> is a Bourne-shell (<code>/bin/sh</code>) script; if your
system does not recognize this automatically when you run a different
shell, you may need to run <code>sh</code> on it explicitly:
<pre class="smallexample"> sh configure <var>host</var>
</pre>
<p>If you run <samp><span class="file">configure</span></samp> from a directory that contains source
directories for multiple libraries or programs, such as the
<samp><span class="file">gdb-7.2.50.20100908-cvs</span></samp> source directory for version 7.2.50.20100908-cvs,
<samp><span class="file">configure</span></samp>
creates configuration files for every directory level underneath (unless
you tell it not to, with the &lsquo;<samp><span class="samp">--norecursion</span></samp>&rsquo; option).
<p>You should run the <samp><span class="file">configure</span></samp> script from the top directory in the
source tree, the <samp><span class="file">gdb-</span><var>version-number</var></samp> directory. If you run
<samp><span class="file">configure</span></samp> from one of the subdirectories, you will configure only
that subdirectory. That is usually not what you want. In particular,
if you run the first <samp><span class="file">configure</span></samp> from the <samp><span class="file">gdb</span></samp> subdirectory
of the <samp><span class="file">gdb-</span><var>version-number</var></samp> directory, you will omit the
configuration of <samp><span class="file">bfd</span></samp>, <samp><span class="file">readline</span></samp>, and other sibling
directories of the <samp><span class="file">gdb</span></samp> subdirectory. This leads to build errors
about missing include files such as <samp><span class="file">bfd/bfd.h</span></samp>.
<p>You can install <code>gdb</code> anywhere; it has no hardwired paths.
However, you should make sure that the shell on your path (named by
the &lsquo;<samp><span class="samp">SHELL</span></samp>&rsquo; environment variable) is publicly readable. Remember
that <span class="sc">gdb</span> uses the shell to start your program&mdash;some systems refuse to
let <span class="sc">gdb</span> debug child processes whose programs are not readable.
</body></html>