summaryrefslogtreecommitdiffhomepage
path: root/auto/modules
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2020-07-31 12:21:21 +0100
committerTiago Natel de Moura <t.nateldemoura@f5.com>2020-07-31 12:21:21 +0100
commitb28b4459b0899cb8357df5f6c1e904fd1a34ebe3 (patch)
treebdabea7bad1f2d04c420f2b6b84dc110c7c968ba /auto/modules
parentf3471c29c0870cffff3d96c1c50c88c47a4d8009 (diff)
downloadunit-b28b4459b0899cb8357df5f6c1e904fd1a34ebe3.tar.gz
unit-b28b4459b0899cb8357df5f6c1e904fd1a34ebe3.tar.bz2
Isolation: fixed the generation of mounts table.
Since the introduction of rootfs feature, some language modules can't be configured multiple times. Now the configure generates a separate nxt_<module>_mounts.h for each module compiled.
Diffstat (limited to 'auto/modules')
-rw-r--r--auto/modules/java9
-rw-r--r--auto/modules/python9
-rw-r--r--auto/modules/ruby15
3 files changed, 20 insertions, 13 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/python b/auto/modules/python
index ab314013..c14bf7e0 100644
--- a/auto/modules/python
+++ b/auto/modules/python
@@ -130,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 -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
@@ -157,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"
@@ -185,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..5cead26b 100644
--- a/auto/modules/ruby
+++ b/auto/modules/ruby
@@ -51,7 +51,6 @@ $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
@@ -145,7 +144,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",
@@ -166,11 +168,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 +202,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