]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
m4: Check for rl_completion_quote_character
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 14 Jan 2018 13:29:32 +0000 (14:29 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Jan 2018 16:59:26 +0000 (17:59 +0100)
Apparently we can't assume that people run readline recent enough
to have rl_completion_quote_character (added in readline-5.0
released in 2011). However, we can't compile without it. So if
not present, disable readline.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
m4/virt-readline.m4

index 9fba5148af7c3cfe140406357491f3a6befcb1ab..34b3ff3c4aa67a74119393714bc0437a18535e87 100644 (file)
@@ -38,6 +38,19 @@ AC_DEFUN([LIBVIRT_CHECK_READLINE],[
     LIBS="$lv_saved_libs $extra_LIBS"
   fi
 
+  AC_CHECK_DECLS([rl_completion_quote_character],
+                 [], [],
+                 [[#include <stdio.h>
+                  #include <readline/readline.h>]])
+
+  if test "$ac_cv_have_decl_rl_completion_quote_character" = "no" ; then
+    if test "$with_readline" = "yes" ; then
+      AC_MSG_ERROR([readline is missing rl_completion_quote_character])
+    else
+      with_readline=no;
+    fi
+  fi
+
   # The normal library check...
   LIBVIRT_CHECK_LIB([READLINE], [readline], [readline], [readline/readline.h])