aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-10-13 07:12:34 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-10-29 13:43:04 -0500
commited2a222951020d1117c5e1d4f37e82fd26761267 (patch)
treedfdcc500b315f3d576b8b8e0fa1a9ced2104da32 /gdb/configure
parent70cf683455e1a3429d517a2e25a36c438474cfde (diff)
downloadgdb-ed2a222951020d1117c5e1d4f37e82fd26761267.zip
gdb-ed2a222951020d1117c5e1d4f37e82fd26761267.tar.gz
gdb-ed2a222951020d1117c5e1d4f37e82fd26761267.tar.bz2
Load system gdbinit files from a directory
Adds a configure option --with-system-gdbinit-dir to specify a directory in which to look for gdbinit files. All files in this directory are loaded on startup (subject to -n/-nx as usual) as long as the extension matches a known and enabled scripting language (.gdb/.py/.scm). This also changes get_ext_lang_of_file to support ".gdb" files, similar to get_ext_lang_defn's handling of EXT_LANG_GDB. gdb/ChangeLog: 2019-10-29 Christian Biesinger <cbiesinger@google.com> * NEWS: Mention new --with-system-gdbinit-dir option. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Add new option --with-system-gdbinit-dir. * extension.c (get_ext_lang_of_file): Return extension_language_gdb for a ".gdb" suffix. * main.c (get_init_files): Change system_gdbinit argument to a vector and return the files in SYSTEM_GDBINIT_DIR in addition to SYSTEM_GDBINIT. (captured_main_1): Update. (print_gdb_help): Update. * top.c (print_gdb_configuration): Also print the value of SYSTEM_GDBINIT_DIR. gdb/doc/ChangeLog: 2019-10-29 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Also set SYSTEM_GDBINIT_DIR for the info manual generation. * gdb.texinfo (many sections): Document new --with-system-gdbinit-dir option. Change-Id: If233859ecc21bc6421d589b37cd658a3c7d030f2
Diffstat (limited to 'gdb/configure')
-rwxr-xr-xgdb/configure51
1 files changed, 51 insertions, 0 deletions
diff --git a/gdb/configure b/gdb/configure
index 4e2247d..e805903 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -697,6 +697,7 @@ WIN32LIBS
SER_HARDWIRE
WERROR_CFLAGS
WARN_CFLAGS
+SYSTEM_GDBINIT_DIR
SYSTEM_GDBINIT
TARGET_SYSTEM_ROOT
CONFIG_LDFLAGS
@@ -888,6 +889,7 @@ with_libipt_prefix
with_included_regex
with_sysroot
with_system_gdbinit
+with_system_gdbinit_dir
enable_werror
enable_build_warnings
enable_gdb_build_warnings
@@ -1624,6 +1626,9 @@ Optional Packages:
--with-sysroot[=DIR] search for usr/lib et al within DIR
--with-system-gdbinit=PATH
automatically load a system-wide gdbinit file
+ --with-system-gdbinit-dir=PATH
+ automatically load system-wide gdbinit files from
+ this directory
--with-lzma support lzma compression (auto/yes/no)
--with-liblzma-prefix[=DIR] search for liblzma in DIR/include and DIR/lib
--without-liblzma-prefix don't search for liblzma in includedir and libdir
@@ -15184,6 +15189,52 @@ _ACEOF
+# Check whether --with-system-gdbinit-dir was given.
+if test "${with_system_gdbinit_dir+set}" = set; then :
+ withval=$with_system_gdbinit_dir;
+ SYSTEM_GDBINIT_DIR=$withval
+else
+ SYSTEM_GDBINIT_DIR=
+fi
+
+
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+ ac_define_dir=`eval echo $SYSTEM_GDBINIT_DIR`
+ ac_define_dir=`eval echo $ac_define_dir`
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT_DIR "$ac_define_dir"
+_ACEOF
+
+
+
+
+ if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
+ else
+ test_prefix=$exec_prefix
+ fi
+ value=0
+ case ${ac_define_dir} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+ value=1
+ ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_GDBINIT_DIR_RELOCATABLE $value
+_ACEOF
+
+
+
+
+
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror; case "${enableval}" in