]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: include --enable-targets in 'show configuration' output
authorAndrew Burgess <aburgess@redhat.com>
Sat, 5 Oct 2024 11:34:14 +0000 (12:34 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 8 Oct 2024 13:19:00 +0000 (14:19 +0100)
Include the value of configuration flag --enable-targets in the output
of GDB command 'show configuration' and also in the output printed for
'gdb --configuration'.  This will make it easier to see how GDB was
built.

No tests added or updated as we can't really check for a specific flag
appearing or not appearing on the configuration output.  But we do
print the configuration within lib/gdb.exp to check which features are
built into GDB, so if this change broke configuration printing then
plenty of tests should stop working (they don't).

Approved-By: Tom Tromey <tom@tromey.com>
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/top.c

index 57be033802e33194a9bf4fe871d7a0aa3371c9db..59a5da39553fb5bd9bc2cd62785966af8dfcf9fc 100644 (file)
@@ -46,6 +46,9 @@
    language is requested. */
 #undef ENABLE_NLS
 
+/* Additional targets configured into GDB. */
+#undef ENABLE_TARGETS
+
 /* The .gdbearlyinit filename. */
 #undef GDBEARLYINIT
 
index 53eaad4f0e28fbbf642427c97857126abc4162eb..ec9bbd3a8425c21fb7341bf3b5cfa39688cf3af6 100755 (executable)
@@ -24828,11 +24828,19 @@ if test "${enable_targets+set}" = set; then :
   yes | "") as_fn_error $? "enable-targets option must specify target names or 'all'" "$LINENO" 5
             ;;
   no)       enable_targets= ;;
-  *)        enable_targets=$enableval ;;
+  *)
+       enable_targets=$enableval
+
+cat >>confdefs.h <<_ACEOF
+#define ENABLE_TARGETS "$enable_targets"
+_ACEOF
+
+       ;;
 esac
 fi
 
 
+
 # Check whether --enable-64-bit-bfd was given.
 if test "${enable_64_bit_bfd+set}" = set; then :
   enableval=$enable_64_bit_bfd; case $enableval in #(
index 8368fea0423e98f220f3c55f2277324814a8c7a5..21f5dc8dd301fe2d534f3ec0a9c6f3726ede3a32 100644 (file)
@@ -184,9 +184,14 @@ AS_HELP_STRING([--enable-targets=TARGETS], [alternative target configurations]),
   yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
             ;;
   no)       enable_targets= ;;
-  *)        enable_targets=$enableval ;;
+  *)
+       enable_targets=$enableval
+       AC_DEFINE_UNQUOTED(ENABLE_TARGETS, "$enable_targets",
+                          Additional targets configured into GDB. )
+       ;;
 esac])
 
+
 BFD_64_BIT
 
 # Provide defaults for some variables set by the per-host and per-target
index eae54aae1ffbe65b34436baca0b8125a4473f6a8..d34e733eb0ff224fd6e3781d4517dc0fa2624a16 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1379,6 +1379,11 @@ This GDB was configured as follows:\n\
    configure --host=%s --target=%s\n\
 "), host_name, target_name);
 
+#ifdef ENABLE_TARGETS
+  gdb_printf (stream, _("\
+            --enable-targets=%s\n"), ENABLE_TARGETS);
+#endif
+
   gdb_printf (stream, _("\
             --with-auto-load-dir=%s\n\
             --with-auto-load-safe-path=%s\n\