From patchwork Thu Jan 22 18:35:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 4762 Received: (qmail 27279 invoked by alias); 22 Jan 2015 18:36:01 -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 27157 invoked by uid 89); 22 Jan 2015 18:35:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 22 Jan 2015 18:35:22 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0MIZHVt010288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Jan 2015 13:35:17 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0MIZFeE006299; Thu, 22 Jan 2015 13:35:16 -0500 Message-ID: <54C142E3.2030000@redhat.com> Date: Thu, 22 Jan 2015 18:35:15 +0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Eli Zaretskii CC: gdb-patches@sourceware.org Subject: Re: [PATCHSET] [4/4] Fix various issue in TUI References: <83vbkrbt4d.fsf@gnu.org> <54AAEC02.7020500@redhat.com> <83bnmd8028.fsf@gnu.org> <83y4p1zq7k.fsf@gnu.org> <54C0E7FE.4020401@redhat.com> <83lhkuvl1v.fsf@gnu.org> <54C13014.6050306@redhat.com> <83fvb2vi49.fsf@gnu.org> In-Reply-To: <83fvb2vi49.fsf@gnu.org> On 01/22/2015 05:29 PM, Eli Zaretskii wrote: >> Date: Thu, 22 Jan 2015 17:15:00 +0000 >> From: Pedro Alves >> CC: gdb-patches@sourceware.org >> >>>> So shouldn't the right check be this: >>>> >>>> if test x"$curses_found" != xyes; then >>>> ac_cv_search_tgetent="none required" >>>> CONFIG_OBS="$CONFIG_OBS windows-termcap.o" >>>> fi ;; >>>> >>>> ? >>> >>> I'm not sure. GDB can be configured --without-tui --with-curses. >>> Does your logic work then? >> >> It's the same thing. > > Then please install your variant (on the branch as well). I trust you > know this stuff much better than I do. And indeed, I tried cross compiling current mainline mingw gdb, on my fedora 20 box, and it's broken: ... object-run.o compile-loc2c.o compile-c-support.o inflow.o init.o \ ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a ./../intl/libintl.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lm /home/pedro/src/expat/install-win64/lib/libexpat.a ../libiberty/libiberty.a -lws2_32 build-gnulib/import/libgnu.a utils.o: In function `init_page_info': /home/pedro/gdb/mygit/build-mingw/gdb/../../src/gdb/utils.c:1683: undefined reference to `tgetnum' ../readline/libreadline.a(display.o): In function `rl_redisplay': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/display.c:1087: undefined reference to `tputs' ../readline/libreadline.a(display.o): In function `update_line': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/display.c:1528: undefined reference to `tputs' ../readline/libreadline.a(display.o): In function `_rl_move_cursor_relative': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/display.c:1985: undefined reference to `tputs' ../readline/libreadline.a(display.o): In function `_rl_move_vert': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/display.c:2057: undefined reference to `tputs' /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/display.c:2073: undefined reference to `tputs' ../readline/libreadline.a(display.o):/home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/display.c:2336: more undefined references to `tputs' follow ../readline/libreadline.a(terminal.o): In function `_rl_get_screen_size': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:278: undefined reference to `tgetnum' /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:297: undefined reference to `tgetnum' ../readline/libreadline.a(terminal.o): In function `get_term_capabilities': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:427: undefined reference to `tgetstr' ../readline/libreadline.a(terminal.o): In function `_rl_init_terminal_io': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:481: undefined reference to `tgetent' /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:545: undefined reference to `tgetflag' /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:545: undefined reference to `tgetflag' /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:560: undefined reference to `tgetflag' ../readline/libreadline.a(terminal.o): In function `_rl_backspace': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:665: undefined reference to `tputs' ../readline/libreadline.a(terminal.o): In function `rl_ding': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:703: undefined reference to `tputs' ../readline/libreadline.a(terminal.o): In function `_rl_enable_meta_key': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:729: undefined reference to `tputs' ../readline/libreadline.a(terminal.o): In function `_rl_control_keypad': /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:739: undefined reference to `tputs' /home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:741: undefined reference to `tputs' ../readline/libreadline.a(terminal.o):/home/pedro/gdb/mygit/build-mingw/readline/../../src/readline/terminal.c:765: more undefined references to `tputs' follow collect2: error: ld returned 1 exit status make: *** [gdb.exe] Error 1 That's a plain configure: $ ../src/configure --disable-ld --disable-gas --disable-binutils --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 and so I end up with $prefer_curses set, because that configure defaults to build the TUI, but I don't have ncurses in my sysroot. I'm pushing this. --- From 03b7960334677d33ee7410f2c819f78820c32024 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 22 Jan 2015 18:30:01 +0000 Subject: [PATCH] mingw32: fix windows-termcap/curses check When GDB is configured with "--without-tui --with-curses" or "--with-tui", $prefer_curses is set to yes. But, that still doesn't mean that curses will be used. configure will still search for the curses library, and continue building without it. That's done here: curses_found=no if test x"$prefer_curses" = xyes; then ... AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses]) if test "$ac_cv_search_waddstr" != no; then curses_found=yes fi fi So if waddstr is not found, meaning curses is not really available, even though it'd be preferred, $prefer_curses is 'yes', but $curses_found is 'no'. So the right fix to tell whether we're linking with curses is $curses_found=yes. gdb/ChangeLog: 2015-01-22 Pedro Alves * configure.ac [*mingw32*]: Check $curses_found instead of $prefer_curses. * configure: Regenerate. * windows-termcap.c: Remove HAVE_CURSES_H, HAVE_NCURSES_H and HAVE_NCURSES_NCURSES_H checks. --- gdb/ChangeLog | 8 ++++++++ gdb/configure | 2 +- gdb/configure.ac | 2 +- gdb/windows-termcap.c | 4 ---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a6ba992..6e3e258 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2015-01-22 Pedro Alves + + * configure.ac [*mingw32*]: Check $curses_found instead of + $prefer_curses. + * configure: Regenerate. + * windows-termcap.c: Remove HAVE_CURSES_H, HAVE_NCURSES_H and + HAVE_NCURSES_NCURSES_H checks. + 2015-01-22 Eli Zaretskii * gdb/tui/tui.c (tui_enable) [__MINGW32__]: If the call to 'newterm' diff --git a/gdb/configure b/gdb/configure index fb2480c..9632f9a 100755 --- a/gdb/configure +++ b/gdb/configure @@ -7188,7 +7188,7 @@ case $host_os in ac_cv_search_tgetent="none required" ;; *mingw32*) - if test x"$prefer_curses" != xyes; then + if test x"$curses_found" != xyes; then ac_cv_search_tgetent="none required" CONFIG_OBS="$CONFIG_OBS windows-termcap.o" fi ;; diff --git a/gdb/configure.ac b/gdb/configure.ac index 36a74d2..dfc6947 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -611,7 +611,7 @@ case $host_os in ac_cv_search_tgetent="none required" ;; *mingw32*) - if test x"$prefer_curses" != xyes; then + if test x"$curses_found" != xyes; then ac_cv_search_tgetent="none required" CONFIG_OBS="$CONFIG_OBS windows-termcap.o" fi ;; diff --git a/gdb/windows-termcap.c b/gdb/windows-termcap.c index 0154083..caafc47 100644 --- a/gdb/windows-termcap.c +++ b/gdb/windows-termcap.c @@ -22,8 +22,6 @@ #include "defs.h" -#if !defined HAVE_CURSES_H && !defined HAVE_NCURSES_H && !defined HAVE_NCURSES_NCURSES_H - #include /* -Wmissing-prototypes */ @@ -76,5 +74,3 @@ tgoto (const char *cap, int col, int row) { return NULL; } - -#endif /* !HAVE_CURSES_H && !HAVE_NCURSES_H && !HAVE_NCURSES_NCURSES_H */