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 1c6c4004bc1652319ecb3aa52c69ec5becd936aa..2c616a31cb5e7879bf1f7cbffa8ff35a6b65d5ef 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 4716524e08bf62579ea43b75c00e287a50c3d665..74522ae57b18dd14f6baf7c51c43e72e313ab6a2 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 99acc2f9cd60b324e5ff65980c5dbeff92cb005d..40fb80319a5cd080751b56113b8f58e524062af2 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 b31d9b70de79c01bb83ac4b7aabaca040a9bde63..f9c17fdc233408a101f0e5ba85c0673fb5fdc63e 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)'