From: Eli Zaretskii Date: Mon, 19 Jan 2015 15:34:29 +0000 (+0100) Subject: Don't use windows-termcap.c when linking against a curses library X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63413d85873c450fa4ed2494f21fb1a65bdaf554;p=binutils-gdb.git 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. * configure: Regenerate. * 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/ChangeLog b/gdb/ChangeLog index b9f48573180..482c5cacaa7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2015-01-19 Eli Zaretskii + + * configure.ac [*mingw32*]: Only add windows-termcap.o to + CONFIG_OBS if not building with a curses library. + * configure: Regenerate. + + * 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. + 2015-01-19 Joel Brobecker * rs6000-tdep.c (rs6000_gdbarch_init): Move divide operator diff --git a/gdb/configure b/gdb/configure index f62d5a08c8a..fb2480c4ef5 100755 --- a/gdb/configure +++ b/gdb/configure @@ -7188,9 +7188,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/configure.ac b/gdb/configure.ac index 8dd7f8fcc1b..36a74d230c2 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 026c3d23119..01540833bc5 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 @@ tgoto (const char *cap, int col, int row) { return NULL; } + +#endif /* !HAVE_CURSES_H && !HAVE_NCURSES_H && !HAVE_NCURSES_NCURSES_H */