This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Improve and simplify configure checks for curses
- From: Mark Kettenis <kettenis at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 18 Sep 2004 21:02:01 +0200 (CEST)
- Subject: [PATCH] Improve and simplify configure checks for curses
I've revised the autoconf checks for the curses libs a bit. I think
this makes the checks a bit more robust. It also eliminates a define
from the HP-UX .mh fragments.
Checked on hppa1.1-hp-hpux11.00, sparc-sun-solaris2.9,
i386-pc-linux-gnu and varous BSD's.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* config/pa/hpux1020.mh (MH_CFLAGS): Remove -D__HP_CURSES.
* config/pa/hpux11.mh (MH_CFLAGS): Likewise.
* config/pa/hpux11w.mh (MH_CFLAGS): Likewise.
* configure.in: Improve checks for curses library by checking for
mvwaddstr instead of initscr. Drop HP curses in favour of
standard curses on HP-UX.
* configure: Regenerated.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.171
diff -u -p -r1.171 configure.in
--- configure.in 13 Sep 2004 20:55:38 -0000 1.171
+++ configure.in 18 Sep 2004 18:40:04 -0000
@@ -195,7 +195,7 @@ AC_ARG_ENABLE(tui,
esac],enable_tui=yes)
if test x"$enable_tui" = xyes; then
if test -d $srcdir/tui; then
- if test "$ac_cv_search_initscr" != no -a "$ac_cv_search_wborder" != no; then
+ if test "$ac_cv_search_mvwaddstr" != no; then
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
@@ -332,9 +332,24 @@ AC_SEARCH_LIBS(gethostbyname, nsl)
# Some systems (e.g. Solaris) have `socketpair' in libsocket.
AC_SEARCH_LIBS(socketpair, socket)
-# Since GDB uses Readline, we need termcap functionality, so we need
-# to find a library that provides that. When GDB is configured with
-# the TUI, we need full curses functionality.
+# For the TUI, we need enhanced curses functionality.
+#
+# FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
+# curses library because the latter might not provide all the
+# functionality we need. However, this leads to problems on systems
+# where the linker searches /usr/local/lib, but the compiler doesn't
+# search /usr/local/include, if ncurses is installed in /usr/local. A
+# default installation of ncurses on alpha*-dec-osf* will lead to such
+# a situation.
+AC_SEARCH_LIBS(mvwaddstr, [ncurses cursesX curses])
+
+if test "$ac_cv_search_mvwaddstr" = no; then
+ AC_MSG_WARN([no curses library found])
+fi
+
+# Since GDB uses Readline, we need termcap functionality. In many
+# cases this will be provided by the curses library, but some systems
+# have a seperate termcap library, or no curses library at all.
case $host_os in
cygwin*)
@@ -345,47 +360,15 @@ case $host_os in
go32* | *djgpp*)
ac_cv_search_tgetent="none required"
;;
- aix*)
- # Readline prefers curses over termcap on AIX.
- # ??? Why?
- AC_SEARCH_LIBS(tgetent, [tinfo ncurses curses termcap])
- ;;
esac
-# Note: We used to check for libtermlib and libterminfo too, but
-# Readline doesn't, so I think we're safe with leaving them out.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo ncurses Hcurses curses])
+# These are the libraries checked by Readline.
+AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
if test "$ac_cv_search_tgetent" = no; then
AC_MSG_ERROR([no termcap library found])
fi
-# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
-# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
-# Makefile fragments. That's why we need to have `Hcurses' before
-# `curses'. I don't see why we should use HP curses if a more
-# standard curses is available, except that according to HP's
-# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
-# HP-UX 10.10 and 10.20.
-
-# FIXME: ncurses does not work on native alphaev68-dec-osf5.1,
-# and probably other platforms. AC_SEARCH_LIBS finds the library
-# in a place such as /usr/local/lib/libncurses.a, but does not
-# do anything to look for the matching include files.
-# -- chastain 2004-05-01
-
-AC_SEARCH_LIBS(initscr, [ncurses Hcurses cursesX curses pdcurses], [],
- [AC_MSG_WARN([no curses library found])])
-
-# Check whether the wborder function is provided by the curses
-# library detected above. In certain implementations such as
-# the HP/UX Hcurses for instance, this function is provided by an
-# additional library. So if we did not find this function inside
-# the curses library, try some alternate libraries we know might
-# provide it.
-AC_SEARCH_LIBS(wborder, [cur_colr], [],
- [AC_MSG_WARN([wborder function not found, tui will be disabled])])
-
# ------------------------- #
# Checks for header files. #
# ------------------------- #
Index: config/pa/hpux1020.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux1020.mh,v
retrieving revision 1.6
diff -u -p -r1.6 hpux1020.mh
--- config/pa/hpux1020.mh 5 Aug 2004 19:25:49 -0000 1.6
+++ config/pa/hpux1020.mh 18 Sep 2004 18:40:04 -0000
@@ -4,7 +4,7 @@
# stop GDB hanging on HP/UX. For some reason vfork() hangs yet fork()
# doesn't ....
-MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
+MH_CFLAGS = -Dvfork=fork
NAT_FILE= nm-hppah.h
NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infptrace.o somread.o hpread.o somsolib.o
Index: config/pa/hpux11.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux11.mh,v
retrieving revision 1.6
diff -u -p -r1.6 hpux11.mh
--- config/pa/hpux11.mh 5 Aug 2004 19:25:49 -0000 1.6
+++ config/pa/hpux11.mh 18 Sep 2004 18:40:04 -0000
@@ -4,7 +4,7 @@
# stop GDB hanging on HP/UX. For some reason vfork() hangs yet fork()
# doesn't ....
-MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
+MH_CFLAGS = -Dvfork=fork
NAT_FILE= nm-hppah11.h
NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o somread.o hpread.o somsolib.o
Index: config/pa/hpux11w.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/hpux11w.mh,v
retrieving revision 1.7
diff -u -p -r1.7 hpux11w.mh
--- config/pa/hpux11w.mh 5 Aug 2004 19:25:49 -0000 1.7
+++ config/pa/hpux11w.mh 18 Sep 2004 18:40:04 -0000
@@ -4,7 +4,7 @@
# stop GDB hanging on HP/UX. For some reason vfork() hangs yet fork()
# doesn't ....
-MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
+MH_CFLAGS = -Dvfork=fork
NAT_FILE= nm-hppah11.h
NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o infttrace.o hpread.o pa64solib.o solib.o