$as_echo "#define USE_READLINE 1" >>confdefs.h
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_getc in -lreadline" >&5
+$as_echo_n "checking for el_getc in -lreadline... " >&6; }
+if ${ac_cv_lib_readline_el_getc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lreadline $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char el_getc ();
+int
+main ()
+{
+return el_getc ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_readline_el_getc=yes
+else
+ ac_cv_lib_readline_el_getc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_el_getc" >&5
+$as_echo "$ac_cv_lib_readline_el_getc" >&6; }
+if test "x$ac_cv_lib_readline_el_getc" = xyes; then :
+
+$as_echo "#define READLINE_IS_EDITLINE 1" >>confdefs.h
+
+fi
+
# These tests discover differences between readline 4.1 and 4.3
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5
$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; }
if test "$enable_readline" != "no" ; then
AC_CHECK_HEADERS([readline/readline.h],
AC_CHECK_LIB([readline],[rl_initialize],
- [AC_DEFINE(USE_READLINE,1,[use readline library])
+ [AC_DEFINE(USE_READLINE,1,[use readline library])
+ AC_CHECK_LIB([readline],[el_getc],AC_DEFINE(READLINE_IS_EDITLINE,1,[readline is editline]))
# These tests discover differences between readline 4.1 and 4.3
AC_CHECK_LIB([readline],[rl_completion_matches],
[AC_DEFINE(HAVE_DECL_RL_COMPLETION_MATCHES,1,[have readline completion matches])
/* system pagewidth */
#undef PAGEWIDTH
+/* readline is editline */
+#undef READLINE_IS_EDITLINE
+
/* asm string to set the stack pointer */
#undef SET_STACK_POINTER
IapplyVector(sSuniversal_error_handler,n,b);
+ while (1);
+
}
/*
#endif
#ifdef USE_READLINE
+#ifdef READLINE_IS_EDITLINE
+ ADD_FEATURE("EDITLINE");
+#else
ADD_FEATURE("READLINE");
#endif
+#endif
#if !defined(USE_DLOPEN)
ADD_FEATURE("NATIVE-RELOC");
#if defined(HAVE_LIBBFD)
extern FILE *stdout __attribute__((weak));
#ifdef USE_READLINE
-#if RL_READLINE_VERSION < 0x0600
+#ifdef READLINE_IS_EDITLINE
+#define MY_RL_VERSION 0x0600
+#else
+#define MY_RL_VERSION RL_READLINE_VERSION
+#endif
+#if MY_RL_VERSION < 0x0600
extern Function *rl_completion_entry_function __attribute__((weak));
extern char *rl_readline_name __attribute__((weak));
#else