Don't use libhistory if libreadline includes the history functions.

This commit is contained in:
Martin Whitaker 2020-08-06 23:40:31 +01:00
parent a5b3c0483a
commit 3a70a84e68
1 changed files with 6 additions and 0 deletions

View File

@ -139,7 +139,13 @@ AC_CHECK_SIZEOF(unsigned)
# vvp uses these... # vvp uses these...
AC_CHECK_LIB(termcap, tputs) AC_CHECK_LIB(termcap, tputs)
AC_CHECK_LIB(readline, readline) AC_CHECK_LIB(readline, readline)
AC_CHECK_LIB(readline, add_history, NEED_LIBHISTORY=no, NEED_LIBHISTORY=yes)
if test "$NEED_LIBHISTORY" = "yes"; then
AC_CHECK_LIB(history, add_history) AC_CHECK_LIB(history, add_history)
else
# libreadline includes libhistory functions
AC_DEFINE(HAVE_LIBHISTORY, 1)
fi
AC_CHECK_HEADERS(readline/readline.h readline/history.h sys/resource.h) AC_CHECK_HEADERS(readline/readline.h readline/history.h sys/resource.h)
case "${host}" in *linux*) AC_DEFINE([LINUX], [1], [Host operating system is Linux.]) ;; esac case "${host}" in *linux*) AC_DEFINE([LINUX], [1], [Host operating system is Linux.]) ;; esac