From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7051 invoked by alias); 7 Nov 2004 23:51:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7038 invoked from network); 7 Nov 2004 23:51:03 -0000 Received: from unknown (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org with SMTP; 7 Nov 2004 23:51:03 -0000 Received: from hiauly1.hia.nrc.ca (hiauly1.hia.nrc.ca [127.0.0.1] (may be forged)) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9) with ESMTP id iA7Np2ko003191 for ; Sun, 7 Nov 2004 18:51:02 -0500 (EST) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9/Submit) id iA7Np1J7003190 for gdb-patches@sources.redhat.com; Sun, 7 Nov 2004 18:51:01 -0500 (EST) Message-Id: <200411072351.iA7Np1J7003190@hiauly1.hia.nrc.ca> Subject: [patch] Fix inclusion of term.h To: gdb-patches@sources.redhat.com Date: Sun, 07 Nov 2004 23:51:00 -0000 From: "John David Anglin" MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00121.txt.bz2 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 * 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 #endif +#if defined (HAVE_NCURSES_TERM_H) +#include +#elif defined (HAVE_TERM_H) +#include +#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 /* For MAXPATHLEN */ -#ifdef HAVE_CURSES_H -#include -#endif -#ifdef HAVE_TERM_H -#include -#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 #include #include -#ifdef HAVE_TERM_H -#include -#endif #include #include #if 0