Enable building GDB without installed libtermcap
Commit Message
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:
Thanks
Bernd.
Comments
On 24 Feb 2015 19:13, Bernd Edlinger wrote:
> Maybe the name windows-termcap.c is a bit misleading,
> because my target is mostly some embedded linux.
yes, i think you should rename it to "stub-termcap.c" or something similar.
-mike
On Tue, Feb 24, 2015 at 11:34 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On 24 Feb 2015 19:13, Bernd Edlinger wrote:
>> Maybe the name windows-termcap.c is a bit misleading,
>> because my target is mostly some embedded linux.
>
> yes, i think you should rename it to "stub-termcap.c" or something similar.
> -mike
Agreed.
On 02/24/2015 08:29 PM, Doug Evans wrote:
> On Tue, Feb 24, 2015 at 11:34 AM, Mike Frysinger <vapier@gentoo.org> wrote:
>> On 24 Feb 2015 19:13, Bernd Edlinger wrote:
>>> Maybe the name windows-termcap.c is a bit misleading,
>>> because my target is mostly some embedded linux.
>>
>> yes, i think you should rename it to "stub-termcap.c" or something similar.
>> -mike
>
> Agreed.
Alright, that much is noncontroversial, I think.
Done:
https://sourceware.org/ml/gdb-patches/2015-02/msg00772.html
@@ -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
Â
Â
@@ -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],
@@ -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. */