diff options
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index adf8de9..7fcc48a 100644 --- a/configure.ac +++ b/configure.ac @@ -290,12 +290,21 @@ AC_ARG_WITH(editline, [ --with-editline Simmule Turner's line editing], AC_DEFINE(EDITLINE) LIBS="$LIBS -ledit", AC_MSG_WARN(editline library not found))) -AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], - AC_CHECK_LIB(readline, readline, [ +dnl Getting readline right is hard. There are (at least) two incompatible versions, +dnl and we need to know which one we are using. There are also two different +dnl names for the include files. +AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], [ + AC_CHECK_LIB(readline, rl_deprep_terminal, [ + AC_DEFINE(READLINE) + AC_DEFINE(READLINE_OLD) + ], [ + AC_CHECK_LIB(readline, readline, [ AC_DEFINE(READLINE) - LIBS="$LIBS -lreadline -ltermcap" - AC_CHECK_HEADERS(readline.h readline/readline.h) - ], AC_MSG_WARN(readline library not found), -ltermcap)) + ], AC_MSG_WARN(readline library not found), -ltermcap) + ], -ltermcap) + LIBS="$LIBS -lreadline -ltermcap" + AC_CHECK_HEADERS(readline.h readline/readline.h) +]) AM_CONDITIONAL(AMC_READLINE, test "${with_readline+set}" = set) AC_OUTPUT(Makefile) |