From 0c5adc6938447cdec62c599fe58fe48b27e1a986 Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Thu, 1 Jul 2021 16:00:33 +0200 Subject: [PATCH] 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. --- m4/ax_lib_readline.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m4/ax_lib_readline.m4 b/m4/ax_lib_readline.m4 index d8090da2ac..1fcf504141 100644 --- a/m4/ax_lib_readline.m4 +++ b/m4/ax_lib_readline.m4 @@ -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