From patchwork Sat Jan 17 09:55:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 4723 Received: (qmail 26077 invoked by alias); 17 Jan 2015 09:55:13 -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 26065 invoked by uid 89); 17 Jan 2015 09:55:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout20.012.net.il Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 17 Jan 2015 09:55:10 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NIB00100F3JJM00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Sat, 17 Jan 2015 11:55:07 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NIB001P7FJVEV20@a-mtaout20.012.net.il>; Sat, 17 Jan 2015 11:55:07 +0200 (IST) Date: Sat, 17 Jan 2015 11:55:27 +0200 From: Eli Zaretskii Subject: Re: [PATCHSET] [4/4] Fix various issue in TUI In-reply-to: <83bnmd8028.fsf@gnu.org> To: palves@redhat.com Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83y4p1zq7k.fsf@gnu.org> References: <83vbkrbt4d.fsf@gnu.org> <54AAEC02.7020500@redhat.com> <83bnmd8028.fsf@gnu.org> X-IsSubscribed: yes > Date: Mon, 05 Jan 2015 22:06:07 +0200 > From: Eli Zaretskii > Cc: gdb-patches@sourceware.org > > > Date: Mon, 05 Jan 2015 19:54:42 +0000 > > From: Pedro Alves > > > > On 12/31/2014 05:56 PM, Eli Zaretskii wrote: > > > Well, one patch is Windows-specific after all. This patch makes sure > > > windows-termcap is not compiled when GDB is linked against ncurses, > > > > ... > > > > > and also makes the file a no-op should it compile in that > > > configuration. > > > > With the configure.ac change, how can that happen? > > It shouldn't. > > > > --- gdb/configure.ac~0 2014-10-29 21:45:50 +0200 > > > +++ gdb/configure.ac 2014-12-30 07:42:27 +0200 > > > @@ -627,9 +627,10 @@ > > > ac_cv_search_tgetent="none required" > > > ;; > > > *mingw32*) > > > - ac_cv_search_tgetent="none required" > > > - CONFIG_OBS="$CONFIG_OBS windows-termcap.o" > > > - ;; > > > + if test x"$prefer_curses" = xyes; then > > > + ac_cv_search_tgetent="none required" > > > + CONFIG_OBS="$CONFIG_OBS windows-termcap.o" > > > > I'm confused on the predicate here. How can we tell > > from $prefer_curses that the curses library doesn't include > > termcap? AFAICS, if the TUI is enabled, it'll always be > > "yes". But isn't that the case where you _don't_ > > want windows-termcap.o? And shouldn't this be checking > > $curses_found? > > Sorry, I sent the wrong patch here. It should be !=, of course. > > > > --- gdb/windows-termcap.c~0 2014-06-11 18:34:41 +0300 > > > +++ gdb/windows-termcap.c 2014-12-29 15:42:44 +0200 > > > @@ -19,6 +19,11 @@ > > > You should have received a copy of the GNU General Public License > > > along with this program. If not, see . */ > > > > > > + > > > +#include "config.h" > > > > All files in gdb/ should start with "defs.h" instead. > > OK. I just realized that I cannot push this changeset because Autoconf I have installed isn't version 2.64, and so I cannot regenerate 'configure'. Could someone please do that for me? The patch is below. Or I could push the patch below, and then someone else could do the generated files as a separate commit. Thanks in advance. Don't use windows-termcap.c when linking against a curses library gdb/ 2015-01-17 Eli Zaretskii * configure.ac [*mingw32*]: Only add windows-termcap.o to CONFIG_OBS if not building with a curses library. * windows-termcap.c: Include defs.h. Make the whole body empty if either one of HAVE_CURSES_H or HAVE_NCURSES_H or HAVE_NCURSES_NCURSES_H is defined. diff --git a/gdb/configure.ac b/gdb/configure.ac index 8dd7f8f..b852b93 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -611,9 +611,10 @@ case $host_os in ac_cv_search_tgetent="none required" ;; *mingw32*) - ac_cv_search_tgetent="none required" - CONFIG_OBS="$CONFIG_OBS windows-termcap.o" - ;; + if test x"$prefer_curses" != xyes; then + ac_cv_search_tgetent="none required" + CONFIG_OBS="$CONFIG_OBS windows-termcap.o" + fi ;; esac # These are the libraries checked by Readline. diff --git a/gdb/windows-termcap.c b/gdb/windows-termcap.c index 026c3d2..b366f65 100644 --- a/gdb/windows-termcap.c +++ b/gdb/windows-termcap.c @@ -19,6 +19,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + +#include "defs.h" + +#if !defined HAVE_CURSES_H && !defined HAVE_NCURSES_H && !defined HAVE_NCURSES_NCURSES_H + #include /* -Wmissing-prototypes */ @@ -71,3 +76,5 @@ { return NULL; } + +#endif /* !HAVE_CURSES_H && !HAVE_NCURSES_H && !HAVE_NCURSES_NCURSES_H */ diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index ac23875..832ce0b 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2015-01-17 Eli Zaretskii + + * strerror.c : Declare only if they aren't + macros. + 2014-12-24 Uros Bizjak Ben Elliston Manuel Lopez-Ibanez diff --git a/libiberty/strerror.c b/libiberty/strerror.c index 0efadc3..a8a0bd1 100644 --- a/libiberty/strerror.c +++ b/libiberty/strerror.c @@ -469,8 +469,13 @@ struct error_info #else + +#ifndef sys_nerr extern int sys_nerr; +#endif +#ifndef sys_errlist extern char *sys_errlist[]; +#endif #endif