Fix libreadline summary output

AC_CHECK_LIB([readline], [readline]) without an ACTION-IF-FOUND
results in the definition of the HAVE_LIBREADLINE C preprocessor
macro and the addition of -lreadline to LIBS, not a configure
script environment variable have_readline.

So this repeats what the default ACTION-IF-FOUND does (add
-lreadline to LIBS, AC_DEFINE the HAVE_LIBREADLINE macro),
and in addition defines the have_libreadline variable as
yes for later use inside configure.ac.
This commit is contained in:
Hans Ulrich Niedermann
2024-02-07 20:27:20 +01:00
parent d0a36e03b7
commit bccad9dfe6

View File

@@ -119,7 +119,14 @@ AC_CHECK_LIB([ws2_32], [WSAStartup])
AC_CHECK_LIB([termcap], [tputs])
AC_CHECK_LIB([ncurses], [tputs])
AC_CHECK_LIB([readline], [readline])
AC_CHECK_LIB([readline], [readline], [dnl
LIBS="-lreadline $LIBS"
AC_DEFINE([HAVE_LIBREADLINE], [1],
[Whether we have libreadline with the readline function])
have_libreadline=yes
])
AH_TEMPLATE([HAVE_LIBELF],
[Define if ELF support is enabled via libelf])
AC_CHECK_LIB([elf], [elf_getshdrstrndx], [have_libelf=yes])
@@ -667,7 +674,7 @@ else
echo "DON'T HAVE libhidapi"
fi
if test "x$have_readline" = xyes; then
if test "x$have_libreadline" = xyes; then
echo "DO HAVE libreadline"
else
echo "DON'T HAVE libreadline"