r18208: Mac OS X also doesn't have history_list()
authorAndrew Tridgell <tridge@samba.org>
Thu, 7 Sep 2006 08:34:12 +0000 (08:34 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:17:49 +0000 (14:17 -0500)
must be a pretty old readline lib!

source/client/client.c
source/lib/smbreadline/readline.m4

index e748edd..e9fe329 100644 (file)
@@ -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;
 
index 4eebd13..29f7ac6 100644 (file)
@@ -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