This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] Enable building GDB without installed libtermcap
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Pedro Alves <palves at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Tue, 24 Feb 2015 19:13:08 +0100
- Subject: RE: [PATCH] Enable building GDB without installed libtermcap
- Authentication-results: sourceware.org; auth=none
- References: <DUB118-W1951908395674D538A9BBDE4280 at phx dot gbl> <54EB4FDF dot 1060909 at redhat dot com>,<54EB513A dot 8050706 at redhat dot com>
Hi,
On Mon, 23 Feb 2015 16:11:38, Pedro Alves wrote:
>
> On 02/23/2015 04:05 PM, Pedro Alves wrote:
>
>>> The idea for this patch is to include a simple version of libtermcap as a fall-back
>>> for the case that the host compiler does not have any cursor library. This enables
>>> at least a non tui-enabled gdb. It works even if there is no termcap configuration
>>> file on the target. If a termcap or curses library can be found when configuring gdb,
>>> we will use the installed library instead of the included libtermcap.
>
> ...
>
>> I don't see any change to libtermcap that makes this a "simple version of libtermcap".
>> AFAICS, this is really libtermcap, minus the manual and the definitions. Parts of
>> the libtermcap patch you show look like something that really should be sent
>> to libtermcap's list, even.
>
> ...
>
>> Sorry, without a better rationale, I don't see how this makes sense. We
>> like to have _fewer_ copies of upstream projects in the repo (such as
>> e.g., readline), not more.
>
> I should have added that GDB _already_ has a very minimal termcap in
> the tree -- see gdb/windows-termcap.c. We could consider making that
> the fallback on all hosts.
>
Ok, thanks for this hint!
That is probably exactly what I need.
This makes the patch much smaller.
Maybe the name windows-termcap.c is a bit misleading,
because my target is mostly some embedded linux.
How about this:
diff --git a/gdb/configure b/gdb/configure
index 9632f9a..d44ac41 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -7253,7 +7253,7 @@ fi
if test "$ac_cv_search_tgetent" = no; then
- as_fn_error "no termcap library found" "$LINENO" 5
+ CONFIG_OBS="$CONFIG_OBS windows-termcap.o"
fi
diff --git a/gdb/configure.ac b/gdb/configure.ac
index dfc6947..87ca668 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -621,7 +621,7 @@ esac
AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
if test "$ac_cv_search_tgetent" = no; then
- AC_MSG_ERROR([no termcap library found])
+ CONFIG_OBS="$CONFIG_OBS windows-termcap.o"
fi
AC_ARG_WITH([system-readline],
diff --git a/gdb/windows-termcap.c b/gdb/windows-termcap.c
index caafc47..b6e0d08 100644
--- a/gdb/windows-termcap.c
+++ b/gdb/windows-termcap.c
@@ -32,6 +32,8 @@ extern char* tgetstr (char *name, char **area);
extern int tputs (char *string, int nlines, int (*outfun) ());
extern char *tgoto (const char *cap, int col, int row);
+char PC, *BC, *UP;
+
/* Each of the files below is a minimal implementation of the standard
termcap function with the same name, suitable for use in a Windows
console window. */
Thanks
Bernd.