summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/client/client.c2
-rw-r--r--source4/lib/smbreadline/readline.m46
2 files changed, 6 insertions, 2 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index e748edd347..e9fe32967b 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -2388,7 +2388,7 @@ history
****************************************************************************/
static int cmd_history(struct smbclient_context *ctx, const char **args)
{
-#if defined(HAVE_LIBREADLINE)
+#if defined(HAVE_LIBREADLINE) && defined(HAVE_DECL_RL_EVENT_HOOK)
HIST_ENTRY **hlist;
int i;
diff --git a/source4/lib/smbreadline/readline.m4 b/source4/lib/smbreadline/readline.m4
index 4eebd13b5a..29f7ac6e1a 100644
--- a/source4/lib/smbreadline/readline.m4
+++ b/source4/lib/smbreadline/readline.m4
@@ -68,8 +68,12 @@ AC_CHECK_LIB(readline, rl_completion_matches,
[],
[$TERMLIBS])
-# not all readline libs have rl_event_hook
+# not all readline libs have rl_event_hook or history_list
AC_CHECK_DECLS(rl_event_hook, [], [], [#include <readline/readline.h>])
+AC_CHECK_LIB(readline, history_list,
+ [AC_DEFINE(HAVE_HISTORY_LIST, 1, [Do we have history_list?])],
+ [],
+ [$TERMLIBS])
AC_MSG_CHECKING(whether to use extern readline)
if test x"$EXTERNAL_READLINE" = x"yes"; then