* configure.ac: On alpha-osf, error out if enable_tui is set to
authorJoel Brobecker <brobecker@gnat.com>
Wed, 22 Oct 2008 20:22:01 +0000 (20:22 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 22 Oct 2008 20:22:01 +0000 (20:22 +0000)
          "yes", and set enable_tui to "no" if previously set to "auto".
          Check for waddstr only if TUI support was requested. Move the
          part of the configure script that updates various Makefile
          variables up, together with the check for waddstr.
          * configure: Regenerate.

gdb/ChangeLog
gdb/configure
gdb/configure.ac

index 62d8bb907d04fd0619cd08b3edba798d80c811d7..3809a42f6e052d260189a5eb6f7d565525f2dd88 100644 (file)
@@ -1,3 +1,12 @@
+2008-10-02  Joel Brobecker  <brobecker@adacore.com>
+
+       * configure.ac: On alpha-osf, error out if enable_tui is set to
+       "yes", and set enable_tui to "no" if previously set to "auto".
+       Check for waddstr only if TUI support was requested. Move the
+       part of the configure script that updates various Makefile
+       variables up, together with the check for waddstr.
+       * configure: Regenerate.
+
 2008-10-22  Joel brobecker  <brobecker@adacore.com>
 
        * gdbtypes.c (copy_type): New function.
index 7f4d2a6d1ec17279b5bef06045d2ef2c9579efa7..c8fe9dae4a42578c0e1f955f5e2ab50f70bd98c9 100755 (executable)
@@ -10134,22 +10134,14 @@ done
 fi
 
 
-# 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.
-echo "$as_me:$LINENO: checking for library containing waddstr" >&5
-echo $ECHO_N "checking for library containing waddstr... $ECHO_C" >&6
-if test "${ac_cv_search_waddstr+set}" = set; then
+# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
+echo "$as_me:$LINENO: checking for library containing dlgetmodinfo" >&5
+echo $ECHO_N "checking for library containing dlgetmodinfo... $ECHO_C" >&6
+if test "${ac_cv_search_dlgetmodinfo+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_waddstr=no
+ac_cv_search_dlgetmodinfo=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10163,11 +10155,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char waddstr ();
+char dlgetmodinfo ();
 int
 main ()
 {
-waddstr ();
+dlgetmodinfo ();
   ;
   return 0;
 }
@@ -10194,7 +10186,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_waddstr="none required"
+  ac_cv_search_dlgetmodinfo="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -10202,8 +10194,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_waddstr" = no; then
-  for ac_lib in ncurses cursesX curses; do
+if test "$ac_cv_search_dlgetmodinfo" = no; then
+  for ac_lib in dl xpdl; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -10218,11 +10210,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char waddstr ();
+char dlgetmodinfo ();
 int
 main ()
 {
-waddstr ();
+dlgetmodinfo ();
   ;
   return 0;
 }
@@ -10249,7 +10241,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_waddstr="-l$ac_lib"
+  ac_cv_search_dlgetmodinfo="-l$ac_lib"
 break
 else
   echo "$as_me: failed program was:" >&5
@@ -10262,22 +10254,63 @@ rm -f conftest.err conftest.$ac_objext \
 fi
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_waddstr" >&5
-echo "${ECHO_T}$ac_cv_search_waddstr" >&6
-if test "$ac_cv_search_waddstr" != no; then
-  test "$ac_cv_search_waddstr" = "none required" || LIBS="$ac_cv_search_waddstr $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_dlgetmodinfo" >&5
+echo "${ECHO_T}$ac_cv_search_dlgetmodinfo" >&6
+if test "$ac_cv_search_dlgetmodinfo" != no; then
+  test "$ac_cv_search_dlgetmodinfo" = "none required" || LIBS="$ac_cv_search_dlgetmodinfo $LIBS"
 
 fi
 
 
-# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
-echo "$as_me:$LINENO: checking for library containing dlgetmodinfo" >&5
-echo $ECHO_N "checking for library containing dlgetmodinfo... $ECHO_C" >&6
-if test "${ac_cv_search_dlgetmodinfo+set}" = set; then
+# On alpha-osf, it appears that libtermcap and libcurses are not compatible.
+# There is a very specific comment in /usr/include/curses.h explaining that
+# termcap routines built into libcurses must not be used.
+#
+# The symptoms we observed so far is GDB unexpectedly changing
+# the terminal settings when tgetent is called - this is particularly
+# visible as the output is missing carriage returns, and so rapidly
+# becomes very hard to read.
+#
+# The readline configure script has already decided that libtermcap
+# was enough for its purposes, and so decided to build readline using
+# libtermcap.  Since the TUI mode requires curses, building GDB with
+# TUI enabled results in both libraries to be used at the same time,
+# which is not allowed.  This basically means that GDB with TUI is
+# broken on alpha-osf.
+
+case $host_os in
+  alpha*-*-osf* )
+    if "$enable_tui" = "yes"; then
+      { { echo "$as_me:$LINENO: error: Building GDB with TUI mode is not supported on this host" >&5
+echo "$as_me: error: Building GDB with TUI mode is not supported on this host" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    if "$enable_tui" = "auto"; then
+      enable_tui=no
+    fi
+    ;;
+esac
+
+# Check whether we should enable the TUI, but only do so if we really
+# can.
+if test x"$enable_tui" != xno; then
+  if test -d $srcdir/tui; then
+    # 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.
+    echo "$as_me:$LINENO: checking for library containing waddstr" >&5
+echo $ECHO_N "checking for library containing waddstr... $ECHO_C" >&6
+if test "${ac_cv_search_waddstr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_dlgetmodinfo=no
+ac_cv_search_waddstr=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10291,11 +10324,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char dlgetmodinfo ();
+char waddstr ();
 int
 main ()
 {
-dlgetmodinfo ();
+waddstr ();
   ;
   return 0;
 }
@@ -10322,7 +10355,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_dlgetmodinfo="none required"
+  ac_cv_search_waddstr="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -10330,8 +10363,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_dlgetmodinfo" = no; then
-  for ac_lib in dl xpdl; do
+if test "$ac_cv_search_waddstr" = no; then
+  for ac_lib in ncurses cursesX curses; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -10346,11 +10379,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char dlgetmodinfo ();
+char waddstr ();
 int
 main ()
 {
-dlgetmodinfo ();
+waddstr ();
   ;
   return 0;
 }
@@ -10377,7 +10410,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_dlgetmodinfo="-l$ac_lib"
+  ac_cv_search_waddstr="-l$ac_lib"
 break
 else
   echo "$as_me: failed program was:" >&5
@@ -10390,14 +10423,36 @@ rm -f conftest.err conftest.$ac_objext \
 fi
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_dlgetmodinfo" >&5
-echo "${ECHO_T}$ac_cv_search_dlgetmodinfo" >&6
-if test "$ac_cv_search_dlgetmodinfo" != no; then
-  test "$ac_cv_search_dlgetmodinfo" = "none required" || LIBS="$ac_cv_search_dlgetmodinfo $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_waddstr" >&5
+echo "${ECHO_T}$ac_cv_search_waddstr" >&6
+if test "$ac_cv_search_waddstr" != no; then
+  test "$ac_cv_search_waddstr" = "none required" || LIBS="$ac_cv_search_waddstr $LIBS"
 
 fi
 
 
+    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)"
+      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
+      if test x"$enable_tui" = xyes; then
+       { { echo "$as_me:$LINENO: error: no enhanced curses library found; disable TUI" >&5
+echo "$as_me: error: no enhanced curses library found; disable TUI" >&2;}
+   { (exit 1); exit 1; }; }
+      else
+       { echo "$as_me:$LINENO: WARNING: no enhanced curses library found; disabling TUI" >&5
+echo "$as_me: WARNING: no enhanced curses library found; disabling TUI" >&2;}
+      fi
+    fi
+  fi
+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.
@@ -25539,32 +25594,6 @@ echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
 fi
 
 
-# Check whether we should enable the TUI, but only do so if we really
-# can.
-if test x"$enable_tui" != xno; 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)"
-      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
-      if test x"$enable_tui" = xyes; then
-       { { echo "$as_me:$LINENO: error: no enhanced curses library found; disable TUI" >&5
-echo "$as_me: error: no enhanced curses library found; disable TUI" >&2;}
-   { (exit 1); exit 1; }; }
-      else
-       { echo "$as_me:$LINENO: WARNING: no enhanced curses library found; disabling TUI" >&5
-echo "$as_me: WARNING: no enhanced curses library found; disabling TUI" >&2;}
-      fi
-    fi
-  fi
-fi
-
 # Unlike the sim directory, whether a simulator is linked is controlled by
 # presence of a gdb_sim definition in the target configure.tgt entry.
 # This code just checks for a few cases where we'd like to ignore those
index 677a6ae66d4f770ce842fcde225e97f18f22fbe7..054d5c274cb2d395d3026ac8caa268335ce8bf47 100644 (file)
@@ -429,20 +429,70 @@ AC_SEARCH_LIBS(socketpair, socket)
 # Link in zlib if we can.  This allows us to read compressed debug sections.
 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
 
-# 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(waddstr, [ncurses cursesX curses])
-
 # On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
 AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
 
+# On alpha-osf, it appears that libtermcap and libcurses are not compatible.
+# There is a very specific comment in /usr/include/curses.h explaining that
+# termcap routines built into libcurses must not be used.
+# 
+# The symptoms we observed so far is GDB unexpectedly changing
+# the terminal settings when tgetent is called - this is particularly
+# visible as the output is missing carriage returns, and so rapidly
+# becomes very hard to read.
+#
+# The readline configure script has already decided that libtermcap
+# was enough for its purposes, and so decided to build readline using
+# libtermcap.  Since the TUI mode requires curses, building GDB with
+# TUI enabled results in both libraries to be used at the same time,
+# which is not allowed.  This basically means that GDB with TUI is
+# broken on alpha-osf.
+
+case $host_os in
+  alpha*-*-osf* )
+    if "$enable_tui" = "yes"; then
+      AC_MSG_ERROR([Building GDB with TUI mode is not supported on this host])
+    fi
+    if "$enable_tui" = "auto"; then
+      enable_tui=no
+    fi
+    ;;
+esac
+
+# Check whether we should enable the TUI, but only do so if we really
+# can.
+if test x"$enable_tui" != xno; then
+  if test -d $srcdir/tui; then
+    # 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(waddstr, [ncurses cursesX curses])
+
+    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)"
+      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
+      if test x"$enable_tui" = xyes; then
+       AC_MSG_ERROR([no enhanced curses library found; disable TUI])
+      else
+       AC_MSG_WARN([no enhanced curses library found; disabling TUI])
+      fi
+    fi
+  fi
+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.
@@ -1748,29 +1798,6 @@ 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" != xno; 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)"
-      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
-      if test x"$enable_tui" = xyes; then
-       AC_MSG_ERROR([no enhanced curses library found; disable TUI])
-      else
-       AC_MSG_WARN([no enhanced curses library found; disabling TUI])
-      fi
-    fi
-  fi
-fi
-
 # Unlike the sim directory, whether a simulator is linked is controlled by 
 # presence of a gdb_sim definition in the target configure.tgt entry.  
 # This code just checks for a few cases where we'd like to ignore those
This page took 0.043702 seconds and 4 git commands to generate.