aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog9
-rwxr-xr-xgdb/configure165
-rw-r--r--gdb/configure.ac95
3 files changed, 167 insertions, 102 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 62d8bb9..3809a42 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/configure b/gdb/configure
index 7f4d2a6..c8fe9da 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -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
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 677a6ae..054d5c2 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -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