aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/configure.in')
-rw-r--r--gdb/configure.in117
1 files changed, 66 insertions, 51 deletions
diff --git a/gdb/configure.in b/gdb/configure.in
index 2bddde3..3f5fe37 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -105,6 +105,30 @@ fi
AC_ARG_PROGRAM
+# Enable TUI.
+AC_ARG_ENABLE(tui,
+[ --enable-tui enable full-screen terminal user interface (TUI)],
+ [case $enableval in
+ yes | no)
+ ;;
+ *)
+ AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
+ esac])
+if test x"$enable_tui" = xyes; then
+ if test -d $srcdir/tui; then
+ CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
+ CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
+ CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
+ CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
+ ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
+ CONFIG_ALL="$CONFIG_ALL \$(SUBDIR_TUI_ALL)"
+ CONFIG_CLEAN="$CONFIG_CLEAN \$(SUBDIR_TUI_CLEAN)"
+ CONFIG_INSTALL="$CONFIG_INSTALL \$(SUBDIR_TUI_INSTALL)"
+ CONFIG_UNINSTALL="$CONFIG_UNINSTALL \$(SUBDIR_TUI_UNINSTALL)"
+ need_curses=yes
+ fi
+fi
+
# --------------------- #
# Checks for programs. #
# --------------------- #
@@ -139,6 +163,48 @@ AC_CHECK_FUNC(wctype, [],
# 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
+# --enable-tui, we need full curses functionality.
+#
+# 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.
+
+if test "$need_curses" = yes; then
+ AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],
+ [AC_MSG_ERROR([no curses library found])])
+fi
+
+case $host_os in
+ cygwin*)
+ if test -d $srcdir/libtermcap; then
+ LIBS="../libtermcap/libtermcap.a $LIBS"
+ ac_cv_search_tgetent="../libtermcap/libtermcap.a"
+ fi ;;
+ go32*)
+ # ??? Is this really true?
+ 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])
+
+if test "$ac_cv_search_tgetent" = no; then
+ AC_MSG_ERROR([no termcap library found])
+fi
+
# ------------------------- #
# Checks for header files. #
# ------------------------- #
@@ -802,33 +868,6 @@ if test $want_uiout = true; then
UIOUT_CFLAGS="-DUI_OUT=1"
fi
-AC_ARG_ENABLE(tui,
-[ --enable-tui Enable full-screen terminal user interface],
-[
- case "${enable_tui}" in
- yes | no) ;;
- "") enable_tui=yes ;;
- *)
- AC_MSG_ERROR(Bad value for --enable-tui: ${enableval})
- ;;
- esac
-])
-case ${enable_tui} in
- "yes" )
- if test -d "${srcdir}/tui" ; then
- CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_TUI_OBS)"
- CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_TUI_DEPS)"
- CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_TUI_SRCS)"
- CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_TUI_INITS)"
- ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_TUI_CFLAGS)"
- CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_TUI_ALL)"
- CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_TUI_CLEAN)"
- CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_TUI_INSTALL)"
- CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_TUI_UNINSTALL)"
- fi
- ;;
-esac
-
AC_ARG_ENABLE(netrom,
[ --enable-netrom Enable NetROM support],
[case "${enableval}" in
@@ -973,30 +1012,6 @@ case ${host} in
esac
AC_SUBST(SER_HARDWIRE)
-
-dnl Figure out which term library to use.
-if test x$gdb_host = xgo32; then
- TERM_LIB=
-else
-if test x$gdb_cv_os_cygwin = xyes; then
- TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
-else
- TERM_LIB=
- AC_CHECK_LIB(ncurses, tgetent, TERM_LIB=-lncurses,
- AC_CHECK_LIB(Hcurses, tgetent, TERM_LIB=-lHcurses,
- AC_CHECK_LIB(termlib, tgetent, TERM_LIB=-ltermlib,
- AC_CHECK_LIB(termcap, tgetent, TERM_LIB=-ltermcap,
- AC_CHECK_LIB(curses, tgetent, TERM_LIB=-lcurses,
- AC_CHECK_LIB(terminfo, tgetent, TERM_LIB=-lterminfo))))))
-
- if test "x$TERM_LIB" = x
- then
- AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
- fi
-fi
-fi
-AC_SUBST(TERM_LIB)
-
# libreadline needs libuser32.a in a cygwin environment
WIN32LIBS=
if test x$gdb_cv_os_cygwin = xyes; then