From bccad9dfe6f701dfe6bafc39ee76ad4e3f095352 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 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. --- src/configure.ac | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/configure.ac b/src/configure.ac index 11e51cd7..57b853d6 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -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"