summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2011-12-26 13:10:36 +0000
committerValentin Bartenev <vbart@nginx.com>2011-12-26 13:10:36 +0000
commitbc5191c7bcfb7df191cbe411882eab9a1c71e518 (patch)
tree8e35857c295a4b8d0612a4ae33d1e1fe47ead960 /auto
parent947bdfa7fe9559ccbc9c47a49105d78b9b674a64 (diff)
downloadnginx-bc5191c7bcfb7df191cbe411882eab9a1c71e518.tar.gz
nginx-bc5191c7bcfb7df191cbe411882eab9a1c71e518.tar.bz2
Added support for regex study and PCRE JIT (ticket #41) optimizations on
configuration phase.
Diffstat (limited to 'auto')
-rw-r--r--auto/lib/pcre/conf23
-rw-r--r--auto/lib/pcre/make2
-rw-r--r--auto/modules6
-rw-r--r--auto/options4
-rw-r--r--auto/sources1
5 files changed, 31 insertions, 5 deletions
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 \\
diff --git a/auto/modules b/auto/modules
index a8607eefc..93e0de995 100644
--- a/auto/modules
+++ b/auto/modules
@@ -396,6 +396,12 @@ if [ $USE_OPENSSL = YES ]; then
CORE_SRCS="$CORE_SRCS $OPENSSL_SRCS"
fi
+if [ $USE_PCRE = YES ]; then
+ modules="$modules $REGEX_MODULE"
+ CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
+ CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
+fi
+
if [ $HTTP = YES ]; then
modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
$HTTP_HEADERS_FILTER_MODULE \
diff --git a/auto/options b/auto/options
index e8de4ff45..2b040238e 100644
--- a/auto/options
+++ b/auto/options
@@ -111,6 +111,8 @@ NGX_ADDONS=
USE_PCRE=NO
PCRE=NONE
PCRE_OPT=
+PCRE_CONF_OPT=
+PCRE_JIT=NO
USE_OPENSSL=NO
OPENSSL=NONE
@@ -274,6 +276,7 @@ use the \"--without-http_limit_conn_module\" option instead"
--with-pcre) USE_PCRE=YES ;;
--with-pcre=*) PCRE="$value" ;;
--with-pcre-opt=*) PCRE_OPT="$value" ;;
+ --with-pcre-jit) PCRE_JIT=YES ;;
--with-openssl=*) OPENSSL="$value" ;;
--with-openssl-opt=*) OPENSSL_OPT="$value" ;;
@@ -421,6 +424,7 @@ cat << END
--with-pcre force PCRE library usage
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional build options for PCRE
+ --with-pcre-jit build PCRE with JIT compilation support
--with-md5=DIR set path to md5 library sources
--with-md5-opt=OPTIONS set additional build options for md5
diff --git a/auto/sources b/auto/sources
index 24fa3b89f..38b3f40af 100644
--- a/auto/sources
+++ b/auto/sources
@@ -69,6 +69,7 @@ CORE_SRCS="src/core/nginx.c \
src/core/ngx_crypt.c"
+REGEX_MODULE=ngx_regex_module
REGEX_DEPS=src/core/ngx_regex.h
REGEX_SRCS=src/core/ngx_regex.c