1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Copyright (C) 1988-2021 Free Software Foundation, Inc.
4
5Permission is granted to copy, distribute and/or modify this document
6under the terms of the GNU Free Documentation License, Version 1.3 or
7any later version published by the Free Software Foundation; with the
8Invariant Sections being "Free Software" and "Free Software Needs
9Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
10and with the Back-Cover Texts as in (a) below.
11
12(a) The FSF's Back-Cover Text is: "You are free to copy and modify
13this GNU Manual.  Buying copies from GNU Press supports the FSF in
14developing GNU and promoting software freedom." -->
15<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
16<head>
17<title>Debugging with GDB: Configure Options</title>
18
19<meta name="description" content="Debugging with GDB: Configure Options">
20<meta name="keywords" content="Debugging with GDB: Configure Options">
21<meta name="resource-type" content="document">
22<meta name="distribution" content="global">
23<meta name="Generator" content="makeinfo">
24<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25<link href="index.html#Top" rel="start" title="Top">
26<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
27<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
28<link href="Installing-GDB.html#Installing-GDB" rel="up" title="Installing GDB">
29<link href="System_002dwide-configuration.html#System_002dwide-configuration" rel="next" title="System-wide configuration">
30<link href="Config-Names.html#Config-Names" rel="previous" title="Config Names">
31<style type="text/css">
32<!--
33a.summary-letter {text-decoration: none}
34blockquote.smallquotation {font-size: smaller}
35div.display {margin-left: 3.2em}
36div.example {margin-left: 3.2em}
37div.indentedblock {margin-left: 3.2em}
38div.lisp {margin-left: 3.2em}
39div.smalldisplay {margin-left: 3.2em}
40div.smallexample {margin-left: 3.2em}
41div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
42div.smalllisp {margin-left: 3.2em}
43kbd {font-style:oblique}
44pre.display {font-family: inherit}
45pre.format {font-family: inherit}
46pre.menu-comment {font-family: serif}
47pre.menu-preformatted {font-family: serif}
48pre.smalldisplay {font-family: inherit; font-size: smaller}
49pre.smallexample {font-size: smaller}
50pre.smallformat {font-family: inherit; font-size: smaller}
51pre.smalllisp {font-size: smaller}
52span.nocodebreak {white-space:nowrap}
53span.nolinebreak {white-space:nowrap}
54span.roman {font-family:serif; font-weight:normal}
55span.sansserif {font-family:sans-serif; font-weight:normal}
56ul.no-bullet {list-style: none}
57-->
58</style>
59
60
61</head>
62
63<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
64<a name="Configure-Options"></a>
65<div class="header">
66<p>
67Next: <a href="System_002dwide-configuration.html#System_002dwide-configuration" accesskey="n" rel="next">System-wide configuration</a>, Previous: <a href="Config-Names.html#Config-Names" accesskey="p" rel="previous">Config Names</a>, Up: <a href="Installing-GDB.html#Installing-GDB" accesskey="u" rel="up">Installing GDB</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
68</div>
69<hr>
70<a name="configure-Options"></a>
71<h3 class="section">C.5 <samp>configure</samp> Options</h3>
72
73<p>Here is a summary of the <samp>configure</samp> options and arguments that
74are most often useful for building <small>GDB</small>.  <samp>configure</samp>
75also has several other options not listed here.  See <a href="http://www.gnu.org/software/autoconf/manual/html_node/Running-configure-scripts.html#Running-configure-scripts">(autoconf.info)Running
76configure scripts</a>, for a full
77explanation of <samp>configure</samp>.
78</p>
79<div class="smallexample">
80<pre class="smallexample">configure <span class="roman">[</span>--help<span class="roman">]</span>
81          <span class="roman">[</span>--prefix=<var>dir</var><span class="roman">]</span>
82          <span class="roman">[</span>--exec-prefix=<var>dir</var><span class="roman">]</span>
83          <span class="roman">[</span>--srcdir=<var>dirname</var><span class="roman">]</span>
84          <span class="roman">[</span>--target=<var>target</var><span class="roman">]</span>
85</pre></div>
86
87<p>You may introduce options with a single &lsquo;<samp>-</samp>&rsquo; rather than
88&lsquo;<samp>--</samp>&rsquo; if you prefer; but you may abbreviate option names if you use
89&lsquo;<samp>--</samp>&rsquo;.
90</p>
91<dl compact="compact">
92<dt><code>--help</code></dt>
93<dd><p>Display a quick summary of how to invoke <samp>configure</samp>.
94</p>
95</dd>
96<dt><code>--prefix=<var>dir</var></code></dt>
97<dd><p>Configure the source to install programs and files under directory
98<samp><var>dir</var></samp>.
99</p>
100</dd>
101<dt><code>--exec-prefix=<var>dir</var></code></dt>
102<dd><p>Configure the source to install programs under directory
103<samp><var>dir</var></samp>.
104</p>
105</dd>
106<dt><code>--srcdir=<var>dirname</var></code></dt>
107<dd><p>Use this option to make configurations in directories separate from the
108<small>GDB</small> source directories.  Among other things, you can use this to
109build (or maintain) several configurations simultaneously, in separate
110directories.  <samp>configure</samp> writes configuration-specific files in
111the current directory, but arranges for them to use the source in the
112directory <var>dirname</var>.  <samp>configure</samp> creates directories under
113the working directory in parallel to the source directories below
114<var>dirname</var>.
115</p>
116</dd>
117<dt><code>--target=<var>target</var></code></dt>
118<dd><p>Configure <small>GDB</small> for cross-debugging programs running on the specified
119<var>target</var>.  Without this option, <small>GDB</small> is configured to debug
120programs that run on the same machine (<var>host</var>) as <small>GDB</small> itself.
121</p>
122<p>There is no convenient way to generate a list of all available
123targets.  Also see the <code>--enable-targets</code> option, below.
124</p></dd>
125</dl>
126
127<p>There are many other options that are specific to <small>GDB</small>.  This
128lists just the most common ones; there are some very specialized
129options not described here.
130</p>
131<dl compact="compact">
132<dt><code>--enable-targets=<span class="roman">[</span><var>target</var><span class="roman">]</span>&hellip;</code></dt>
133<dt><code>--enable-targets=all</code></dt>
134<dd><p>Configure <small>GDB</small> for cross-debugging programs running on the
135specified list of targets.  The special value &lsquo;<samp>all</samp>&rsquo; configures
136<small>GDB</small> for debugging programs running on any target it supports.
137</p>
138</dd>
139<dt><code>--with-gdb-datadir=<var>path</var></code></dt>
140<dd><p>Set the <small>GDB</small>-specific data directory.  <small>GDB</small> will look
141here for certain supporting files or scripts.  This defaults to the
142<samp>gdb</samp> subdirectory of &lsquo;<samp>datadir</samp>&rsquo; (which can be set using
143<code>--datadir</code>).
144</p>
145</dd>
146<dt><code>--with-relocated-sources=<var>dir</var></code></dt>
147<dd><p>Sets up the default source path substitution rule so that directory
148names recorded in debug information will be automatically adjusted for
149any directory under <var>dir</var>.  <var>dir</var> should be a subdirectory of
150<small>GDB</small>&rsquo;s configured prefix, the one mentioned in the
151<code>--prefix</code> or <code>--exec-prefix</code> options to configure.  This
152option is useful if GDB is supposed to be moved to a different place
153after it is built.
154</p>
155</dd>
156<dt><code>--enable-64-bit-bfd</code></dt>
157<dd><p>Enable 64-bit support in BFD on 32-bit hosts.
158</p>
159</dd>
160<dt><code>--disable-gdbmi</code></dt>
161<dd><p>Build <small>GDB</small> without the GDB/MI machine interface
162(see <a href="GDB_002fMI.html#GDB_002fMI">GDB/MI</a>).
163</p>
164</dd>
165<dt><code>--enable-tui</code></dt>
166<dd><p>Build <small>GDB</small> with the text-mode full-screen user interface
167(TUI).  Requires a curses library (ncurses and cursesX are also
168supported).
169</p>
170</dd>
171<dt><code>--with-curses</code></dt>
172<dd><p>Use the curses library instead of the termcap library, for text-mode
173terminal operations.
174</p>
175</dd>
176<dt><code>--with-debuginfod</code></dt>
177<dd><p>Build <small>GDB</small> with libdebuginfod, the debuginfod client library.
178Used to automatically fetch source files and separate debug files from
179debuginfod servers using the associated executable&rsquo;s build ID. Enabled
180by default if libdebuginfod is installed and found at configure time.
181debuginfod is packaged with elfutils, starting with version 0.178. You
182can get the latest version from &lsquo;https://sourceware.org/elfutils/&rsquo;.
183</p>
184</dd>
185<dt><code>--with-libunwind-ia64</code></dt>
186<dd><p>Use the libunwind library for unwinding function call stack on ia64
187target platforms.  See http://www.nongnu.org/libunwind/index.html for
188details.
189</p>
190</dd>
191<dt><code>--with-system-readline</code></dt>
192<dd><p>Use the readline library installed on the host, rather than the
193library supplied as part of <small>GDB</small>.  Readline 7 or newer is
194required; this is enforced by the build system.
195</p>
196</dd>
197<dt><code>--with-system-zlib</code></dt>
198<dd><p>Use the zlib library installed on the host, rather than the library
199supplied as part of <small>GDB</small>.
200</p>
201</dd>
202<dt><code>--with-expat</code></dt>
203<dd><p>Build <small>GDB</small> with Expat, a library for XML parsing.  (Done by
204default if libexpat is installed and found at configure time.)  This
205library is used to read XML files supplied with <small>GDB</small>.  If it
206is unavailable, some features, such as remote protocol memory maps,
207target descriptions, and shared library lists, that are based on XML
208files, will not be available in <small>GDB</small>.  If your host does not
209have libexpat installed, you can get the latest version from
210&lsquo;http://expat.sourceforge.net&rsquo;.
211</p>
212</dd>
213<dt><code>--with-libiconv-prefix<span class="roman">[</span>=<var>dir</var><span class="roman">]</span></code></dt>
214<dd>
215<p>Build <small>GDB</small> with GNU libiconv, a character set encoding
216conversion library.  This is not done by default, as on GNU systems
217the <code>iconv</code> that is built in to the C library is sufficient.  If
218your host does not have a working <code>iconv</code>, you can get the latest
219version of GNU iconv from &lsquo;https://www.gnu.org/software/libiconv/&rsquo;.
220</p>
221<p><small>GDB</small>&rsquo;s build system also supports building GNU libiconv as
222part of the overall build.   See <a href="Requirements.html#Requirements">Requirements</a>.
223</p>
224</dd>
225<dt><code>--with-lzma</code></dt>
226<dd><p>Build <small>GDB</small> with LZMA, a compression library.  (Done by default
227if liblzma is installed and found at configure time.)  LZMA is used by
228<small>GDB</small>&rsquo;s &quot;mini debuginfo&quot; feature, which is only useful on
229platforms using the ELF object file format.  If your host does not
230have liblzma installed, you can get the latest version from
231&lsquo;https://tukaani.org/xz/&rsquo;.
232</p>
233</dd>
234<dt><code>--with-mpfr</code></dt>
235<dd><p>Build <small>GDB</small> with GNU MPFR, a library for multiple-precision
236floating-point computation with correct rounding.  (Done by default if
237GNU MPFR is installed and found at configure time.)  This library is
238used to emulate target floating-point arithmetic during expression
239evaluation when the target uses different floating-point formats than
240the host.  If GNU MPFR is not available, <small>GDB</small> will fall back
241to using host floating-point arithmetic.  If your host does not have
242GNU MPFR installed, you can get the latest version from
243&lsquo;http://www.mpfr.org&rsquo;.
244</p>
245</dd>
246<dt><code>--with-python<span class="roman">[</span>=<var>python</var><span class="roman">]</span></code></dt>
247<dd><p>Build <small>GDB</small> with Python scripting support.  (Done by default if
248libpython is present and found at configure time.)  Python makes
249<small>GDB</small> scripting much more powerful than the restricted CLI
250scripting language.  If your host does not have Python installed, you
251can find it on &lsquo;http://www.python.org/download/&rsquo;.  The oldest version
252of Python supported by GDB is 2.6.  The optional argument <var>python</var>
253is used to find the Python headers and libraries.  It can be either
254the name of a Python executable, or the name of the directory in which
255Python is installed.
256</p>
257</dd>
258<dt><code>--with-guile[=GUILE]'</code></dt>
259<dd><p>Build <small>GDB</small> with GNU Guile scripting support.  (Done by default
260if libguile is present and found at configure time.)  If your host
261does not have Guile installed, you can find it at
262&lsquo;https://www.gnu.org/software/guile/&rsquo;.  The optional argument GUILE
263can be a version number, which will cause <code>configure</code> to try to
264use that version of Guile; or the file name of a <code>pkg-config</code>
265executable, which will be queried to find the information needed to
266compile and link against Guile.
267</p>
268</dd>
269<dt><code>--without-included-regex</code></dt>
270<dd><p>Don&rsquo;t use the regex library included with <small>GDB</small> (as part of the
271libiberty library).  This is the default on hosts with version 2 of
272the GNU C library.
273</p>
274</dd>
275<dt><code>--with-sysroot=<var>dir</var></code></dt>
276<dd><p>Use <var>dir</var> as the default system root directory for libraries whose
277file names begin with <samp>/lib</samp>&rsquo; or <samp>/usr/lib'</samp>.  (The value of
278<var>dir</var> can be modified at run time by using the <code>set
279sysroot</code> command.)  If <var>dir</var> is under the <small>GDB</small> configured
280prefix (set with <code>--prefix</code> or <code>--exec-prefix options</code>, the
281default system root will be automatically adjusted if and when
282<small>GDB</small> is moved to a different location.
283</p>
284</dd>
285<dt><code>--with-system-gdbinit=<var>file</var></code></dt>
286<dd><p>Configure <small>GDB</small> to automatically load a system-wide init file.
287<var>file</var> should be an absolute file name.  If <var>file</var> is in a
288directory under the configured prefix, and <small>GDB</small> is moved to
289another location after being built, the location of the system-wide
290init file will be adjusted accordingly.
291</p>
292</dd>
293<dt><code>--with-system-gdbinit-dir=<var>directory</var></code></dt>
294<dd><p>Configure <small>GDB</small> to automatically load init files from a
295system-wide directory.  <var>directory</var> should be an absolute directory
296name.  If <var>directory</var> is in a directory under the configured
297prefix, and <small>GDB</small> is moved to another location after being
298built, the location of the system-wide init directory will be
299adjusted accordingly.
300</p>
301</dd>
302<dt><code>--enable-build-warnings</code></dt>
303<dd><p>When building the <small>GDB</small> sources, ask the compiler to warn about
304any code which looks even vaguely suspicious.  It passes many
305different warning flags, depending on the exact version of the
306compiler you are using.
307</p>
308</dd>
309<dt><code>--enable-werror</code></dt>
310<dd><p>Treat compiler warnings as werrors.  It adds the <code>-Werror</code> flag
311to the compiler, which will fail the compilation if the compiler
312outputs any warning messages.
313</p>
314</dd>
315<dt><code>--enable-ubsan</code></dt>
316<dd><p>Enable the GCC undefined behavior sanitizer.  This is disabled by
317default, but passing <code>--enable-ubsan=yes</code> or
318<code>--enable-ubsan=auto</code> to <code>configure</code> will enable it.  The
319undefined behavior sanitizer checks for C<tt>++</tt> undefined behavior.
320It has a performance cost, so if you are looking at <small>GDB</small>&rsquo;s
321performance, you should disable it.  The undefined behavior sanitizer
322was first introduced in GCC 4.9.
323</p></dd>
324</dl>
325
326<hr>
327<div class="header">
328<p>
329Next: <a href="System_002dwide-configuration.html#System_002dwide-configuration" accesskey="n" rel="next">System-wide configuration</a>, Previous: <a href="Config-Names.html#Config-Names" accesskey="p" rel="previous">Config Names</a>, Up: <a href="Installing-GDB.html#Installing-GDB" accesskey="u" rel="up">Installing GDB</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
330</div>
331
332
333
334</body>
335</html>
336