From bc5191c7bcfb7df191cbe411882eab9a1c71e518 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 26 Dec 2011 13:10:36 +0000 Subject: Added support for regex study and PCRE JIT (ticket #41) optimizations on configuration phase. --- auto/lib/pcre/conf | 23 +++++++++++++++++++---- auto/lib/pcre/make | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'auto/lib') diff --git a/auto/lib/pcre/conf b/auto/lib/pcre/conf index 3008f5892..e90d02307 100644 --- a/auto/lib/pcre/conf +++ b/auto/lib/pcre/conf @@ -4,8 +4,6 @@ if [ $PCRE != NONE ]; then CORE_INCS="$CORE_INCS $PCRE" - CORE_DEPS="$CORE_DEPS $REGEX_DEPS" - CORE_SRCS="$CORE_SRCS $REGEX_SRCS" case "$NGX_CC_NAME" in @@ -81,6 +79,12 @@ if [ $PCRE != NONE ]; then esac + + if [ $PCRE_JIT = YES ]; then + have=NGX_HAVE_PCRE_JIT . auto/have + PCRE_CONF_OPT="$PCRE_CONF_OPT --enable-jit" + fi + else if [ "$NGX_PLATFORM" != win32 ]; then @@ -156,12 +160,23 @@ else fi if [ $ngx_found = yes ]; then - CORE_DEPS="$CORE_DEPS $REGEX_DEPS" - CORE_SRCS="$CORE_SRCS $REGEX_SRCS" CORE_INCS="$CORE_INCS $ngx_feature_path" CORE_LIBS="$CORE_LIBS $ngx_feature_libs" PCRE=YES fi + + if [ $PCRE == YES ]; then + ngx_feature="PCRE JIT support" + ngx_feature_name="NGX_HAVE_PCRE_JIT" + ngx_feature_test="int jit = 0; + pcre_config(PCRE_CONFIG_JIT, &jit); + if (jit != 1) return 1;" + . auto/feature + + if [ $ngx_found = yes ]; then + PCRE_JIT=YES + fi + fi fi if [ $PCRE != YES ]; then diff --git a/auto/lib/pcre/make b/auto/lib/pcre/make index 9f2c658bf..a9be75e36 100644 --- a/auto/lib/pcre/make +++ b/auto/lib/pcre/make @@ -50,7 +50,7 @@ $PCRE/Makefile: $NGX_MAKEFILE cd $PCRE \\ && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\ && CC="\$(CC)" CFLAGS="$PCRE_OPT" \\ - ./configure --disable-shared + ./configure --disable-shared $PCRE_CONF_OPT $PCRE/.libs/libpcre.a: $PCRE/Makefile cd $PCRE \\ -- cgit