public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Require readline 7 or newer
@ 2019-08-12 17:00 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-08-12 17:00 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=86c6b807f50ecec84e55007bf6cb6e54c159727b

commit 86c6b807f50ecec84e55007bf6cb6e54c159727b
Author: Tom Tromey <tom@tromey.com>
Date:   Sun Apr 21 13:58:49 2019 -0600

    Require readline 7 or newer
    
    This changes gdb to require readline 7 or newer at build time.
    
    gdb/ChangeLog
    2019-08-12  Tom Tromey  <tom@tromey.com>
    
    	* configure: Rebuild.
    	* configure.ac: Check for readline 7.
    	* NEWS: Mention readline 7 requirement.
    	* README: Update.
    
    gdb/doc/ChangeLog
    2019-08-12  Tom Tromey  <tom@tromey.com>
    
    	* gdb.texinfo (Configure Options): Document minimum version of
    	readline.

Diff:
---
 gdb/ChangeLog       |  7 +++++++
 gdb/NEWS            |  5 +++++
 gdb/README          |  3 ++-
 gdb/configure       | 32 ++++++++++++++++++++++++++++++++
 gdb/configure.ac    | 14 ++++++++++++++
 gdb/doc/ChangeLog   |  5 +++++
 gdb/doc/gdb.texinfo |  3 ++-
 7 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e134155..12998aa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
 2019-08-12  Tom Tromey  <tom@tromey.com>
 
+	* configure: Rebuild.
+	* configure.ac: Check for readline 7.
+	* NEWS: Mention readline 7 requirement.
+	* README: Update.
+
+2019-08-12  Tom Tromey  <tom@tromey.com>
+
 	* mingw-hdep.c (gdb_select): Remove readline hack.
 
 2019-08-09  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
diff --git a/gdb/NEWS b/gdb/NEWS
index fa01adf..462247f 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -299,6 +299,11 @@ maint show test-options-completion-result
   Using another implementation of the make program or an earlier version of
   GNU make to build GDB or GDBserver is not supported.
 
+* Building GDB now requires GNU readline >= 7.0.
+
+  GDB now bundles GNU readline 8.0, but if you choose to use
+  --with-system-readline, only readline >= 7.0 can be used.
+
 *** Changes in GDB 8.3
 
 * GDB and GDBserver now support access to additional registers on
diff --git a/gdb/README b/gdb/README
index 8a91aab..8883a8a 100644
--- a/gdb/README
+++ b/gdb/README
@@ -439,7 +439,8 @@ more obscure GDB `configure' options are not listed here.
 
 `--with-system-readline'
      Use the readline library installed on the host, rather than the
-     library supplied as part of GDB.
+     library supplied as part of GDB.  Readline 7 or newer is required;
+     this is enforced by the build system.
 
 `--with-system-zlib
      Use the zlib library installed on the host, rather than the
diff --git a/gdb/configure b/gdb/configure
index 9206f0e..2832c83 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -8952,6 +8952,38 @@ fi
 
 
 if test "$with_system_readline" = yes; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system readline is new enough" >&5
+$as_echo_n "checking whether system readline is new enough... " >&6; }
+if ${gdb_cv_readline_ok+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+#include <readline/readline.h>
+int
+main ()
+{
+#if RL_VERSION_MAJOR < 7
+# error "readline version 7 required"
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gdb_cv_readline_ok=yes
+else
+  gdb_cv_readline_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_readline_ok" >&5
+$as_echo "$gdb_cv_readline_ok" >&6; }
+  if test "$gdb_cv_readline_ok" != yes; then
+    as_fn_error $? "system readline is not new enough" "$LINENO" 5
+  fi
+
   READLINE=-lreadline
   READLINE_DEPS=
   READLINE_CFLAGS=
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 05b722b..0979109 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -581,6 +581,20 @@ AC_ARG_WITH([system-readline],
                   [use installed readline library])])
 
 if test "$with_system_readline" = yes; then
+   AC_CACHE_CHECK([whether system readline is new enough],
+     [gdb_cv_readline_ok],
+     [AC_TRY_COMPILE(
+       [#include <stdio.h>
+#include <readline/readline.h>],
+       [#if RL_VERSION_MAJOR < 7
+# error "readline version 7 required"
+#endif],
+    gdb_cv_readline_ok=yes,
+    gdb_cv_readline_ok=no)])
+  if test "$gdb_cv_readline_ok" != yes; then
+    AC_MSG_ERROR([system readline is not new enough])
+  fi
+
   READLINE=-lreadline
   READLINE_DEPS=
   READLINE_CFLAGS=
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 5b55e05..971e9c3 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-12  Tom Tromey  <tom@tromey.com>
+
+	* gdb.texinfo (Configure Options): Document minimum version of
+	readline.
+
 2019-08-09  Alan Hayward  <alan.hayward@arm.com>
 
         * gdb.texinfo (AArch64 Pointer Authentication): Fix typo.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index c8ca757..523e3d0 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -36905,7 +36905,8 @@ details.
 
 @item --with-system-readline
 Use the readline library installed on the host, rather than the
-library supplied as part of @value{GDBN}.
+library supplied as part of @value{GDBN}.  Readline 7 or newer is
+required; this is enforced by the build system.
 
 @item --with-system-zlib
 Use the zlib library installed on the host, rather than the library


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-12 17:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 17:00 [binutils-gdb] Require readline 7 or newer Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).