diff --git a/configure.ac b/configure.ac index caa4093..b123292 100644 --- a/configure.ac +++ b/configure.ac @@ -597,14 +597,14 @@ if test "$enable_pcre2test_libreadline" = "yes"; then fi fi - # Check for the availability of libedit. Different distributions put its # headers in different places. Try to cover the most common ones. if test "$enable_pcre2test_libedit" = "yes"; then - AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1], - [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1], - [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])]) + AC_CHECK_HEADERS([editline/readline.h edit/readline/readline.h readline/readline.h], [ + HAVE_LIBEDIT_HEADER=1 + break + ]) AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"]) fi @@ -940,8 +940,7 @@ if test "$enable_pcre2test_libedit" = "yes"; then echo "** Cannot use both --enable-pcre2test-libedit and --enable-pcre2test-readline" exit 1 fi - if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \ - "$HAVE_READLINE_READLINE_H" != "1"; then + if test -z "$HAVE_LIBEDIT_HEADER"; then echo "** Cannot --enable-pcre2test-libedit because neither editline/readline.h" echo "** nor readline/readline.h was found." exit 1 diff --git a/src/pcre2test.c b/src/pcre2test.c index 8e712c3..43cacdf 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -94,6 +94,8 @@ that first, falling back to readline/readline.h. */ #else #if defined(HAVE_EDITLINE_READLINE_H) #include +#elif defined(HAVE_EDIT_READLINE_READLINE_H) +#include #else #include #endif