summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
Diffstat (limited to 'auto')
-rw-r--r--auto/isolation20
-rw-r--r--auto/make52
-rw-r--r--auto/modules/java9
-rw-r--r--auto/modules/php4
-rw-r--r--auto/modules/python12
-rw-r--r--auto/modules/ruby52
-rw-r--r--auto/sources4
7 files changed, 100 insertions, 53 deletions
diff --git a/auto/isolation b/auto/isolation
index 4238b859..fd35f8ed 100644
--- a/auto/isolation
+++ b/auto/isolation
@@ -94,24 +94,8 @@ nxt_feature_libs=
nxt_feature_test="#include <sys/mount.h>
int main() {
- return mount((void*)0, (void*)0, (void*)0, 0, (void*)0);
- }"
-. auto/feature
-
-if [ $nxt_found = yes ]; then
- NXT_HAVE_MOUNT=YES
-fi
-
-
-nxt_feature="Bind mount()"
-nxt_feature_name=NXT_HAVE_BIND_MOUNT
-nxt_feature_run=no
-nxt_feature_incs=
-nxt_feature_libs=
-nxt_feature_test="#include <sys/mount.h>
-
- int main() {
- return MS_BIND | MS_REC
+ return mount(\"/\", \"/\", \"bind\",
+ MS_BIND | MS_REC, \"\");
}"
. auto/feature
diff --git a/auto/make b/auto/make
index 32ead76e..50bc6064 100644
--- a/auto/make
+++ b/auto/make
@@ -130,6 +130,42 @@ END
done
+nxt_src=src/test/nxt_cq_test.c
+nxt_obj=src/test/nxt_ncq_test.o
+nxt_dep=src/test/nxt_ncq_test.dep
+nxt_dep_flags=`nxt_gen_dep_flags`
+nxt_dep_post=`nxt_gen_dep_post`
+cat << END >> $NXT_MAKEFILE
+
+$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
+ \$(CC) -c \$(CFLAGS) -DNXT_NCQ_TEST=1 \$(NXT_LIB_INCS) $NXT_LIB_AUX_CFLAGS \\
+ -o $NXT_BUILD_DIR/$nxt_obj \\
+ $nxt_dep_flags \\
+ $nxt_src
+ $nxt_dep_post
+
+-include $NXT_BUILD_DIR/$nxt_dep
+
+END
+
+nxt_src=src/test/nxt_cq_test.c
+nxt_obj=src/test/nxt_vbcq_test.o
+nxt_dep=src/test/nxt_vbcq_test.dep
+nxt_dep_flags=`nxt_gen_dep_flags`
+nxt_dep_post=`nxt_gen_dep_post`
+cat << END >> $NXT_MAKEFILE
+
+$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
+ \$(CC) -c \$(CFLAGS) -DNXT_NCQ_TEST=0 \$(NXT_LIB_INCS) $NXT_LIB_AUX_CFLAGS \\
+ -o $NXT_BUILD_DIR/$nxt_obj \\
+ $nxt_dep_flags \\
+ $nxt_src
+ $nxt_dep_post
+
+-include $NXT_BUILD_DIR/$nxt_dep
+
+END
+
$echo >> $NXT_MAKEFILE
@@ -151,6 +187,8 @@ if [ $NXT_TESTS = YES ]; then
.PHONY: tests
tests: $NXT_BUILD_DIR/tests $NXT_BUILD_DIR/utf8_file_name_test \\
+ $NXT_BUILD_DIR/ncq_test \\
+ $NXT_BUILD_DIR/vbcq_test \\
$NXT_BUILD_DIR/unit_app_test $NXT_BUILD_DIR/unit_websocket_chat \\
$NXT_BUILD_DIR/unit_websocket_echo
@@ -169,6 +207,20 @@ $NXT_BUILD_DIR/utf8_file_name_test: $NXT_LIB_UTF8_FILE_NAME_TEST_SRCS \\
$NXT_BUILD_DIR/$NXT_LIB_STATIC \\
$NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
+$NXT_BUILD_DIR/ncq_test: $NXT_BUILD_DIR/src/test/nxt_ncq_test.o \\
+ $NXT_BUILD_DIR/$NXT_LIB_STATIC
+ \$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/ncq_test \\
+ \$(CFLAGS) $NXT_BUILD_DIR/src/test/nxt_ncq_test.o \\
+ $NXT_BUILD_DIR/$NXT_LIB_STATIC \\
+ $NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
+
+$NXT_BUILD_DIR/vbcq_test: $NXT_BUILD_DIR/src/test/nxt_vbcq_test.o \\
+ $NXT_BUILD_DIR/$NXT_LIB_STATIC
+ \$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/vbcq_test \\
+ \$(CFLAGS) $NXT_BUILD_DIR/src/test/nxt_vbcq_test.o \\
+ $NXT_BUILD_DIR/$NXT_LIB_STATIC \\
+ $NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
+
$NXT_BUILD_DIR/unit_app_test: $NXT_BUILD_DIR/src/test/nxt_unit_app_test.o \\
$NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
\$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/unit_app_test \\
diff --git a/auto/modules/java b/auto/modules/java
index a3b1b958..fa68f573 100644
--- a/auto/modules/java
+++ b/auto/modules/java
@@ -227,7 +227,6 @@ NXT_JAVA_INSTALL_JARS=
NXT_JAVA_UNINSTALL_JARS=
NXT_JAVA_JARS=$NXT_BUILD_DIR/$NXT_JAVA_MODULE/nxt_jars.h
-NXT_JAVA_MOUNTS_HEADER=$NXT_BUILD_DIR/$NXT_JAVA_MODULE/nxt_java_mounts.h
mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE
cat << END > $NXT_JAVA_JARS
@@ -318,7 +317,10 @@ NXT_JAVA_LIBC_DIR=`ldd "$NXT_JAVA_LIBJVM" | grep libc.so | cut -d' ' -f3`
NXT_JAVA_LIBC_DIR=`dirname $NXT_JAVA_LIBC_DIR`
fi
-cat << END > $NXT_JAVA_MOUNTS_HEADER
+
+NXT_JAVA_MOUNTS_HEADER=nxt_${NXT_JAVA_MODULE}_mounts.h
+
+cat << END > $NXT_BUILD_DIR/$NXT_JAVA_MOUNTS_HEADER
#ifndef _NXT_JAVA_MOUNTS_H_INCLUDED_
#define _NXT_JAVA_MOUNTS_H_INCLUDED_
@@ -371,7 +373,8 @@ for nxt_src in $NXT_JAVA_MODULE_SRCS; do
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
mkdir -p $NXT_BUILD_DIR/src/java
- \$(CC) -c \$(CFLAGS) \$(NXT_INCS) $NXT_JAVA_INCLUDE \\
+ \$(CC) -c \$(CFLAGS) -DNXT_JAVA_MOUNTS_H=\"$NXT_JAVA_MOUNTS_HEADER\" \\
+ \$(NXT_INCS) $NXT_JAVA_INCLUDE \\
$nxt_dep_flags \\
-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
$nxt_dep_post
diff --git a/auto/modules/php b/auto/modules/php
index 2cec2f44..75d60242 100644
--- a/auto/modules/php
+++ b/auto/modules/php
@@ -77,8 +77,8 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
$echo " + PHP SAPI: [`${NXT_PHP_CONFIG} --php-sapis`]"
NXT_PHP_MAJOR_VERSION=${NXT_PHP_VERSION%%.*}
- NXT_PHP_MINOR_VERSION=${NXT_PHP_VERSION#??}
- NXT_PHP_MINOR_VERSION=${NXT_PHP_MINOR_VERSION%.*}
+ NXT_PHP_MINOR_VERSION=${NXT_PHP_VERSION#*.}
+ NXT_PHP_MINOR_VERSION=${NXT_PHP_MINOR_VERSION%%.*}
if [ $NXT_PHP_MAJOR_VERSION = 5 -a $NXT_PHP_MINOR_VERSION -lt 4 ]; then
NXT_PHP_ADDITIONAL_FLAGS=-Wno-write-strings
diff --git a/auto/modules/python b/auto/modules/python
index ad862f3c..c14bf7e0 100644
--- a/auto/modules/python
+++ b/auto/modules/python
@@ -68,7 +68,6 @@ if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then
NXT_PYTHON_CONFIG="${NXT_PYTHON_CONFIG} --embed"
fi
- NXT_PYTHON_EXEC=`${NXT_PYTHON_CONFIG} --exec-prefix`/bin/${NXT_PYTHON}
NXT_PYTHON_INCLUDE=`${NXT_PYTHON_CONFIG} --includes`
NXT_PYTHON_LIBS=`${NXT_PYTHON_CONFIG} --ldflags`
@@ -131,13 +130,13 @@ if grep ^$NXT_PYTHON_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
fi
-NXT_PYTHON_MOUNTS_HEADER=$NXT_BUILD_DIR/nxt_python_mounts.h
+NXT_PYTHON_MOUNTS_HEADER=nxt_${NXT_PYTHON_MODULE}_mounts.h
-$NXT_PYTHON_EXEC -c 'import os.path
+$NXT_PYTHON -c 'import os.path
import sys
pyver = "python" + str(sys.version_info[0]) + "." + str(sys.version_info[1])
-print("static const nxt_fs_mount_t nxt_python%d%d_mounts[] = {" % (sys.version_info[0], sys.version_info[1]))
+print("static const nxt_fs_mount_t nxt_python_mounts[] = {")
pattern = "{(u_char *) \"%s\", (u_char *) \"%s\", (u_char *) \"bind\", NXT_MS_BIND|NXT_MS_REC, NULL},"
base = None
@@ -158,7 +157,7 @@ for p in sys.path:
print("};\n\n")
-' >> $NXT_PYTHON_MOUNTS_HEADER
+' > $NXT_BUILD_DIR/$NXT_PYTHON_MOUNTS_HEADER
$echo " + Python module: ${NXT_PYTHON_MODULE}.unit.so"
@@ -186,7 +185,8 @@ for nxt_src in $NXT_PYTHON_MODULE_SRCS; do
cat << END >> $NXT_MAKEFILE
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
- \$(CC) -c \$(CFLAGS) \$(NXT_INCS) $NXT_PYTHON_INCLUDE \\
+ \$(CC) -c \$(CFLAGS) -DNXT_PYTHON_MOUNTS_H=\"$NXT_PYTHON_MOUNTS_HEADER\" \\
+ \$(NXT_INCS) $NXT_PYTHON_INCLUDE \\
$nxt_dep_flags \\
-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
$nxt_dep_post
diff --git a/auto/modules/ruby b/auto/modules/ruby
index f7334cc7..c1444f07 100644
--- a/auto/modules/ruby
+++ b/auto/modules/ruby
@@ -51,45 +51,49 @@ $echo "configuring Ruby module ..." >> $NXT_AUTOCONF_ERR
NXT_RUBY=${NXT_RUBY=ruby}
NXT_RUBY_MODULE=${NXT_RUBY_MODULE=${NXT_RUBY}}
-NXT_RUBY_MOUNTS_HEADER=$NXT_BUILD_DIR/nxt_ruby_mounts.h
nxt_found=no
if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then
- NXT_RUBY_RUBYHDRDIR=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubyhdrdir"])'`
- NXT_RUBY_ARCHHDRDIR=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubyarchhdrdir"])'`
- NXT_RUBY_SITEARCHDIR=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["sitearchhdrdir"])'`
- NXT_RUBY_SITEDIR=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["sitedir"])'`
- NXT_RUBY_LIBDIR=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubylibdir"])'`
- NXT_RUBY_TOPDIR=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["topdir"])'`
- NXT_RUBY_PREFIXDIR=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["rubylibprefix"])'`
- NXT_RUBY_GEMDIR=`gem environment gemdir`
- NXT_RUBY_GEMPATH=`gem environment gempath`
+ NXT_RUBY_RUBYHDRDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["rubyhdrdir"]'`
+ NXT_RUBY_ARCHHDRDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["rubyarchhdrdir"]'`
+ NXT_RUBY_SITEDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["sitedir"]'`
+ NXT_RUBY_LIBDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"]'`
+ NXT_RUBY_TOPDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["topdir"]'`
+ NXT_RUBY_PREFIXDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["rubylibprefix"]'`
+
+ NXT_RUBY_GEMPATH=`$NXT_RUBY -rrubygems -e 'print Gem.default_path().join(":")'`
NXT_RUBY_INCPATH="-I$NXT_RUBY_ARCHHDRDIR -I$NXT_RUBY_RUBYHDRDIR"
- NXT_RUBY_LIBNAME=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["RUBY_SO_NAME"])'`
- NXT_RUBY_LIBSCONF=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["LIBS"])'`
+ NXT_RUBY_LIBNAME=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["RUBY_SO_NAME"]'`
+ NXT_RUBY_LIBSCONF=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["LIBS"]'`
+ NXT_RUBY_LIBPATH=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["libdir"]'`
NXT_RUBY_LIBS="-l$NXT_RUBY_LIBNAME $NXT_RUBY_LIBSCONF"
nxt_feature="Ruby library"
nxt_feature_name=""
- nxt_feature_run=no
+ nxt_feature_run=value
nxt_feature_incs="${NXT_RUBY_INCPATH}"
nxt_feature_libs="${NXT_RUBY_LIBS}"
nxt_feature_test="
#include <ruby.h>
int main() {
+ static const char *argv[3] = {
+ \"NGINX_Unit\", \"-rrbconfig\",
+ \"-eprint RbConfig::CONFIG['libdir']\"
+ };
+
+ RUBY_INIT_STACK;
ruby_init();
- return ruby_cleanup(0);
+ return ruby_run_node(ruby_options(3, (char **) argv));
}"
. auto/feature
- if [ $nxt_found = no ]; then
- NXT_RUBY_LIBPATH=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["libdir"])'`
+ if [ "$nxt_feature_value" != "$NXT_RUBY_LIBPATH" ]; then
NXT_RUBY_LIBS="-L$NXT_RUBY_LIBPATH -Wl,-rpath,${NXT_RUBY_LIBPATH} $NXT_RUBY_LIBS"
nxt_feature="Ruby library in $NXT_RUBY_LIBPATH"
@@ -145,7 +149,10 @@ if grep ^$NXT_RUBY_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
fi
-cat << END > $NXT_RUBY_MOUNTS_HEADER
+NXT_RUBY_MOUNTS_HEADER=nxt_${NXT_RUBY_MODULE}_mounts.h
+NXT_RUBY_MOUNTS_PATH=$NXT_BUILD_DIR/$NXT_RUBY_MOUNTS_HEADER
+
+cat << END > $NXT_RUBY_MOUNTS_PATH
static const nxt_fs_mount_t nxt_ruby_mounts[] = {
{(u_char *) "$NXT_RUBY_RUBYHDRDIR", (u_char *) "$NXT_RUBY_RUBYHDRDIR",
@@ -156,8 +163,6 @@ static const nxt_fs_mount_t nxt_ruby_mounts[] = {
(u_char *) "bind", NXT_MS_BIND | NXT_MS_REC, NULL},
{(u_char *) "$NXT_RUBY_LIBDIR", (u_char *) "$NXT_RUBY_LIBDIR",
(u_char *) "bind", NXT_MS_BIND | NXT_MS_REC, NULL},
- {(u_char *) "$NXT_RUBY_GEMDIR", (u_char *) "$NXT_RUBY_GEMDIR",
- (u_char *) "bind", NXT_MS_BIND | NXT_MS_REC, NULL},
{(u_char *) "$NXT_RUBY_TOPDIR", (u_char *) "$NXT_RUBY_TOPDIR",
(u_char *) "bind", NXT_MS_BIND | NXT_MS_REC, NULL},
{(u_char *) "$NXT_RUBY_PREFIXDIR", (u_char *) "$NXT_RUBY_PREFIXDIR",
@@ -166,11 +171,11 @@ static const nxt_fs_mount_t nxt_ruby_mounts[] = {
END
for path in `echo $NXT_RUBY_GEMPATH | tr ':' '\n'`; do
- $echo "{(u_char *) \"$path\", (u_char *) \"$path\"," >> $NXT_RUBY_MOUNTS_HEADER
- $echo "(u_char *) \"bind\", NXT_MS_BIND | NXT_MS_REC, NULL}," >> $NXT_RUBY_MOUNTS_HEADER
+ $echo "{(u_char *) \"$path\", (u_char *) \"$path\"," >> $NXT_RUBY_MOUNTS_PATH
+ $echo "(u_char *) \"bind\", NXT_MS_BIND | NXT_MS_REC, NULL}," >> $NXT_RUBY_MOUNTS_PATH
done
-$echo "};" >> $NXT_RUBY_MOUNTS_HEADER
+$echo "};" >> $NXT_RUBY_MOUNTS_PATH
$echo " + Ruby module: ${NXT_RUBY_MODULE}.unit.so"
@@ -200,7 +205,8 @@ for nxt_src in $NXT_RUBY_MODULE_SRCS; do
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
mkdir -p $NXT_BUILD_DIR/src/ruby
- \$(CC) -c \$(CFLAGS) \$(NXT_INCS) $NXT_RUBY_INCPATH \\
+ \$(CC) -c \$(CFLAGS) -DNXT_RUBY_MOUNTS_H=\"$NXT_RUBY_MOUNTS_HEADER\" \\
+ \$(NXT_INCS) $NXT_RUBY_INCPATH \\
$nxt_dep_flags \\
-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
$nxt_dep_post
diff --git a/auto/sources b/auto/sources
index 2075ca0f..a61577dc 100644
--- a/auto/sources
+++ b/auto/sources
@@ -31,6 +31,7 @@ NXT_LIB_SRCS=" \
src/nxt_utf8.c \
src/nxt_parse.c \
src/nxt_sprintf.c \
+ src/nxt_var.c \
src/nxt_file_name.c \
src/nxt_log.c \
src/nxt_djb_hash.c \
@@ -90,6 +91,8 @@ NXT_LIB_SRCS=" \
src/nxt_http_return.c \
src/nxt_http_static.c \
src/nxt_http_proxy.c \
+ src/nxt_http_chunk_parse.c \
+ src/nxt_http_variables.c \
src/nxt_application.c \
src/nxt_external.c \
src/nxt_port_hash.c \
@@ -107,7 +110,6 @@ NXT_LIB_SRC0=" \
src/nxt_stream_source.c \
src/nxt_upstream_source.c \
src/nxt_http_source.c \
- src/nxt_http_chunk_parse.c \
src/nxt_fastcgi_source.c \
src/nxt_fastcgi_record_parse.c \
\