m4: Check for history_set_history_state instead of add_history

The add_history function is available on both - libreadline and libedit.

The read difference between those two libraries is that for libedit the
history_set_history_state is missing.
On that basis one can assess if we do have history from libreadline or
from libedit.
This commit is contained in:
Lukasz Majewski 2021-07-01 16:00:33 +02:00 committed by Thomas Haller
parent 552e00990d
commit 0c5adc6938
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -99,7 +99,8 @@ AC_DEFUN([AX_LIB_READLINE], [
AC_CACHE_CHECK([whether readline supports history],
ax_cv_lib_readline_history, [
ax_cv_lib_readline_history="no"
AC_LINK_IFELSE([AC_LANG_CALL([], [add_history])], [ax_cv_lib_readline_history="yes"])
AC_LINK_IFELSE([AC_LANG_CALL([], [history_set_history_state])],
[ax_cv_lib_readline_history="yes"])
])
LIBS=$ORIG_LIBS