From 1c51b111efb6eb5c56eddf9d418ebb0f78f48d48 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Wed, 7 Feb 2024 20:27:20 +0100 Subject: [PATCH] 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, not an 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=yes for use inside configure.ac. --- src/configure.ac | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/configure.ac b/src/configure.ac index 205ea099f..c6e91c15e 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -116,7 +116,12 @@ 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]) @@ -674,7 +679,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"