Skip to content

Commit 1c51b11

Browse files
committed
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.
1 parent bff4899 commit 1c51b11

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/configure.ac

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,12 @@ AC_CHECK_LIB([ws2_32], [WSAStartup])
116116

117117
AC_CHECK_LIB([termcap], [tputs])
118118
AC_CHECK_LIB([ncurses], [tputs])
119-
AC_CHECK_LIB([readline], [readline])
119+
AC_CHECK_LIB([readline], [readline], [dnl
120+
LIBS="-lreadline $LIBS"
121+
AC_DEFINE([HAVE_LIBREADLINE], [1],
122+
[Whether we have libreadline with the readline function])
123+
have_libreadline=yes
124+
])
120125
AH_TEMPLATE([HAVE_LIBELF],
121126
[Define if ELF support is enabled via libelf])
122127
AC_CHECK_LIB([elf], [elf_getshdrstrndx], [have_libelf=yes])
@@ -674,7 +679,7 @@ else
674679
echo "DON'T HAVE libhidapi"
675680
fi
676681

677-
if test "x$have_readline" = xyes; then
682+
if test "x$have_libreadline" = xyes; then
678683
echo "DO HAVE libreadline"
679684
else
680685
echo "DON'T HAVE libreadline"

0 commit comments

Comments
 (0)