Skip to content

Commit

Permalink
pcre2test: avoid using readline headers with libedit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
carenas committed Apr 8, 2022
1 parent 28c4259 commit 15db5d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion cmake/FindEditline.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 15db5d3

Please sign in to comment.