This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Fix inclusion of term.h
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 7 Nov 2004 18:51:01 -0500 (EST)
- Subject: [patch] Fix inclusion of term.h
The enclosed patch fixes a build problem on hppa2.0w-hp-hpux11.11 because
ncurses.h and HP term.h are not compatible. If ncurses.h is used, the
ncurses version of term.h needs to be used. I also noted that utils.c
was including the HP version of curses.h while tui/tui.c was using the
ncurses/ncurses.h header.
This issue arises because configure now looks into the "ncurses" directory
for ncurses.h and this isn't searched by the compiler unless the directory
is added to CPPFLAGS.
OK?
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2004-11-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* configure.in: Check for ncurses/term.h.
* gdb_curses.h: Include term.h here, prefering ncurses/term.h.
* utils.c: Include gdb_curses.h instead of curses.h and term.h.
* tui/tui.c: Don't include term.h.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.177
diff -u -3 -p -r1.177 configure.in
--- configure.in 1 Nov 2004 21:05:48 -0000 1.177
+++ configure.in 7 Nov 2004 22:51:52 -0000
@@ -394,7 +394,8 @@ case $host_os in
Solaris 2.[789] when using GCC. ]])
fi ;;
esac
-AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h term.h)
+AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h)
+AC_CHECK_HEADERS(ncurses/term.h term.h)
# FIXME: kettenis/20030102: In most cases we include these
# unconditionally, so what's the point in checking these?
Index: gdb_curses.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_curses.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 gdb_curses.h
--- gdb_curses.h 15 Aug 2004 10:06:05 -0000 1.3
+++ gdb_curses.h 7 Nov 2004 22:51:52 -0000
@@ -32,4 +32,10 @@
#include <curses.h>
#endif
+#if defined (HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined (HAVE_TERM_H)
+#include <term.h>
+#endif
+
#endif /* gdb_curses.h */
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.138
diff -u -3 -p -r1.138 utils.c
--- utils.c 5 Nov 2004 20:32:04 -0000 1.138
+++ utils.c 7 Nov 2004 22:51:53 -0000
@@ -57,12 +57,7 @@
#include <sys/param.h> /* For MAXPATHLEN */
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#ifdef HAVE_TERM_H
-#include <term.h>
-#endif
+#include "gdb_curses.h"
#include "readline/readline.h"
Index: tui/tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.52
diff -u -3 -p -r1.52 tui.c
--- tui/tui.c 7 Sep 2004 21:55:12 -0000 1.52
+++ tui/tui.c 7 Nov 2004 22:51:53 -0000
@@ -44,9 +44,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#ifdef HAVE_TERM_H
-#include <term.h>
-#endif
#include <signal.h>
#include <fcntl.h>
#if 0