Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: gdb-patches@sources.redhat.com
Subject: [patch] Fix inclusion of term.h
Date: Sun, 07 Nov 2004 23:51:00 -0000	[thread overview]
Message-ID: <200411072351.iA7Np1J7003190@hiauly1.hia.nrc.ca> (raw)

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


             reply	other threads:[~2004-11-07 23:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-07 23:51 John David Anglin [this message]
2004-11-08 11:27 ` Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200411072351.iA7Np1J7003190@hiauly1.hia.nrc.ca \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox