public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] configure.ac: Check for the readline.h explicitly
@ 2021-11-18 12:14 Alexandra Hájková
  2021-11-18 15:36 ` Tom Tromey
  2021-11-20 18:37 ` [PATCH v2] " Alexandra Hájková
  0 siblings, 2 replies; 4+ messages in thread
From: Alexandra Hájková @ 2021-11-18 12:14 UTC (permalink / raw)
  To: gdb-patches

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.
---
 configure               | 14 +++++++++++++-
 gdb/config.in           |  3 +++
 gdb/configure           | 31 ++++++++++++++++++++++++++++++-
 gdb/configure.ac        |  4 ++++
 gdb/testsuite/configure | 14 +++++++++++++-
 5 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 787fcf89100..6a1da1665d8 100755
--- a/configure
+++ b/configure
@@ -755,6 +755,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -919,6 +920,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1171,6 +1173,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1308,7 +1319,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1468,6 +1479,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
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 6e2dfb766c8..229103730dc 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -848,6 +848,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -998,6 +999,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1250,6 +1252,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1387,7 +1398,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1540,6 +1551,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -9224,6 +9236,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 d4cfb6a7624..eab45f6d263 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],
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 3b0d4ed8ad3..482427f948b 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -672,6 +672,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -745,6 +746,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -997,6 +999,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1134,7 +1145,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1287,6 +1298,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-- 
2.33.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] configure.ac: Check for the readline.h explicitly
  2021-11-18 12:14 [PATCH] configure.ac: Check for the readline.h explicitly Alexandra Hájková
@ 2021-11-18 15:36 ` Tom Tromey
  2021-11-20 18:37 ` [PATCH v2] " Alexandra Hájková
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2021-11-18 15:36 UTC (permalink / raw)
  To: Alexandra Hájková via Gdb-patches; +Cc: Alexandra Hájková

>>>>> ">" == Alexandra Hájková via Gdb-patches <gdb-patches@sourceware.org> writes:

>> 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.

Hi.  Thanks for the patch.

>> diff --git a/configure b/configure
>> index 787fcf89100..6a1da1665d8 100755
>> --- a/configure
>> +++ b/configure
>> @@ -755,6 +755,7 @@ infodir
>>  docdir
>>  oldincludedir
>>  includedir
>> +runstatedir
>>  localstatedir
>>  sharedstatedir
>>  sysconfdir

This hunk and some of the other ones may mean that you're regenerating
configure with a distro-modified autoconf rather than the pristine
upstream version.  I'm not sure (maybe someone else did this and your
patch is correcting it, I never remember), but FAOD make sure you're
using the unmodified one.

>>  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

This seems reasonable to me.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] configure.ac: Check for the readline.h explicitly
  2021-11-18 12:14 [PATCH] configure.ac: Check for the readline.h explicitly Alexandra Hájková
  2021-11-18 15:36 ` Tom Tromey
@ 2021-11-20 18:37 ` Alexandra Hájková
  2021-11-22 16:37   ` Kevin Buettner
  1 sibling, 1 reply; 4+ messages in thread
From: Alexandra Hájková @ 2021-11-20 18:37 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] configure.ac: Check for the readline.h explicitly
  2021-11-20 18:37 ` [PATCH v2] " Alexandra Hájková
@ 2021-11-22 16:37   ` Kevin Buettner
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Buettner @ 2021-11-22 16:37 UTC (permalink / raw)
  To: Alexandra Hájková via Gdb-patches; +Cc: Alexandra Hájková

On Sat, 20 Nov 2021 19:37:38 +0100
Alexandra Hájková wrote:

> 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

LGTM.

Kevin


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-22 16:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 12:14 [PATCH] configure.ac: Check for the readline.h explicitly Alexandra Hájková
2021-11-18 15:36 ` Tom Tromey
2021-11-20 18:37 ` [PATCH v2] " Alexandra Hájková
2021-11-22 16:37   ` Kevin Buettner

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).