gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 2 Oct 2009 16:02:34 +0000 (16:02 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 2 Oct 2009 16:02:34 +0000 (16:02 +0000)
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.

gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.ac

index 1c6c400..2c616a3 100644 (file)
@@ -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
index 4716524..74522ae 100644 (file)
 /* 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.  */
index 99acc2f..40fb803 100755 (executable)
@@ -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)'
index b31d9b7..f9c17fd 100644 (file)
@@ -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)'