From: Jan Kratochvil Date: Fri, 2 Oct 2009 16:02:34 +0000 (+0000) Subject: gdb/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a71e0887e3568d4e38601402d00f40493e696601;p=binutils-gdb.git gdb/ Fix compatibility of --with-system-readline and readline-6.0+. * configure.ac <--with-system-readline> (for readline_echoing_p): New test. * config.in: Regenerate. * configure: Regenerate. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1c6c4004bc1..2c616a31cb5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2009-10-02 Jan Kratochvil + + Fix compatibility of --with-system-readline and readline-6.0+. + * configure.ac <--with-system-readline> (for readline_echoing_p): New + test. + * config.in: Regenerate. + * configure: Regenerate. + 2009-10-01 Joel Brobecker * MAINTAINERS: Move Don Lee to the correct section (Write After diff --git a/gdb/config.in b/gdb/config.in index 4716524e08b..74522ae57b1 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -792,6 +792,9 @@ /* Define to `int' if does not define. */ #undef pid_t +/* readline-6.0 started to use different name. */ +#undef readline_echoing_p + /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ diff --git a/gdb/configure b/gdb/configure index 99acc2f9cd6..40fb80319a5 100755 --- a/gdb/configure +++ b/gdb/configure @@ -8431,6 +8431,39 @@ if test "$with_system_readline" = yes; then READLINE=-lreadline READLINE_DEPS= READLINE_CFLAGS= + + # readline-6.0 started to use the name `_rl_echoing_p'. + # `$(READLINE_DIR)/' of bundled readline would not resolve in configure. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline_echoing_p" >&5 +$as_echo_n "checking for readline_echoing_p... " >&6; } + save_LIBS=$LIBS + LIBS="$LIBS $READLINE" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +extern int readline_echoing_p; + return readline_echoing_p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + READLINE_ECHOING_P=yes +else + READLINE_ECHOING_P=no + +$as_echo "#define readline_echoing_p _rl_echoing_p" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_ECHOING_P" >&5 +$as_echo "$READLINE_ECHOING_P" >&6; } else READLINE='$(READLINE_DIR)/libreadline.a' READLINE_DEPS='$(READLINE)' diff --git a/gdb/configure.ac b/gdb/configure.ac index b31d9b70de7..f9c17fdc233 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -534,6 +534,21 @@ if test "$with_system_readline" = yes; then READLINE=-lreadline READLINE_DEPS= READLINE_CFLAGS= + + # readline-6.0 started to use the name `_rl_echoing_p'. + # `$(READLINE_DIR)/' of bundled readline would not resolve in configure. + + AC_MSG_CHECKING([for readline_echoing_p]) + save_LIBS=$LIBS + LIBS="$LIBS $READLINE" + AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int readline_echoing_p; + return readline_echoing_p;]]), + [READLINE_ECHOING_P=yes], + [READLINE_ECHOING_P=no + AC_DEFINE([readline_echoing_p], [_rl_echoing_p], + [readline-6.0 started to use different name.])]) + LIBS="$save_LIBS" + AC_MSG_RESULT([$READLINE_ECHOING_P]) else READLINE='$(READLINE_DIR)/libreadline.a' READLINE_DEPS='$(READLINE)'