Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Fix inclusion of term.h
@ 2004-11-07 23:51 John David Anglin
  2004-11-08 11:27 ` Mark Kettenis
  0 siblings, 1 reply; 2+ messages in thread
From: John David Anglin @ 2004-11-07 23:51 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Fix inclusion of term.h
  2004-11-07 23:51 [patch] Fix inclusion of term.h John David Anglin
@ 2004-11-08 11:27 ` Mark Kettenis
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Kettenis @ 2004-11-08 11:27 UTC (permalink / raw)
  To: dave; +Cc: gdb-patches

   Date: Sun, 7 Nov 2004 18:51:01 -0500 (EST)
   From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>

   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.

Good catch!  Patch looks reasonable, so go ahead.

Thanks,

Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-08 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-07 23:51 [patch] Fix inclusion of term.h John David Anglin
2004-11-08 11:27 ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox