summaryrefslogtreecommitdiffhomepage
path: root/auto/modules
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2020-08-13 19:28:27 +0300
committerAndrei Belov <defan@nginx.com>2020-08-13 19:28:27 +0300
commitaff76e4f90b4e948c327ce2b021dc3203c33cbcd (patch)
tree5bd6ac3aa92683777548472984c209bf26d8a971 /auto/modules
parent04ce9f997e0e49e57ce4b5fc4aa98134232a1974 (diff)
parent6473d4b65a99aa10d509220fb99d8c4f65631ed0 (diff)
downloadunit-1.19.0-1.tar.gz
unit-1.19.0-1.tar.bz2
Merged with the default branch.1.19.0-1
Diffstat (limited to 'auto/modules')
-rw-r--r--auto/modules/java9
-rw-r--r--auto/modules/php4
-rw-r--r--auto/modules/python12
-rw-r--r--auto/modules/ruby52
4 files changed, 43 insertions, 34 deletions
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