[COMMIT] Really disable TUI if curses is missing

Mark Kettenis kettenis@gnu.org
Sun Oct 10 15:56:00 GMT 2004


The check for curses functionality was places after the code that
enabled the TUI.  Obviously this means that building on systems
without enhanced curses functionality was broken.  This patch fixes
things; it'll only warn about missing curses functionality if this
causes us to disable the TUI.

Tested on i386-unknown-netbsd1.4.3.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* configure.in: Really disable the TUI if an enhanced curses
	library isn't found.
	* configure: Regenerate.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.175
diff -u -p -r1.175 configure.in
--- configure.in 28 Sep 2004 20:17:32 -0000 1.175
+++ configure.in 10 Oct 2004 15:50:04 -0000
@@ -193,21 +193,6 @@ AC_ARG_ENABLE(tui,
     *)
       AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
   esac],enable_tui=yes)
-if test x"$enable_tui" = xyes; then
-  if test -d $srcdir/tui; then
-    if test "$ac_cv_search_waddstr" != no; 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} all-tui"
-      CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
-      CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
-      CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
-    fi
-  fi
-fi
 
 # Enable gdbtk.
 AC_ARG_ENABLE(gdbtk,
@@ -343,10 +328,6 @@ AC_SEARCH_LIBS(socketpair, socket)
 # a situation.
 AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
 
-if test "$ac_cv_search_waddstr" = 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.
@@ -1364,7 +1345,26 @@ AC_SUBST(GDBTK_SRC_DIR)
 
 AC_PATH_X
 
- 
+# Check whether we should enable the TUI, but only do so if we really
+# can.
+if test x"$enable_tui" = xyes; then
+  if test -d $srcdir/tui; then
+    if test "$ac_cv_search_waddstr" != no; 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} all-tui"
+      CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
+      CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
+      CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
+    else
+      AC_MSG_WARN([no enhanced curses library found; disabling TUI])
+    fi
+  fi
+fi
+
 # Unlike the sim directory, whether a simulator is linked is controlled by 
 # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.  
 # This code just checks for a few cases where we'd like to ignore those



More information about the Gdb-patches mailing list