Skip to content

Commit

Permalink
Fix libreadline summary output
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ndim committed Feb 7, 2024
1 parent bff4899 commit 1c51b11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 1c51b11

Please sign in to comment.