Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 8/8] Require readline 7 or newer
Date: Wed, 07 Aug 2019 22:31:00 -0000	[thread overview]
Message-ID: <87o910ehgf.fsf@tromey.com> (raw)
In-Reply-To: <91cf16b4-343b-1d47-ab5c-c8f2127cd4db@redhat.com> (Pedro Alves's	message of "Wed, 7 Aug 2019 15:42:14 +0100")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> I'd be much better user experience if this were done at by the
Pedro> build system, at configure time, with AC_TRY_COMPILE, IMO.  Something
Pedro> similar to the "GNU regex" check should do it.

Makes sense.  Here's a new patch that addresses this and the NEWS thing.

Tom

commit 332eb34e3d21c1a3de2b4f6c874912321da1b3a4
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-07  Tom Tromey  <tom@tromey.com>
    
            * configure: Rebuild.
            * configure.ac: Check for readline 7.
            * NEWS: Mention readline 7 requirement.
            * README: Update.
    
    gdb/doc/ChangeLog
    2019-04-21  Tom Tromey  <tom@tromey.com>
    
            * gdb.texinfo (Configure Options): Document minimum version of
            readline.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2e05431607c..54d35df7a01 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2019-08-07  Tom Tromey  <tom@tromey.com>
+
+	* configure: Rebuild.
+	* configure.ac: Check for readline 7.
+	* NEWS: Mention readline 7 requirement.
+	* README: Update.
+
 2019-08-04  Tom Tromey  <tom@tromey.com>
 
 	* mingw-hdep.c (gdb_select): Remove readline hack.
diff --git a/gdb/NEWS b/gdb/NEWS
index fa01adf6e89..9f37e7c1079 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 and GDBserver 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 8a91aab2a4c..8883a8a09e3 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 9206f0e7f88..2832c836177 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 05b722b7f11..0979109d976 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 702bb7c7a02..f25b468468b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2019-04-21  Tom Tromey  <tom@tromey.com>
+
+	* gdb.texinfo (Configure Options): Document minimum version of
+	readline.
+
 2019-08-07  Alan Hayward  <alan.hayward@arm.com>
 
 	* gdb.texinfo (AArch64 Pointer Authentication): New subsection.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 7f8c0aff1cd..e36b2d59745 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


  reply	other threads:[~2019-08-07 22:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 20:43 [PATCH 0/8] Upgrade readline Tom Tromey
2019-08-06 20:43 ` [PATCH 7/8] Remove readline hack from gdb_select Tom Tromey
2019-08-07 14:29   ` Pedro Alves
2019-08-07 22:03     ` Tom Tromey
2019-08-07 22:16       ` Christian Biesinger via gdb-patches
2019-08-06 20:43 ` [PATCH 4/8] Remove gdb workaround from readline/xfree.c Tom Tromey
2019-08-06 20:43 ` [PATCH 8/8] Require readline 7 or newer Tom Tromey
2019-08-07  2:27   ` Eli Zaretskii
2019-08-07 14:42   ` Pedro Alves
2019-08-07 22:31     ` Tom Tromey [this message]
2019-08-08  2:37       ` Eli Zaretskii
2019-08-08 11:26       ` Pedro Alves
2019-08-08 11:29       ` Pedro Alves
2019-08-08 20:38         ` Tom Tromey
2019-08-07 14:45   ` Pedro Alves
2019-08-06 20:43 ` [PATCH 2/8] Remove gdb workaround from readline/complete.c Tom Tromey
2019-08-06 20:43 ` [PATCH 5/8] Fix gdb's selftest.exp after readline import Tom Tromey
2019-08-13 17:02   ` [committed][gdb/testsuite] Fix gdb.gdb/selftest.exp regexp Tom de Vries
2019-08-06 20:43 ` [PATCH 3/8] Remove gdb workaround from readline/emacs_keymap.c Tom Tromey
2019-08-07  3:05 ` [PATCH 0/8] Upgrade readline Kevin Buettner
2019-08-07 13:38   ` Tom Tromey
2019-08-07 13:40   ` Tom Tromey
2019-08-14 10:21     ` Tom de Vries
2019-08-15 13:46       ` Tom Tromey
2019-08-19 16:38         ` Tom de Vries
2019-08-07 16:32 ` Sergio Durigan Junior
2019-08-07 19:31   ` Tom Tromey
2019-08-12 19:46     ` Sergio Durigan Junior
2019-08-12 19:52       ` Christian Biesinger via gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o910ehgf.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox