public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] configure: exit with an error if no termcap lib is installed
@ 2022-07-21  8:51 Christophe Lyon
  2022-07-22 20:35 ` Keith Seitz
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lyon @ 2022-07-21  8:51 UTC (permalink / raw)
  To: gdb-patches

The termcap detection code in aclocal.m4 (BASH_CHECK_LIB_TERMCAP)
defaults to "gnutermcap" if none of the usual libraries is available
(termcap, tinfo, curses, ncurses, ncursesw).

Then it sets TERMCAP_LIB to "./lib/termcap/libtermcap.a", so it
expects that libtermcap.a is present under lib/termcap in the build
directory.

In fact, this is generally not the case (we do not manually install
libtermcap in the build tree), so it's better to stop with an error
message.
---
 readline/README                | 3 +++
 readline/readline/configure    | 2 +-
 readline/readline/configure.ac | 3 +--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/readline/README b/readline/README
index 54e1c72b197..20b12b6d8a9 100644
--- a/readline/README
+++ b/readline/README
@@ -16,3 +16,6 @@ update this file.
 Individual upstream readline patches can be directly imported using
 "git am".  You can see the current patch level by looking at
 readline/patchlevel.
+
+Local patches:
+- configure: exit with an error if no termcap lib is installed
diff --git a/readline/readline/configure b/readline/readline/configure
index 6ea4545e26f..b162eb374a1 100755
--- a/readline/readline/configure
+++ b/readline/readline/configure
@@ -6367,7 +6367,7 @@ if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
 	if test "$prefer_curses" = yes; then
 		TERMCAP_LIB=-lcurses
 	else
-		TERMCAP_LIB=-ltermcap	#default
+		as_fn_error $? "missing required termcap lib or equivalent" "$LINENO" 5
 	fi
 fi
 # Windows ncurses installation
diff --git a/readline/readline/configure.ac b/readline/readline/configure.ac
index 912c99b6575..4e2102e8198 100644
--- a/readline/readline/configure.ac
+++ b/readline/readline/configure.ac
@@ -207,8 +207,7 @@ if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
 	if test "$prefer_curses" = yes; then
 		TERMCAP_LIB=-lcurses
 	else
-		TERMCAP_LIB=-ltermcap	#default
-	fi
+		AC_MSG_ERROR(missing required termcap lib or equivalent)	fi
 fi
 # Windows ncurses installation
 if test "$TERMCAP_LIB" = "-lncurses"; then
-- 
2.25.1


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

end of thread, other threads:[~2022-07-22 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21  8:51 [PATCH] configure: exit with an error if no termcap lib is installed Christophe Lyon
2022-07-22 20:35 ` Keith Seitz

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