WINDRES = @WINDRES@
MIG = @MIG@
-# Flags that describe where you can find the termcap library.
-# This can be overridden in the host Makefile fragment file.
-TERMCAP = @TERM_LIB@
-
# If you are compiling with GCC, make sure that either 1) You have the
# fixed include files where GCC can reach them, or 2) You use the
# -traditional flag. Otherwise the ioctl calls in inflow.c
# Libraries and corresponding dependencies for compiling gdb.
# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
-# TERMCAP comes after readline, since readline depends on it.
# MMALLOC comes after anything else that might want an allocation function.
# LIBIBERTY appears twice on purpose.
# If you have the Cygnus libraries installed,
# you can use 'CLIBS=$(INSTALLED_LIBS)' 'CDEPS='
INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty \
- $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
+ $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
-lmmalloc -lintl -liberty
CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(INTL) $(LIBIBERTY) \
- $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
+ $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
$(LIBICONV) \
$(MMALLOC) $(LIBIBERTY) $(WIN32LIBS)
CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
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. #
# --------------------- #
# 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. #
# ------------------------- #
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
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