pcre2test: avoid using readline headers with libedit

When asked to enable libedit in a system that ALSO has readline,
the headers of the former would be found and used by the earlier.

While that would mostly work, some functions will be missing
definitions (which is forbidden in C99), so instead abort the
configuration and let the user provide for them.
This commit is contained in:
Carlo Marcelo Arenas Belón 2022-04-07 17:31:01 -07:00
parent 28c42594c3
commit 15db5d3631
2 changed files with 2 additions and 3 deletions

View File

@ -6,7 +6,6 @@ else(EDITLINE_INCLUDE_DIR AND EDITLINE_LIBRARY AND NCURSES_LIBRARY)
FIND_PATH(EDITLINE_INCLUDE_DIR readline.h PATH_SUFFIXES
editline
edit/readline
readline
)
FIND_LIBRARY(EDITLINE_LIBRARY NAMES edit)

View File

@ -601,7 +601,7 @@ fi
# headers in different places. Try to cover the most common ones.
if test "$enable_pcre2test_libedit" = "yes"; then
AC_CHECK_HEADERS([editline/readline.h edit/readline/readline.h readline/readline.h], [
AC_CHECK_HEADERS([editline/readline.h edit/readline/readline.h], [
HAVE_LIBEDIT_HEADER=1
break
])
@ -942,7 +942,7 @@ if test "$enable_pcre2test_libedit" = "yes"; then
fi
if test -z "$HAVE_LIBEDIT_HEADER"; then
echo "** Cannot --enable-pcre2test-libedit because neither editline/readline.h"
echo "** nor readline/readline.h was found."
echo "** nor edit/readline/readline.h was found."
exit 1
fi
if test -z "$LIBEDIT"; then