* 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.
This commit is contained in:
Joel Brobecker 2008-10-22 20:22:01 +00:00
parent 4af8819895
commit 77f120bfd7
3 changed files with 261 additions and 196 deletions

View 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.

353
gdb/configure vendored
View file

@ -10134,142 +10134,6 @@ 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
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_waddstr=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
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 ();
int
main ()
{
waddstr ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_waddstr="none required"
else
echo "$as_me: failed program was:" >&5
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
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
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 ();
int
main ()
{
waddstr ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_waddstr="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
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"
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
@ -10398,6 +10262,197 @@ if test "$ac_cv_search_dlgetmodinfo" != no; then
fi
# 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_waddstr=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
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 ();
int
main ()
{
waddstr ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_waddstr="none required"
else
echo "$as_me: failed program was:" >&5
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
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
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 ();
int
main ()
{
waddstr ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_waddstr="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
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"
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

View 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