Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Alexandra Hájková via Gdb-patches" <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH v2] configure.ac: Check for the readline.h explicitly
Date: Sat, 20 Nov 2021 19:37:38 +0100	[thread overview]
Message-ID: <20211120183738.690960-1-ahajkova@redhat.com> (raw)
In-Reply-To: <20211118121440.558038-1-ahajkova@redhat.com>

From: Alexandra Hájková <ahajkova@redhat.com>

When readline development package is missing make fails with
"configure: error: system readline is not new enough" which
might be confusing. This patch checks for the readline.h explicitly
and makes make to warn about the missing package.
---
v2: use proper version of autoconf for regenerating configure

 gdb/config.in    |  3 +++
 gdb/configure    | 17 +++++++++++++++++
 gdb/configure.ac |  4 ++++
 3 files changed, 24 insertions(+)

diff --git a/gdb/config.in b/gdb/config.in
index 773a0ba91ef..4b8f1f7e1c6 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -382,6 +382,9 @@
 /* Define if Python interpreter is being linked in. */
 #undef HAVE_PYTHON
 
+/* Define to 1 if you have the <readline/readline.h> header file. */
+#undef HAVE_READLINE_READLINE_H
+
 /* Define to 1 if you have the `resize_term' function. */
 #undef HAVE_RESIZE_TERM
 
diff --git a/gdb/configure b/gdb/configure
index fe685f2d3d5..90c1e3d7948 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -9224,6 +9224,23 @@ fi
 
 
 if test "$with_system_readline" = yes; then
+  for ac_header in readline/readline.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
+if test "x$ac_cv_header_readline_readline_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_READLINE_READLINE_H 1
+_ACEOF
+ readline_h=yes
+else
+  readline_h=no
+fi
+
+done
+
+  if test "$readline_h" = "no"; then
+    as_fn_error $? "readline development packages are probably missing" "$LINENO" 5
+  fi
   { $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 :
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 56e8a2d8044..29c1c4589c9 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -596,6 +596,10 @@ AC_ARG_WITH([system-readline],
                   [use installed readline library])])
 
 if test "$with_system_readline" = yes; then
+  AC_CHECK_HEADERS(readline/readline.h, [readline_h=yes], [readline_h=no])
+  if test "$readline_h" = "no"; then
+    AC_MSG_ERROR([readline development packages are probably missing])
+  fi
   AC_CACHE_CHECK(
     [whether system readline is new enough],
     [gdb_cv_readline_ok],
-- 
2.33.1


  parent reply	other threads:[~2021-11-20 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 12:14 [PATCH] " Alexandra Hájková via Gdb-patches
2021-11-18 15:36 ` Tom Tromey
2021-11-20 18:37 ` Alexandra Hájková via Gdb-patches [this message]
2021-11-22 16:37   ` [PATCH v2] " Kevin Buettner 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=20211120183738.690960-1-ahajkova@redhat.com \
    --to=gdb-patches@sourceware.org \
    --cc=alexandra.khirnova@gmail.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