From patchwork Tue Feb 24 18:13:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 5267 Received: (qmail 57532 invoked by alias); 24 Feb 2015 18:18:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 55032 invoked by uid 89); 24 Feb 2015 18:18:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: DUB004-OMC2S25.hotmail.com Received: from dub004-omc2s25.hotmail.com (HELO DUB004-OMC2S25.hotmail.com) (157.55.1.164) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Tue, 24 Feb 2015 18:14:34 +0000 Received: from DUB118-W46 ([157.55.1.138]) by DUB004-OMC2S25.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Tue, 24 Feb 2015 10:13:08 -0800 X-TMN: [ObVCI68R2zzki0Bf2x9S0o4emIrbB/m1] Message-ID: From: Bernd Edlinger To: Pedro Alves CC: GDB Patches Subject: RE: [PATCH] Enable building GDB without installed libtermcap Date: Tue, 24 Feb 2015 19:13:08 +0100 In-Reply-To: <54EB513A.8050706@redhat.com> References: <54EB4FDF.1060909@redhat.com>, <54EB513A.8050706@redhat.com> MIME-Version: 1.0 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. 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.  */