Older versions of readline do not appear to have the variable rl_outstream. This variable,
almost certainly points to the same stream as stdout, so this change detects its absence
and uses stdout in those cases.
AC_DEFINE(HAVE_READLINE, 1, [Define if you have the readline library.])
AC_MSG_CHECKING([how to link with libreadline])
AC_MSG_RESULT([$LIBREADLINE])
+ AC_SEARCH_LIBS([rl_outstream], [readline],
+ AC_DEFINE(HAVE_RL_OUTSTREAM, 1, [Define if the readline library provides rl_outstream.])
+ )
else
dnl If $LIBREADLINE didn't lead to a usable library, we don't
dnl need $INCREADLINE either.
return UP_CAST (r, struct terminal_reader, reader);
}
+/*
+ Older libreadline versions do not provide rl_outstream.
+ However, it is almost always going to be the same as stdout.
+ */
+#if HAVE_RL_OUTSTREAM
+# define rl_outstream stdout
+#endif
+
static size_t
terminal_reader_read (struct lex_reader *r_, char *buf, size_t n,
enum prompt_style prompt_style)