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 (autoconf.info)Running configure scripts, for a full explanation of configure.
configure [--help] [--prefix=dir] [--exec-prefix=dir] [--srcdir=dirname] [--target=target]
You may introduce options with a single ‘-’ rather than ‘--’ if you prefer; but you may abbreviate option names if you use ‘--’.
Display a quick summary of how to invoke configure.
Configure the source to install programs and files under directory dir.
Configure the source to install programs under directory dir.
Use this option to make configurations in directories separate from the GDB source directories. Among other things, you can use this to build (or maintain) several configurations simultaneously, in separate directories. configure writes configuration-specific files in the current directory, but arranges for them to use the source in the directory dirname. configure creates directories under the working directory in parallel to the source directories below dirname.
Configure GDB for cross-debugging programs running on the specified target. Without this option, GDB is configured to debug programs that run on the same machine (host) as GDB itself.
There is no convenient way to generate a list of all available
targets. Also see the
--enable-targets option, below.
There are many other options that are specific to GDB. This lists just the most common ones; there are some very specialized options not described here.
Configure GDB for cross-debugging programs running on the specified list of targets. The special value ‘all’ configures GDB for debugging programs running on any target it supports.
Set the GDB-specific data directory. GDB will look
here for certain supporting files or scripts. This defaults to the
gdb subdirectory of ‘datadir’ (which can be set using
Sets up the default source path substitution rule so that directory
names recorded in debug information will be automatically adjusted for
any directory under dir. dir should be a subdirectory of
GDB’s configured prefix, the one mentioned in the
--exec-prefix options to configure. This
option is useful if GDB is supposed to be moved to a different place
after it is built.
Enable 64-bit support in BFD on 32-bit hosts.
Build GDB without the GDB/MI machine interface (see GDB/MI).
Build GDB with the text-mode full-screen user interface (TUI). Requires a curses library (ncurses and cursesX are also supported).
Use the curses library instead of the termcap library, for text-mode terminal operations.
Use the libunwind library for unwinding function call stack on ia64 target platforms. See http://www.nongnu.org/libunwind/index.html for details.
Use the readline library installed on the host, rather than the library supplied as part of GDB. Readline 7 or newer is required; this is enforced by the build system.
Use the zlib library installed on the host, rather than the library supplied as part of GDB.
Build GDB with Expat, a library for XML parsing. (Done by default if libexpat is installed and found at configure time.) This library is used to read XML files supplied with GDB. If it is unavailable, some features, such as remote protocol memory maps, target descriptions, and shared library lists, that are based on XML files, will not be available in GDB. If your host does not have libexpat installed, you can get the latest version from ‘http://expat.sourceforge.net’.
Build GDB with GNU libiconv, a character set encoding
conversion library. This is not done by default, as on GNU systems
iconv that is built in to the C library is sufficient. If
your host does not have a working
iconv, you can get the latest
version of GNU iconv from ‘https://www.gnu.org/software/libiconv/’.
GDB’s build system also supports building GNU libiconv as part of the overall build. See Requirements.
Build GDB with LZMA, a compression library. (Done by default if liblzma is installed and found at configure time.) LZMA is used by GDB’s "mini debuginfo" feature, which is only useful on platforms using the ELF object file format. If your host does not have liblzma installed, you can get the latest version from ‘https://tukaani.org/xz/’.
Build GDB with GNU MPFR, a library for multiple-precision floating-point computation with correct rounding. (Done by default if GNU MPFR is installed and found at configure time.) This library is used to emulate target floating-point arithmetic during expression evaluation when the target uses different floating-point formats than the host. If GNU MPFR is not available, GDB will fall back to using host floating-point arithmetic. If your host does not have GNU MPFR installed, you can get the latest version from ‘http://www.mpfr.org’.
Build GDB with Python scripting support. (Done by default if libpython is present and found at configure time.) Python makes GDB scripting much more powerful than the restricted CLI scripting language. If your host does not have Python installed, you can find it on ‘http://www.python.org/download/’. The oldest version of Python supported by GDB is 2.6. The optional argument python is used to find the Python headers and libraries. It can be either the name of a Python executable, or the name of the directory in which Python is installed.
Build GDB with GNU Guile scripting support. (Done by default
if libguile is present and found at configure time.) If your host
does not have Guile installed, you can find it at
‘https://www.gnu.org/software/guile/’. The optional argument GUILE
can be a version number, which will cause
configure to try to
use that version of Guile; or the file name of a
executable, which will be queried to find the information needed to
compile and link against Guile.
Don’t use the regex library included with GDB (as part of the libiberty library). This is the default on hosts with version 2 of the GNU C library.
Use dir as the default system root directory for libraries whose
file names begin with /lib’ or /usr/lib'. (The value of
dir can be modified at run time by using the
sysroot command.) If dir is under the GDB configured
prefix (set with
--exec-prefix options, the
default system root will be automatically adjusted if and when
GDB is moved to a different location.
Configure GDB to automatically load a system-wide init file. file should be an absolute file name. If file is in a directory under the configured prefix, and GDB is moved to another location after being built, the location of the system-wide init file will be adjusted accordingly.
Configure GDB to automatically load init files from a system-wide directory. directory should be an absolute directory name. If directory is in a directory under the configured prefix, and GDB is moved to another location after being built, the location of the system-wide init directory will be adjusted accordingly.
When building the GDB sources, ask the compiler to warn about any code which looks even vaguely suspicious. It passes many different warning flags, depending on the exact version of the compiler you are using.
Treat compiler warnings as werrors. It adds the
to the compiler, which will fail the compilation if the compiler
outputs any warning messages.
Enable the GCC undefined behavior sanitizer. This is disabled by
default, but passing
configure will enable it. The
undefined behavior sanitizer checks for C++ undefined behavior.
It has a performance cost, so if you are looking at GDB’s
performance, you should disable it. The undefined behavior sanitizer
was first introduced in GCC 4.9.