Router: matching regular expressions support.

This commit is contained in:
Axel Duch
2020-11-17 15:03:30 +00:00
parent 2a381a82a6
commit e3af18834d
13 changed files with 575 additions and 39 deletions

View File

@@ -3,15 +3,41 @@
# Copyright (C) NGINX, Inc.
NXT_REGEX=NO
NXT_PCRE_CFLAGS=
NXT_PCRE_LIB=
nxt_found=no
NXT_HAVE_PCRE2=NO
if [ $NXT_TRY_PCRE2 = YES ]; then
if /bin/sh -c "(pcre2-config --version)" >> $NXT_AUTOCONF_ERR 2>&1; then
if [ $NXT_PCRE = YES ]; then
NXT_PCRE_CFLAGS=`pcre2-config --cflags`
NXT_PCRE_LIB=`pcre2-config --libs8`
nxt_found=no
nxt_feature="PCRE2 library"
nxt_feature_name=NXT_HAVE_PCRE2
nxt_feature_run=no
nxt_feature_incs="-DPCRE2_CODE_UNIT_WIDTH=8 $NXT_PCRE_CFLAGS"
nxt_feature_libs=$NXT_PCRE_LIB
nxt_feature_test="#include <pcre2.h>
int main(void) {
pcre2_code *re;
re = pcre2_compile((PCRE2_SPTR)\"\",
PCRE2_ZERO_TERMINATED, 0,
NULL, NULL, NULL);
return (re == NULL);
}"
. auto/feature
if [ $nxt_found = yes ]; then
NXT_HAVE_PCRE2=YES
$echo " + PCRE2 version: `pcre2-config --version`"
fi
fi
fi
if [ $nxt_found = no ]; then
if /bin/sh -c "(pcre-config --version)" >> $NXT_AUTOCONF_ERR 2>&1; then
NXT_PCRE_CFLAGS=`pcre-config --cflags`
@@ -33,17 +59,19 @@ if [ $NXT_PCRE = YES ]; then
return 0;
}"
. auto/feature
if [ $nxt_found = yes ]; then
$echo " + PCRE version: `pcre-config --version`"
fi
fi
if [ $nxt_found = no ]; then
$echo
$echo $0: error: no PCRE library found.
$echo
exit 1;
fi
NXT_REGEX=YES
nxt_have=NXT_REGEX . auto/have
$echo " + PCRE version: `pcre-config --version`"
fi
if [ $nxt_found = yes ]; then
nxt_have=NXT_HAVE_REGEX . auto/have
else
$echo
$echo $0: error: no PCRE library found.
$echo
exit 1;
fi