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!
(This used to be commit ba901e6820c02bc696c0bd3e9e0788801fd0795b)

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

index e748edd347652d8be230e9b85fe5c9b92ae62287..e9fe32967b06d7c445a57f9582062d74b4de54e2 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 4eebd13b5a66057b6bcc16140fe2b7fb197256cc..29f7ac6e1a8594b91f39033526135d9dc70b5f69 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