diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-11-22 00:43:13 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-11-22 02:50:26 -0500 |
commit | 7512d82ca49f1b579819c2974c61de4e3137c70b (patch) | |
tree | 955ad40637d6fb5577427beb15e9c8c82f43dfc7 /configure.ac | |
parent | 7db817c59a89375ece9c3ec3b4ef7e4302e64549 (diff) | |
download | lighttpd-git-7512d82ca49f1b579819c2974c61de4e3137c70b.tar.gz |
[core] pcre2 support (--with-pcre2)
x-ref:
"lighttpd: depends on obsolete pcre3 library"
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000063
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index bd9c4517..a4a9da74 100644 --- a/configure.ac +++ b/configure.ac @@ -902,6 +902,37 @@ if test "x$use_nss" = "xyes"; then fi +dnl pcre2 support +AC_MSG_NOTICE([----------------------------------------]) +AC_MSG_CHECKING([for perl regular expressions support]) +AC_ARG_WITH([pcre2], + [AS_HELP_STRING([--with-pcre2], [Enable pcre2 support (default no)])], + [WITH_PCRE2=$withval], + [WITH_PCRE2=no] +) +AC_MSG_RESULT([$WITH_PCRE2]) + +if test "$WITH_PCRE2" != no; then + if test "$WITH_PCRE2" != yes; then + PCRE_LIB="-L$WITH_PCRE2/lib -lpcre2-8" + CPPFLAGS="$CPPFLAGS -I$WITH_PCRE/include" + else + AC_PATH_PROG([PCRE2CONFIG], [pcre2-config]) + if test -n "$PCRE2CONFIG"; then + PCRE_LIB=`"$PCRE2CONFIG" --libs8` + CPPFLAGS="$CPPFLAGS `"$PCRE2CONFIG" --cflags`" + fi + fi + + if test -z "$PCRE_LIB"; then + AC_MSG_ERROR([pcre2-config not found, install the pcre2-devel package or build with --without-pcre2]) + fi + + AC_DEFINE([HAVE_PCRE], [1], [libpcre2-8]) + AC_DEFINE([HAVE_PCRE2_H], [1], [pcre.h]) + AC_SUBST([PCRE_LIB]) +fi + dnl pcre support AC_MSG_NOTICE([----------------------------------------]) AC_MSG_CHECKING([for perl regular expressions support]) @@ -912,7 +943,7 @@ AC_ARG_WITH([pcre], ) AC_MSG_RESULT([$WITH_PCRE]) -if test "$WITH_PCRE" != no; then +if test "$WITH_PCRE" != no && test "$WITH_PCRE2" = "no"; then if test "$WITH_PCRE" != yes; then PCRE_LIB="-L$WITH_PCRE/lib -lpcre" CPPFLAGS="$CPPFLAGS -I$WITH_PCRE/include" @@ -928,7 +959,7 @@ if test "$WITH_PCRE" != no; then AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre]) fi - AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre]) + AC_DEFINE([HAVE_PCRE], [1], [libpcre]) AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h]) AC_SUBST([PCRE_LIB]) fi |