m4: Check for rl_completion_quote_character

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>
This commit is contained in:
Michal Privoznik 2018-01-14 14:29:32 +01:00
parent 0d6d5de53e
commit 74416b1d48

View 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])