AC_CHECK_LIB(readline, readline,
LIBS="-lreadline -lcurses $LIBS"
AC_DEFINE(HAVE_LIBREADLINE)
- AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
- , , -lcurses))
+ AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]),
+ AC_CHECK_LIB(edit, readline,
+ LIBS="-ledit -lcurses"
+ AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?])
+ AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?])
+ , , -lcurses)
+ , -lcurses))
READLINE_LIBS=$LIBS
AC_SUBST(READLINE_LIBS)
LIBS=$save_LIBS
# define closesocket close
#endif /* SYS_WINNT */
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) || defined (HAVE_LIBEDIT)
# include <readline/readline.h>
# include <readline/history.h>
-#endif /* HAVE_LIBREADLINE */
+#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
#ifdef SYS_VXWORKS
/* vxWorks needs mode flag -casey*/
static void
getcmds(void)
{
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
char *line;
for (;;) {
docmd(line);
free(line);
}
-#else /* not HAVE_LIBREADLINE */
+#else /* not (HAVE_LIBREADLINE || HAVE_LIBEDIT) */
char line[MAXLINE];
for (;;) {
docmd(line);
}
-#endif /* not HAVE_LIBREADLINE */
+#endif /* not HAVE_LIBREADLINE || HAVE_LIBEDIT */
}
#define closesocket close
#endif /* SYS_WINNT */
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
# include <readline/readline.h>
# include <readline/history.h>
-#endif /* HAVE_LIBREADLINE */
+#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
#ifdef SYS_VXWORKS
/* vxWorks needs mode flag -casey*/
static void
getcmds(void)
{
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
char *line;
for (;;) {
docmd(line);
free(line);
}
-#else /* not HAVE_LIBREADLINE */
+#else /* not (HAVE_LIBREADLINE || HAVE_LIBEDIT) */
char line[MAXLINE];
for (;;) {
docmd(line);
}
-#endif /* not HAVE_LIBREADLINE */
+#endif /* not (HAVE_LIBREADLINE || HAVE_LIBEDIT) */
}
#ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */