diff --git a/configure.ac b/configure.ac index 8fe7d78..ac601a3 100644 --- a/configure.ac +++ b/configure.ac @@ -666,7 +666,7 @@ AM_CONDITIONAL([SQUATTER], AC_ARG_ENABLE(sieve, [AS_HELP_STRING([--disable-sieve], [disable Sieve support])],,[enable_sieve="yes";]) AC_ARG_ENABLE(pcre, - [AS_HELP_STRING([--disable-pcre], [disable PCRE library])],[cyrus_cv_pcre_utf8="$enableval"]) + [AS_HELP_STRING([--disable-pcre2], [disable PCRE library])],[cyrus_cv_pcre_utf8="$enableval"]) if test "$enable_sieve" != "no"; then AC_DEFINE(USE_SIEVE,[],[Build in Sieve support?]) @@ -692,25 +692,25 @@ fi AM_CONDITIONAL([SIEVE], [test "${enable_sieve}" != "no"]) -if test "$enable_pcre" != "no"; then - AC_CHECK_HEADER(pcreposix.h) - if test "$ac_cv_header_pcreposix_h" = "yes"; then - AC_MSG_CHECKING(for utf8 enabled pcre) - AC_CACHE_VAL(cyrus_cv_pcre_utf8, AC_TRY_CPP([#include -#ifndef REG_UTF8 +if test "$enable_pcre2" != "no"; then + AC_CHECK_HEADER(pcre2posix.h) + if test "$ac_cv_header_pcre2posix_h" = "yes"; then + AC_MSG_CHECKING(for utf8 enabled pcre2) + AC_CACHE_VAL(cyrus_cv_pcre_utf8, AC_TRY_CPP([#include +#ifndef REG_UTF #include -#endif],cyrus_cv_pcre_utf8=yes,cyrus_cv_pcre_utf8=no)) - AC_MSG_RESULT($cyrus_cv_pcre_utf8) +#endif],cyrus_cv_pcre2_utf8=yes,cyrus_cv_pcre2_utf8=no)) + AC_MSG_RESULT($cyrus_cv_pcre2_utf8) else - cyrus_cv_pcre_utf8="no" + cyrus_cv_pcre2_utf8="no" fi fi LIB_REGEX= -if test "$cyrus_cv_pcre_utf8" = "yes"; then - LIB_REGEX="-lpcre -lpcreposix"; +if test "$cyrus_cv_pcre2_utf8" = "yes"; then + LIB_REGEX="-lpcre2-posix"; AC_DEFINE(ENABLE_REGEX, [], [Do we have a regex library?]) - AC_DEFINE(HAVE_PCREPOSIX_H, [], [Do we have usable pcre library?]) + AC_DEFINE(HAVE_PCRE2POSIX_H, [], [Do we have usable pcre2 library?]) else AC_CHECK_HEADERS(rxposix.h) if test "$ac_cv_header_rxposix_h" = "yes"; then diff --git a/sieve/bc_eval.c b/sieve/bc_eval.c index f14a5d7..71f4c1f 100644 --- a/sieve/bc_eval.c +++ b/sieve/bc_eval.c @@ -318,7 +318,7 @@ static int regcomp_flags(int comparator, int requires) #ifdef HAVE_PCREPOSIX_H /* support UTF8 comparisons */ - cflags |= REG_UTF8; + cflags |= REG_UTF; #endif if (comparator == B_ASCIICASEMAP) { diff --git a/sieve/comparator.h b/sieve/comparator.h index b043bc2..4be64a5 100644 --- a/sieve/comparator.h +++ b/sieve/comparator.h @@ -48,8 +48,7 @@ #ifdef ENABLE_REGEX # ifdef HAVE_PCREPOSIX_H -# include -# include +# include # else /* !HAVE_PCREPOSIX_H */ # ifdef HAVE_RXPOSIX_H # include diff --git a/sieve/sieve.y b/sieve/sieve.y index b080c26..8ce1b4e 100644 --- a/sieve/sieve.y +++ b/sieve/sieve.y @@ -2217,7 +2217,7 @@ static int verify_regexlist(sieve_script_t *sscript, #ifdef HAVE_PCREPOSIX_H /* support UTF8 comparisons */ - cflags |= REG_UTF8; + cflags |= REG_UTF; #endif if (collation == B_ASCIICASEMAP) {