aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/config.in3
-rwxr-xr-xgdb/configure33
-rw-r--r--gdb/configure.ac15
4 files changed, 59 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1c6c400..2c616a3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ 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 <brobecker@adacore.com>
* MAINTAINERS: Move Don Lee to the correct section (Write After
diff --git a/gdb/config.in b/gdb/config.in
index 4716524..74522ae 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -792,6 +792,9 @@
/* Define to `int' if <sys/types.h> 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 99acc2f..40fb803 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 b31d9b7..f9c17fd 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)'