[PATCH] Enable building GDB without installed libtermcap

Bernd Edlinger bernd.edlinger@hotmail.de
Tue Feb 24 18:18:00 GMT 2015


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.
 		 	   		  


More information about the Gdb-patches mailing list