Compare commits
58 Commits
ae01f6599d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| fab11ef95d | |||
| 3691e860c5 | |||
| 87d8415094 | |||
| 96918645db | |||
| a25e847062 | |||
| abf1f42fef | |||
| 1c6c0ba2b9 | |||
| 670f534c31 | |||
| 5f5e72af93 | |||
| 6ad872ec90 | |||
| 4d87fa4b66 | |||
| 20b6b44b24 | |||
| 42a61cf7d1 | |||
| d6f7027d84 | |||
| f550bb8a80 | |||
| 95047705cd | |||
| 669209ad6d | |||
| 8fda15f4e6 | |||
| 5e1e36e783 | |||
| 6cfc2d11f6 | |||
| 599b863695 | |||
| e65fe6e06d | |||
| 1a985987c7 | |||
| d09c4daaff | |||
| a3420dd5e4 | |||
| 3ca0ca086a | |||
| a9b6141e05 | |||
| 9fe4007f6d | |||
| 5f2af548ca | |||
| 687776f246 | |||
| 5d57a8b990 | |||
| fcde36bb2c | |||
| 4729938c89 | |||
| eb282381d9 | |||
| 7e2729e0dc | |||
| 32dbd4cc5d | |||
| a1bb9a6ee3 | |||
| 718cc8f8d3 | |||
| 26cdcdd1c7 | |||
| 03dea970bd | |||
| a6d59cdfeb | |||
| ba9e828985 | |||
| 5471d10256 | |||
| 584a287955 | |||
| a6487e5a75 | |||
| 6f0dc76bfc | |||
| aec772940e | |||
| 097a8c49ab | |||
| d93cbda299 | |||
| bd7cfc17a2 | |||
| bd08d0e55b | |||
| eb269b0261 | |||
| 53b4bde474 | |||
| 19d0cc5c31 | |||
| 35a9ab83c4 | |||
| bf711a5f12 | |||
| 1be88e1973 | |||
| a92c5c45e2 |
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -1,7 +0,0 @@
|
||||
*.c diff=cpp
|
||||
*.h diff=cpp
|
||||
|
||||
.hg* export-ignore
|
||||
pkg/** export-ignore
|
||||
docs/*.* export-ignore
|
||||
docs/Makefile export-ignore
|
||||
@@ -1,69 +1,149 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
- cron: '@monthly'
|
||||
|
||||
jobs:
|
||||
build-and-deploy-image:
|
||||
runs-on: ubuntu-latest
|
||||
build-amd64:
|
||||
runs-on: linux_amd
|
||||
name: Build AMD64
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
env:
|
||||
DOCKER_ORG: technocloud-public
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
|
||||
outputs:
|
||||
digest-3-10: ${{ steps.digest.outputs.DIGEST_3_10 }}
|
||||
digest-3-11: ${{ steps.digest.outputs.DIGEST_3_11 }}
|
||||
digest-3-12: ${{ steps.digest.outputs.DIGEST_3_12 }}
|
||||
digest-3-13: ${{ steps.digest.outputs.DIGEST_3_13 }}
|
||||
digest-3-14: ${{ steps.digest.outputs.DIGEST_3_14 }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
github-server-url: https://gitea.technocloud.ee
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker BuildX
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
platforms: linux/amd64
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.technocloud.ee
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get Meta
|
||||
id: meta
|
||||
run: |
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Python 3.10
|
||||
echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
|
||||
- name: Build and Push AMD64
|
||||
id: build-docker
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: pkg/docker
|
||||
file: pkg/docker/Dockerfile.python3.10
|
||||
platforms: linux/amd64,linux/arm64
|
||||
context: .
|
||||
file: Dockerfile.python${{ matrix.python-version }}
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python3.10
|
||||
provenance: false
|
||||
outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true
|
||||
- name: Summarize the Docker digest
|
||||
id: digest
|
||||
run: |
|
||||
PY_VERSION=${{ matrix.python-version }}
|
||||
PY_VERSION_MOD=$(echo $PY_VERSION | sed 's/\./_/g')
|
||||
echo DIGEST_${PY_VERSION_MOD}="${{ steps.build-docker.outputs.digest }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Python 3.11
|
||||
uses: docker/build-push-action@v5
|
||||
build-arm64:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build ARM64
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
|
||||
outputs:
|
||||
digest-3-10: ${{ steps.digest.outputs.DIGEST_3_10 }}
|
||||
digest-3-11: ${{ steps.digest.outputs.DIGEST_3_11 }}
|
||||
digest-3-12: ${{ steps.digest.outputs.DIGEST_3_12 }}
|
||||
digest-3-13: ${{ steps.digest.outputs.DIGEST_3_13 }}
|
||||
digest-3-14: ${{ steps.digest.outputs.DIGEST_3_14 }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
context: pkg/docker
|
||||
file: pkg/docker/Dockerfile.python3.11
|
||||
platforms: linux/amd64,linux/arm64
|
||||
github-server-url: https://gitea.technocloud.ee
|
||||
- name: Set up Docker BuildX
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
platforms: linux/arm64
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.technocloud.ee
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Get Meta
|
||||
id: meta
|
||||
run: |
|
||||
echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
|
||||
- name: Build and Push ARM64
|
||||
id: build-docker
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.python${{ matrix.python-version }}
|
||||
platforms: linux/arm64
|
||||
push: true
|
||||
tags: gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python3.11
|
||||
provenance: false
|
||||
outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true
|
||||
- name: Summarize the Docker digest
|
||||
id: digest
|
||||
run: |
|
||||
PY_VERSION=${{ matrix.python-version }}
|
||||
PY_VERSION_MOD=$(echo $PY_VERSION | sed 's/\./_/g')
|
||||
echo DIGEST_${PY_VERSION_MOD}="${{ steps.build-docker.outputs.digest }}"
|
||||
echo DIGEST_${PY_VERSION_MOD}="${{ steps.build-docker.outputs.digest }}" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
- name: Build and push Python 3.12
|
||||
uses: docker/build-push-action@v5
|
||||
create-manifest:
|
||||
needs: [build-arm64, build-amd64]
|
||||
runs-on: ubuntu-latest
|
||||
name: Create Multi-arch Manifest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
|
||||
steps:
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
context: pkg/docker
|
||||
file: pkg/docker/Dockerfile.python3.12
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python3.12
|
||||
registry: gitea.technocloud.ee
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Set up Docker BuildX
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: docker-container
|
||||
|
||||
- name: Get Repository Metadata
|
||||
id: meta
|
||||
run: |
|
||||
echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
|
||||
echo "PY_VERSION=digest-$(echo ${{ matrix.python-version }} | sed 's/\./-/g')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create and Push Multi-arch Manifest
|
||||
run: |
|
||||
ARM_DIGEST=${{ needs.build-arm64.outputs[steps.meta.outputs.PY_VERSION] }}
|
||||
AMD_DIGEST=${{ needs.build-amd64.outputs[steps.meta.outputs.PY_VERSION] }}
|
||||
IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python${{ matrix.python-version }}
|
||||
docker manifest create $IMAGE_NAME --amend ${{ steps.meta.outputs.PACKAGE }}@${ARM_DIGEST} --amend ${{ steps.meta.outputs.PACKAGE }}@${AMD_DIGEST}
|
||||
docker manifest push $IMAGE_NAME
|
||||
|
||||
339
.github/workflows/ci.yml
vendored
339
.github/workflows/ci.yml
vendored
@@ -1,339 +0,0 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Core
|
||||
- build: unit
|
||||
os: ubuntu-latest
|
||||
# Modules
|
||||
- build: go-1.21
|
||||
os: ubuntu-latest
|
||||
- build: go-1.22
|
||||
os: ubuntu-latest
|
||||
- build: java-17
|
||||
os: ubuntu-latest
|
||||
- build: java-18
|
||||
os: ubuntu-latest
|
||||
- build: java-21
|
||||
os: ubuntu-latest
|
||||
- build: node-20
|
||||
os: ubuntu-latest
|
||||
- build: node-21
|
||||
os: ubuntu-latest
|
||||
- build: perl
|
||||
os: ubuntu-latest
|
||||
- build: php-8.1
|
||||
os: ubuntu-latest
|
||||
- build: php-8.2
|
||||
os: ubuntu-latest
|
||||
- build: php-8.3
|
||||
os: ubuntu-latest
|
||||
- build: python-3.11
|
||||
os: ubuntu-latest
|
||||
- build: python-3.12
|
||||
os: ubuntu-latest
|
||||
- build: ruby-3.2
|
||||
os: ubuntu-latest
|
||||
- build: ruby-3.3
|
||||
os: ubuntu-latest
|
||||
- build: wasm
|
||||
os: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Creates and outputs directories used by tests (/usr/local is unfriendly)
|
||||
- name: Configure directories
|
||||
id: dir
|
||||
run: |
|
||||
PREFIX=${HOME}/.unit
|
||||
BIN=${PREFIX}/bin
|
||||
VAR=${PREFIX}/var
|
||||
mkdir -p $BIN
|
||||
mkdir -p $VAR
|
||||
|
||||
echo "prefix=${PREFIX}" >> "$GITHUB_OUTPUT"
|
||||
echo "bin=${BIN}" >> "$GITHUB_OUTPUT"
|
||||
echo "bin=${BIN}" >> "$GITHUB_PATH"
|
||||
echo "var=${VAR}" >> "$GITHUB_OUTPUT"
|
||||
cat "$GITHUB_OUTPUT"
|
||||
|
||||
# Provides module, language version and testpath from build name
|
||||
- name: Output build metadata
|
||||
id: metadata
|
||||
run: |
|
||||
# Split the build name by '-' into module and version
|
||||
IFS='-' read -r module version <<< "${{ matrix.build }}"
|
||||
|
||||
testpath="test/test_${module}*"
|
||||
|
||||
# Run all tests for "unit" and "python"
|
||||
# Python is the default module for tests
|
||||
if [ "$module" = "unit" ] || [ "$module" = "python" ]; then
|
||||
testpath="test"
|
||||
fi
|
||||
|
||||
echo "module=${module}" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
echo "testpath=${testpath}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
NJS_VERSION=$(sed -n "s/NJS_VERSION := \(.*\)/\1/p" pkg/contrib/src/njs/version)
|
||||
echo "njs_version=${NJS_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
cat "$GITHUB_OUTPUT"
|
||||
|
||||
# https://github.com/actions/runner-images/issues/2821
|
||||
- name: Kill mono process
|
||||
run: |
|
||||
sudo systemctl stop mono-xsp4.service
|
||||
sudo systemctl mask mono-xsp4.service
|
||||
sudo systemctl status mono-xsp4.service || true
|
||||
PID=$(sudo lsof -t -i :8084)
|
||||
echo "Killing PID $PID"
|
||||
sudo kill -9 $PID
|
||||
|
||||
##
|
||||
## njs
|
||||
##
|
||||
|
||||
- name: Clone njs repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: nginx/njs
|
||||
ref: '${{ steps.metadata.outputs.njs_version }}'
|
||||
path: njs
|
||||
|
||||
- name: Make njs
|
||||
run: |
|
||||
./configure --no-libxml2 --no-zlib
|
||||
make -j4 -k
|
||||
working-directory: njs
|
||||
|
||||
##
|
||||
## Unit
|
||||
##
|
||||
|
||||
- name: Configure unit
|
||||
run: |
|
||||
./configure \
|
||||
--prefix=${{ steps.dir.outputs.prefix }} \
|
||||
--sbindir=${{ steps.dir.outputs.bin }} \
|
||||
--logdir=${{ steps.dir.outputs.var }}/log \
|
||||
--log=${{ steps.dir.outputs.var }}/log/unit/unit.log \
|
||||
--runstatedir=${{ steps.dir.outputs.var }}/run \
|
||||
--pid=${{ steps.dir.outputs.var }}/run/unit/unit.pid \
|
||||
--control=unix:${{ steps.dir.outputs.var }}/run/unit/control.sock \
|
||||
--modules=${{ steps.dir.outputs.prefix }}/lib/unit/modules \
|
||||
--statedir=${{ steps.dir.outputs.var }}/state/unit \
|
||||
--tests \
|
||||
--openssl \
|
||||
--njs \
|
||||
--cc-opt="-I njs/src/ -I njs/build" \
|
||||
--ld-opt="-L njs/build"
|
||||
|
||||
- name: Make unit
|
||||
run: |
|
||||
make -j4 -k || make
|
||||
|
||||
##
|
||||
## Go
|
||||
##
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '${{ steps.metadata.outputs.version }}'
|
||||
cache: false
|
||||
if: steps.metadata.outputs.module == 'go'
|
||||
|
||||
- name: Configure go
|
||||
run: |
|
||||
./configure go --go-path=
|
||||
if: steps.metadata.outputs.module == 'go'
|
||||
|
||||
- name: Make go
|
||||
run: |
|
||||
make go
|
||||
make go-install
|
||||
if: steps.metadata.outputs.module == 'go'
|
||||
|
||||
##
|
||||
## Java
|
||||
##
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '${{ steps.metadata.outputs.version }}'
|
||||
if: steps.metadata.outputs.module == 'java'
|
||||
|
||||
- name: Configure java
|
||||
run: |
|
||||
./configure java
|
||||
if: steps.metadata.outputs.module == 'java'
|
||||
|
||||
- name: Make java
|
||||
run: |
|
||||
make java
|
||||
if: steps.metadata.outputs.module == 'java'
|
||||
|
||||
##
|
||||
## Node
|
||||
##
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '${{ steps.metadata.outputs.version }}'
|
||||
if: steps.metadata.outputs.module == 'node'
|
||||
|
||||
- name: Install node-gyp
|
||||
run: |
|
||||
npm install -g node-gyp
|
||||
if: steps.metadata.outputs.module == 'node'
|
||||
|
||||
- name: Configure node
|
||||
run: |
|
||||
./configure nodejs
|
||||
if: steps.metadata.outputs.module == 'node'
|
||||
|
||||
- name: Make node
|
||||
run: |
|
||||
make node-local-install DESTDIR=node
|
||||
if: steps.metadata.outputs.module == 'node'
|
||||
|
||||
##
|
||||
## Perl
|
||||
##
|
||||
|
||||
# Uses default Actions VM Perl
|
||||
# https://github.com/actions/runner-images#available-images
|
||||
|
||||
- name: Install libperl-dev
|
||||
run: |
|
||||
sudo apt-get install libperl-dev
|
||||
if: steps.metadata.outputs.module == 'perl'
|
||||
|
||||
- name: Configure perl
|
||||
run: |
|
||||
./configure perl
|
||||
if: steps.metadata.outputs.module == 'perl'
|
||||
|
||||
- name: Make perl
|
||||
run: |
|
||||
make perl
|
||||
if: steps.metadata.outputs.module == 'perl'
|
||||
|
||||
##
|
||||
## PHP
|
||||
##
|
||||
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '${{ steps.metadata.outputs.version }}'
|
||||
extensions: none
|
||||
env:
|
||||
update: true
|
||||
if: steps.metadata.outputs.module == 'php'
|
||||
|
||||
- name: Configure php
|
||||
run: |
|
||||
./configure php
|
||||
if: steps.metadata.outputs.module == 'php'
|
||||
|
||||
- name: Make php
|
||||
run: |
|
||||
make php
|
||||
if: steps.metadata.outputs.module == 'php'
|
||||
|
||||
##
|
||||
## Python 3
|
||||
##
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '${{ steps.metadata.outputs.version }}'
|
||||
if: steps.metadata.outputs.module == 'python'
|
||||
|
||||
- name: Configure python3
|
||||
run: |
|
||||
./configure python --config=python3-config
|
||||
if: steps.metadata.outputs.module == 'python'
|
||||
|
||||
- name: Make python3
|
||||
run: |
|
||||
make python3
|
||||
if: steps.metadata.outputs.module == 'python'
|
||||
|
||||
##
|
||||
## Ruby
|
||||
##
|
||||
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '${{ steps.metadata.outputs.version }}'
|
||||
if: steps.metadata.outputs.module == 'ruby'
|
||||
|
||||
- name: Install rack
|
||||
run: |
|
||||
gem install rack
|
||||
if: steps.metadata.outputs.module == 'ruby'
|
||||
|
||||
- name: Configure ruby
|
||||
run: |
|
||||
./configure ruby
|
||||
if: steps.metadata.outputs.module == 'ruby'
|
||||
|
||||
- name: Make ruby
|
||||
run: |
|
||||
make ruby
|
||||
if: steps.metadata.outputs.module == 'ruby'
|
||||
|
||||
##
|
||||
## Wasm
|
||||
##
|
||||
|
||||
- name: Make wasmtime
|
||||
run: |
|
||||
make -C pkg/contrib .wasmtime
|
||||
if: steps.metadata.outputs.module == 'wasm'
|
||||
|
||||
- name: Configure wasm
|
||||
run: |
|
||||
./configure wasm --include-path=pkg/contrib/wasmtime/crates/c-api/include --lib-path=pkg/contrib/wasmtime/target/release
|
||||
if: steps.metadata.outputs.module == 'wasm'
|
||||
|
||||
- name: Make wasm
|
||||
run: |
|
||||
make wasm
|
||||
if: steps.metadata.outputs.module == 'wasm'
|
||||
|
||||
##
|
||||
## Tests
|
||||
##
|
||||
|
||||
# Install python3 if not present
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3'
|
||||
if: steps.metadata.outputs.module != 'wasm'
|
||||
|
||||
- name: Install pytest
|
||||
run: |
|
||||
pip install pytest
|
||||
if: steps.metadata.outputs.module != 'wasm'
|
||||
|
||||
- name: Run ${{ steps.metadata.outputs.module }} tests
|
||||
run: |
|
||||
pytest --print-log ${{ steps.metadata.outputs.testpath }}
|
||||
# Skip pytest if wasm build, as there are no tests yet
|
||||
if: steps.metadata.outputs.module != 'wasm'
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,4 +1 @@
|
||||
/build/
|
||||
Makefile
|
||||
*.pyc
|
||||
__pycache__/
|
||||
.idea
|
||||
@@ -1,6 +0,0 @@
|
||||
^build/
|
||||
^Makefile$
|
||||
\.pyc$
|
||||
\.cache$
|
||||
\.pytest_cache$
|
||||
__pycache__/
|
||||
43
.hgtags
43
.hgtags
@@ -1,43 +0,0 @@
|
||||
f9d308f3fceba164f2326fb2ad242339157cb162 0.1
|
||||
b09757e4984e70439168af3501ac1787d0276368 0.2
|
||||
b8400e8feb36f29a6b3f5f58b1473b040720490c 0.3
|
||||
6071f4300f76e2b879e9cc7fd431e5e119077f16 0.4
|
||||
1ba4d13d222bc62caa5b1b42cf5ad50a9cf47f64 0.5
|
||||
88831b81e384982223fa01f2f29cbb8642846a80 0.6
|
||||
d2fcec5b0fa3b0e8da1945aa240d23be3bf94309 0.7
|
||||
5870dd420309fe2584abc4ca8d63168ad9141274 1.0
|
||||
3f710b55c226c7579d4e737198c2d8a9b7d67518 1.1
|
||||
fbe7f5a3867e9559ef0884786fe5150aa60414e6 1.2
|
||||
b3cf22b8a17e0e35ca80decb03ed2cceb662c3de 1.3
|
||||
8f4524a9cf87fbddf626302da071f5055cf33f28 1.4
|
||||
b3dee0cc5a4edd046345511769b5cfec49044f1c 1.5
|
||||
d411e7fdee9e03036adb652f8d9f4c45a420bdd5 1.6
|
||||
784b45adb0fe8bdd707510f59ed18309087e5c21 1.7
|
||||
0f04ef991fbc1dadbc590ab7fb229d4f3d6357bc 1.7.1
|
||||
0a18a14d169f156f8e2daca35aa86d5a6dd9b1ae 1.8.0
|
||||
dda6319de785dc2d225d818349aba56fc48d47f6 1.9.0
|
||||
cdbba3c3e3762eacc308a5407877c3665a05058d 1.10.0
|
||||
3b1601ac0f2f53fed4cae01b9db0e4e070665cae 1.11.0
|
||||
b391df5f0102aa6afe660cfc863729c1b1111c9e 1.12.0
|
||||
3313bf222e6e0a91213946dfcbd70bb5079f4cef 1.13.0
|
||||
6e28966ed1f26e119bf333229ea5e6686c60a469 1.14.0
|
||||
801ac82f80fb2b2333f2c03ac9c3df6b7cec130a 1.15.0
|
||||
8bab088952dd9d7caa3d04fd4b3026cef26fcf7d 1.16.0
|
||||
4b13438632bc37ca599113be90af64f6e2f09d83 1.17.0
|
||||
9e14c63773be52613dd47dea9fd113037f15a3eb 1.18.0
|
||||
86cdf66f82745d8db35345368dcdb38c79a4f03a 1.19.0
|
||||
0e985b30067380782125f1c479eda4ef909418df 1.20.0
|
||||
f804aaf7eee10a7d8116820840d6312dd4914a41 1.21.0
|
||||
331bdadeca30a49dd11b86af99124c2ffeb22d05 1.22.0
|
||||
49ee24c03f5749f8a1b69dc1c600ad48517d9d7a 1.23.0
|
||||
847c88d10f26765b45149c14f88c2274adfc3f42 1.24.0
|
||||
54ffe5ce4fb3c4304faf6d342d9b17dee2c745ac 1.25.0
|
||||
2be7b623fbfafdb470d832a28abb1cd55c76e04f 1.26.0
|
||||
1a08f884b24effa8b843d6aeeaf016b6354d1256 1.26.1
|
||||
8a9055cbe4ffd450fac4d7a849c00e0db5485ad3 1.27.0
|
||||
ea073fb3cb75abfb4be5dc12402de73e0c20da60 1.28.0
|
||||
37cac7fec92e5656d8a03a8594ade131c3391f45 1.29.0
|
||||
fa0227b7f62691a186d752ace475868de49e9fce 1.29.1
|
||||
2692a5823c403a4e209681943e32a4907317d14b 1.30.0
|
||||
3a9046dca2a6c51ee2df2cabdf69cb9a83e7a1e6 1.31.0
|
||||
25aafe2ff61e0424b3245f4e3d40eb1fa7611063 1.31.1
|
||||
20
.mailmap
20
.mailmap
@@ -1,20 +0,0 @@
|
||||
Alejandro Colomar <alx@kernel.org> <alx@nginx.com>
|
||||
Alejandro Colomar <alx@kernel.org> <a.colomar@f5.com>
|
||||
Alejandro Colomar <alx@kernel.org> <alx.manpages@gmail.com>
|
||||
Andrei Zeliankou <zelenkov@nginx.com>
|
||||
Andrei Zeliankou <zelenkov@nginx.com> <xim.andrew@gmail.com>
|
||||
Andrew Clayton <a.clayton@nginx.com> <andrew@digital-domain.net>
|
||||
Andrew Clayton <a.clayton@nginx.com> <a.clayton@f5.com>
|
||||
Artem Konev <artem.konev@nginx.com> <41629299+artemkonev@users.noreply.github.com>
|
||||
Dan Callahan <d.callahan@f5.com> <dan.callahan@gmail.com>
|
||||
Danielle De Leo <d.deleo@f5.com> <danielle@fastmail.net>
|
||||
Dylan Arbour <d.arbour@f5.com> <arbourd@users.noreply.github.com>
|
||||
Konstantin Pavlov <thresh@nginx.com> <thresh@videolan.org>
|
||||
Konstantin Pavlov <thresh@nginx.com> <pavlov.konstantin@gmail.com>
|
||||
Max Romanov <max.romanov@gmail.com> <max.romanov@nginx.com>
|
||||
OutOfFocus4 <jeff.iadarola@gmail.com> <jeffrey_iadarola@urmc.rochester.edu>
|
||||
Sergey A. Osokin <sergey.osokin@nginx.com> <osa@FreeBSD.org.ru>
|
||||
Taryn Musgrave <t.musgrave@f5.com> <34845739+tarynmusgrave@users.noreply.github.com>
|
||||
Tiago Natel de Moura <t.nateldemoura@f5.com>
|
||||
Timo Stark <t.stark@nginx.com> <tippexs91@googlemail.com>
|
||||
Zhidao HONG <z.hong@f5.com> <hongzhidao@gmail.com>
|
||||
@@ -1 +0,0 @@
|
||||
max_width = 80
|
||||
@@ -1,74 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the moderation team at nginx-oss-community@f5.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
|
||||
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
<https://www.contributor-covenant.org/faq>
|
||||
@@ -1,90 +0,0 @@
|
||||
# Contributing Guidelines
|
||||
|
||||
The following is a set of guidelines for contributing to NGINX Unit. We do
|
||||
appreciate that you are considering contributing!
|
||||
|
||||
## Table Of Contents
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Ask a Question](#ask-a-question)
|
||||
- [Contributing](#contributing)
|
||||
- [Git Style Guide](#git-style-guide)
|
||||
|
||||
|
||||
## Getting Started
|
||||
|
||||
Check out the [Quick Installation](README.md#quick-installation) and
|
||||
[Howto](https://unit.nginx.org/howto/) guides to get NGINX Unit up and running.
|
||||
|
||||
|
||||
## Ask a Question
|
||||
|
||||
Please open an [issue](https://github.com/nginx/unit/issues/new) on GitHub with
|
||||
the label `question`. You can also ask a question on
|
||||
[GitHub Discussions](https://github.com/nginx/unit/discussions) or the NGINX Unit mailing list,
|
||||
unit@nginx.org (subscribe
|
||||
[here](https://mailman.nginx.org/mailman3/lists/unit.nginx.org/)).
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
### Report a Bug
|
||||
|
||||
Ensure the bug was not already reported by searching on GitHub under
|
||||
[Issues](https://github.com/nginx/unit/issues).
|
||||
|
||||
If the bug is a potential security vulnerability, please report using our
|
||||
[security policy](https://unit.nginx.org/troubleshooting/#getting-support).
|
||||
|
||||
To report a non-security bug, open an
|
||||
[issue](https://github.com/nginx/unit/issues/new) on GitHub with the label
|
||||
`bug`. Be sure to include a title and clear description, as much relevant
|
||||
information as possible, and a code sample or an executable test case showing
|
||||
the expected behavior that doesn't occur.
|
||||
|
||||
|
||||
### Suggest an Enhancement
|
||||
|
||||
To suggest an enhancement, open an
|
||||
[issue](https://github.com/nginx/unit/issues/new) on GitHub with the label
|
||||
`enhancement`. Please do this before implementing a new feature to discuss the
|
||||
feature first.
|
||||
|
||||
|
||||
### Open a Pull Request
|
||||
|
||||
Before submitting a PR, please read the NGINX Unit code guidelines to know more
|
||||
about coding conventions and benchmarks. Fork the repo, create a branch, and
|
||||
submit a PR when your changes are tested and ready for review. Again, if you'd
|
||||
like to implement a new feature, please consider creating a feature request
|
||||
issue first to start a discussion about the feature.
|
||||
|
||||
|
||||
## Git Style Guide
|
||||
|
||||
- Keep a clean, concise and meaningful `git commit` history on your branch,
|
||||
rebasing locally and squashing before submitting a PR
|
||||
|
||||
- For any user-visible changes, updates, and bugfixes, add a note to
|
||||
`docs/changes.xml` under the section for the upcoming release, using `<change
|
||||
type="feature">` for new functionality, `<change type="change">` for changed
|
||||
behavior, and `<change type="bugfix">` for bug fixes.
|
||||
|
||||
- In the subject line, use the past tense ("Added feature", not "Add feature");
|
||||
also, use past tense to describe past scenarios, and present tense for
|
||||
current behavior
|
||||
|
||||
- Limit the subject line to 67 characters, and the rest of the commit message
|
||||
to 80 characters
|
||||
|
||||
- Use subject line prefixes for commits that affect a specific portion of the
|
||||
code; examples include "Tests:", "Packages:", or "Docker:", and also
|
||||
individual languages such as "Java:" or "Ruby:"
|
||||
|
||||
- Reference issues and PRs liberally after the subject line; if the commit
|
||||
remedies a GitHub issue, [name
|
||||
it](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
|
||||
accordingly
|
||||
|
||||
- Don't rely on command-line commit messages with `-m`; use the editor instead
|
||||
|
||||
@@ -1,21 +1,41 @@
|
||||
FROM debian:bullseye-slim
|
||||
FROM python:3.10-slim
|
||||
|
||||
LABEL org.opencontainers.image.title="Unit (wasm)"
|
||||
LABEL org.opencontainers.image.title="Unit (python3.13-slim)"
|
||||
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
|
||||
LABEL org.opencontainers.image.url="https://unit.nginx.org"
|
||||
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
|
||||
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
|
||||
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
|
||||
LABEL org.opencontainers.image.version="1.32.1"
|
||||
LABEL org.opencontainers.image.version="1.35.0"
|
||||
|
||||
RUN set -ex \
|
||||
&& savedAptMark="$(apt-mark showmanual)" \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates git build-essential libssl-dev libpcre2-dev curl pkg-config \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
ca-certificates git build-essential libssl-dev libpcre2-dev zlib1g-dev libzstd-dev libbrotli-dev curl pkg-config pkgconf libclang-dev cmake \
|
||||
&& export RUST_VERSION=1.89.0 \
|
||||
&& export RUSTUP_HOME=/usr/src/unit/rustup \
|
||||
&& export CARGO_HOME=/usr/src/unit/cargo \
|
||||
&& export PATH=/usr/src/unit/cargo/bin:$PATH \
|
||||
&& dpkgArch="$(dpkg --print-architecture)" \
|
||||
&& case "${dpkgArch##*-}" in \
|
||||
amd64) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d" ;; \
|
||||
arm64) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2" ;; \
|
||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
||||
esac \
|
||||
&& url="https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/rustup-init" \
|
||||
&& curl -L -O "$url" \
|
||||
&& echo "${rustupSha256} *rustup-init" | sha256sum -c - \
|
||||
&& chmod +x rustup-init \
|
||||
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} \
|
||||
&& rm rustup-init \
|
||||
&& rustup --version \
|
||||
&& cargo --version \
|
||||
&& rustc --version \
|
||||
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
|
||||
&& mkdir -p /usr/src/unit \
|
||||
&& cd /usr/src/unit \
|
||||
&& git clone --depth 1 -b 1.32.1-1 https://github.com/nginx/unit \
|
||||
&& git clone --depth 1 -b 1.35.0 https://github.com/nginx/unit \
|
||||
&& cd unit \
|
||||
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
|
||||
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
|
||||
@@ -34,7 +54,11 @@ RUN set -ex \
|
||||
--openssl \
|
||||
--libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
|
||||
&& CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
|
||||
--njs" \
|
||||
--njs \
|
||||
--otel \
|
||||
--zlib \
|
||||
--zstd \
|
||||
--brotli" \
|
||||
&& make -j $NCPU -C pkg/contrib .njs \
|
||||
&& export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
|
||||
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
|
||||
@@ -45,35 +69,14 @@ RUN set -ex \
|
||||
&& make -j $NCPU unitd \
|
||||
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
|
||||
&& make clean \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y libclang-dev \
|
||||
&& export RUST_VERSION=1.76.0 \
|
||||
&& export RUSTUP_HOME=/usr/src/unit/rustup \
|
||||
&& export CARGO_HOME=/usr/src/unit/cargo \
|
||||
&& export PATH=/usr/src/unit/cargo/bin:$PATH \
|
||||
&& dpkgArch="$(dpkg --print-architecture)" \
|
||||
&& case "${dpkgArch##*-}" in \
|
||||
amd64) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db" ;; \
|
||||
arm64) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800" ;; \
|
||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
||||
esac \
|
||||
&& url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init" \
|
||||
&& curl -L -O "$url" \
|
||||
&& echo "${rustupSha256} *rustup-init" | sha256sum -c - \
|
||||
&& chmod +x rustup-init \
|
||||
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} \
|
||||
&& rm rustup-init \
|
||||
&& rustup --version \
|
||||
&& cargo --version \
|
||||
&& rustc --version \
|
||||
&& make -C pkg/contrib .wasmtime \
|
||||
&& install -pm 755 pkg/contrib/wasmtime/target/release/libwasmtime.so /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \
|
||||
&& /bin/true \
|
||||
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
|
||||
&& ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ && ./configure wasm-wasi-component \
|
||||
&& make -j $NCPU wasm-install wasm-wasi-component-install \
|
||||
&& ./configure python --config=/usr/local/bin/python3-config \
|
||||
&& make -j $NCPU python3-install \
|
||||
&& make clean \
|
||||
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
|
||||
&& ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ && ./configure wasm-wasi-component \
|
||||
&& make -j $NCPU wasm-install wasm-wasi-component-install \
|
||||
&& ./configure python --config=/usr/local/bin/python3-config \
|
||||
&& make -j $NCPU python3-install \
|
||||
&& cd \
|
||||
&& rm -rf /usr/src/unit \
|
||||
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
|
||||
@@ -107,4 +110,4 @@ STOPSIGNAL SIGTERM
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
@@ -1,21 +1,41 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
LABEL org.opencontainers.image.title="Unit (python3.11)"
|
||||
LABEL org.opencontainers.image.title="Unit (python3.11-slim)"
|
||||
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
|
||||
LABEL org.opencontainers.image.url="https://unit.nginx.org"
|
||||
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
|
||||
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
|
||||
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
|
||||
LABEL org.opencontainers.image.version="1.32.1"
|
||||
LABEL org.opencontainers.image.version="1.35.0"
|
||||
|
||||
RUN set -ex \
|
||||
&& savedAptMark="$(apt-mark showmanual)" \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates git build-essential libssl-dev libpcre2-dev curl pkg-config \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
ca-certificates git build-essential libssl-dev libpcre2-dev zlib1g-dev libzstd-dev libbrotli-dev curl pkg-config pkgconf libclang-dev cmake \
|
||||
&& export RUST_VERSION=1.89.0 \
|
||||
&& export RUSTUP_HOME=/usr/src/unit/rustup \
|
||||
&& export CARGO_HOME=/usr/src/unit/cargo \
|
||||
&& export PATH=/usr/src/unit/cargo/bin:$PATH \
|
||||
&& dpkgArch="$(dpkg --print-architecture)" \
|
||||
&& case "${dpkgArch##*-}" in \
|
||||
amd64) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d" ;; \
|
||||
arm64) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2" ;; \
|
||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
||||
esac \
|
||||
&& url="https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/rustup-init" \
|
||||
&& curl -L -O "$url" \
|
||||
&& echo "${rustupSha256} *rustup-init" | sha256sum -c - \
|
||||
&& chmod +x rustup-init \
|
||||
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} \
|
||||
&& rm rustup-init \
|
||||
&& rustup --version \
|
||||
&& cargo --version \
|
||||
&& rustc --version \
|
||||
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
|
||||
&& mkdir -p /usr/src/unit \
|
||||
&& cd /usr/src/unit \
|
||||
&& git clone --depth 1 -b 1.32.1-1 https://github.com/nginx/unit \
|
||||
&& git clone --depth 1 -b 1.35.0 https://github.com/nginx/unit \
|
||||
&& cd unit \
|
||||
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
|
||||
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
|
||||
@@ -34,7 +54,11 @@ RUN set -ex \
|
||||
--openssl \
|
||||
--libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
|
||||
&& CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
|
||||
--njs" \
|
||||
--njs \
|
||||
--otel \
|
||||
--zlib \
|
||||
--zstd \
|
||||
--brotli" \
|
||||
&& make -j $NCPU -C pkg/contrib .njs \
|
||||
&& export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
|
||||
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
|
||||
@@ -86,4 +110,4 @@ STOPSIGNAL SIGTERM
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
@@ -1,21 +1,41 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
LABEL org.opencontainers.image.title="Unit (python3.12)"
|
||||
LABEL org.opencontainers.image.title="Unit (python3.12-slim)"
|
||||
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
|
||||
LABEL org.opencontainers.image.url="https://unit.nginx.org"
|
||||
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
|
||||
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
|
||||
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
|
||||
LABEL org.opencontainers.image.version="1.32.1"
|
||||
LABEL org.opencontainers.image.version="1.35.0"
|
||||
|
||||
RUN set -ex \
|
||||
&& savedAptMark="$(apt-mark showmanual)" \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates git build-essential libssl-dev libpcre2-dev curl pkg-config \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
ca-certificates git build-essential libssl-dev libpcre2-dev zlib1g-dev libzstd-dev libbrotli-dev curl pkg-config pkgconf libclang-dev cmake \
|
||||
&& export RUST_VERSION=1.89.0 \
|
||||
&& export RUSTUP_HOME=/usr/src/unit/rustup \
|
||||
&& export CARGO_HOME=/usr/src/unit/cargo \
|
||||
&& export PATH=/usr/src/unit/cargo/bin:$PATH \
|
||||
&& dpkgArch="$(dpkg --print-architecture)" \
|
||||
&& case "${dpkgArch##*-}" in \
|
||||
amd64) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d" ;; \
|
||||
arm64) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2" ;; \
|
||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
||||
esac \
|
||||
&& url="https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/rustup-init" \
|
||||
&& curl -L -O "$url" \
|
||||
&& echo "${rustupSha256} *rustup-init" | sha256sum -c - \
|
||||
&& chmod +x rustup-init \
|
||||
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} \
|
||||
&& rm rustup-init \
|
||||
&& rustup --version \
|
||||
&& cargo --version \
|
||||
&& rustc --version \
|
||||
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
|
||||
&& mkdir -p /usr/src/unit \
|
||||
&& cd /usr/src/unit \
|
||||
&& git clone --depth 1 -b 1.32.1-1 https://github.com/nginx/unit \
|
||||
&& git clone --depth 1 -b 1.35.0 https://github.com/nginx/unit \
|
||||
&& cd unit \
|
||||
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
|
||||
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
|
||||
@@ -34,7 +54,11 @@ RUN set -ex \
|
||||
--openssl \
|
||||
--libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
|
||||
&& CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
|
||||
--njs" \
|
||||
--njs \
|
||||
--otel \
|
||||
--zlib \
|
||||
--zstd \
|
||||
--brotli" \
|
||||
&& make -j $NCPU -C pkg/contrib .njs \
|
||||
&& export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
|
||||
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
|
||||
@@ -86,4 +110,4 @@ STOPSIGNAL SIGTERM
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
@@ -1,21 +1,41 @@
|
||||
FROM python:3.10-slim
|
||||
FROM python:3.13-slim
|
||||
|
||||
LABEL org.opencontainers.image.title="Unit (python3.10)"
|
||||
LABEL org.opencontainers.image.title="Unit (python3.13-slim)"
|
||||
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
|
||||
LABEL org.opencontainers.image.url="https://unit.nginx.org"
|
||||
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
|
||||
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
|
||||
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
|
||||
LABEL org.opencontainers.image.version="1.32.1"
|
||||
LABEL org.opencontainers.image.version="1.35.0"
|
||||
|
||||
RUN set -ex \
|
||||
&& savedAptMark="$(apt-mark showmanual)" \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates git build-essential libssl-dev libpcre2-dev curl pkg-config \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
ca-certificates git build-essential libssl-dev libpcre2-dev zlib1g-dev libzstd-dev libbrotli-dev curl pkg-config pkgconf libclang-dev cmake \
|
||||
&& export RUST_VERSION=1.89.0 \
|
||||
&& export RUSTUP_HOME=/usr/src/unit/rustup \
|
||||
&& export CARGO_HOME=/usr/src/unit/cargo \
|
||||
&& export PATH=/usr/src/unit/cargo/bin:$PATH \
|
||||
&& dpkgArch="$(dpkg --print-architecture)" \
|
||||
&& case "${dpkgArch##*-}" in \
|
||||
amd64) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d" ;; \
|
||||
arm64) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2" ;; \
|
||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
||||
esac \
|
||||
&& url="https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/rustup-init" \
|
||||
&& curl -L -O "$url" \
|
||||
&& echo "${rustupSha256} *rustup-init" | sha256sum -c - \
|
||||
&& chmod +x rustup-init \
|
||||
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} \
|
||||
&& rm rustup-init \
|
||||
&& rustup --version \
|
||||
&& cargo --version \
|
||||
&& rustc --version \
|
||||
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
|
||||
&& mkdir -p /usr/src/unit \
|
||||
&& cd /usr/src/unit \
|
||||
&& git clone --depth 1 -b 1.32.1-1 https://github.com/nginx/unit \
|
||||
&& git clone --depth 1 -b 1.35.0 https://github.com/nginx/unit \
|
||||
&& cd unit \
|
||||
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
|
||||
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
|
||||
@@ -34,7 +54,11 @@ RUN set -ex \
|
||||
--openssl \
|
||||
--libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
|
||||
&& CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
|
||||
--njs" \
|
||||
--njs \
|
||||
--otel \
|
||||
--zlib \
|
||||
--zstd \
|
||||
--brotli" \
|
||||
&& make -j $NCPU -C pkg/contrib .njs \
|
||||
&& export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
|
||||
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
|
||||
@@ -86,4 +110,4 @@ STOPSIGNAL SIGTERM
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
113
Dockerfile.python3.14
Normal file
113
Dockerfile.python3.14
Normal file
@@ -0,0 +1,113 @@
|
||||
FROM python:3.14-slim
|
||||
|
||||
LABEL org.opencontainers.image.title="Unit (python3.14-slim)"
|
||||
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
|
||||
LABEL org.opencontainers.image.url="https://unit.nginx.org"
|
||||
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
|
||||
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
|
||||
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
|
||||
LABEL org.opencontainers.image.version="1.35.0"
|
||||
|
||||
RUN set -ex \
|
||||
&& savedAptMark="$(apt-mark showmanual)" \
|
||||
&& apt-get update \
|
||||
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
||||
ca-certificates git build-essential libssl-dev libpcre2-dev zlib1g-dev libzstd-dev libbrotli-dev curl pkg-config pkgconf libclang-dev cmake \
|
||||
&& export RUST_VERSION=1.89.0 \
|
||||
&& export RUSTUP_HOME=/usr/src/unit/rustup \
|
||||
&& export CARGO_HOME=/usr/src/unit/cargo \
|
||||
&& export PATH=/usr/src/unit/cargo/bin:$PATH \
|
||||
&& dpkgArch="$(dpkg --print-architecture)" \
|
||||
&& case "${dpkgArch##*-}" in \
|
||||
amd64) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d" ;; \
|
||||
arm64) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2" ;; \
|
||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
||||
esac \
|
||||
&& url="https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/rustup-init" \
|
||||
&& curl -L -O "$url" \
|
||||
&& echo "${rustupSha256} *rustup-init" | sha256sum -c - \
|
||||
&& chmod +x rustup-init \
|
||||
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} \
|
||||
&& rm rustup-init \
|
||||
&& rustup --version \
|
||||
&& cargo --version \
|
||||
&& rustc --version \
|
||||
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
|
||||
&& mkdir -p /usr/src/unit \
|
||||
&& cd /usr/src/unit \
|
||||
&& git clone --depth 1 -b 1.35.0 https://github.com/nginx/unit \
|
||||
&& cd unit \
|
||||
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
|
||||
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
|
||||
&& CC_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC" dpkg-buildflags --get CFLAGS)" \
|
||||
&& LD_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_LDFLAGS_MAINT_APPEND="-Wl,--as-needed -pie" dpkg-buildflags --get LDFLAGS)" \
|
||||
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
|
||||
--statedir=/var/lib/unit \
|
||||
--control=unix:/var/run/control.unit.sock \
|
||||
--runstatedir=/var/run \
|
||||
--pid=/var/run/unit.pid \
|
||||
--logdir=/var/log \
|
||||
--log=/var/log/unit.log \
|
||||
--tmpdir=/var/tmp \
|
||||
--user=unit \
|
||||
--group=unit \
|
||||
--openssl \
|
||||
--libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
|
||||
&& CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
|
||||
--njs \
|
||||
--otel \
|
||||
--zlib \
|
||||
--zstd \
|
||||
--brotli" \
|
||||
&& make -j $NCPU -C pkg/contrib .njs \
|
||||
&& export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
|
||||
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
|
||||
&& make -j $NCPU unitd \
|
||||
&& install -pm755 build/sbin/unitd /usr/sbin/unitd-debug \
|
||||
&& make clean \
|
||||
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/modules \
|
||||
&& make -j $NCPU unitd \
|
||||
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
|
||||
&& make clean \
|
||||
&& /bin/true \
|
||||
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
|
||||
&& ./configure python --config=/usr/local/bin/python3-config \
|
||||
&& make -j $NCPU python3-install \
|
||||
&& make clean \
|
||||
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
|
||||
&& ./configure python --config=/usr/local/bin/python3-config \
|
||||
&& make -j $NCPU python3-install \
|
||||
&& cd \
|
||||
&& rm -rf /usr/src/unit \
|
||||
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
|
||||
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
|
||||
done \
|
||||
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
|
||||
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
|
||||
&& /bin/true \
|
||||
&& mkdir -p /var/lib/unit/ \
|
||||
&& mkdir -p /docker-entrypoint.d/ \
|
||||
&& groupadd --gid 999 unit \
|
||||
&& useradd \
|
||||
--uid 999 \
|
||||
--gid unit \
|
||||
--no-create-home \
|
||||
--home /nonexistent \
|
||||
--comment "unit user" \
|
||||
--shell /bin/false \
|
||||
unit \
|
||||
&& apt-get update \
|
||||
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
|
||||
&& apt-get purge -y --auto-remove build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -f /requirements.apt \
|
||||
&& ln -sf /dev/stderr /var/log/unit.log
|
||||
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
COPY welcome.* /usr/share/unit/welcome/
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
|
||||
178
LICENSE
178
LICENSE
@@ -1,178 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
37
NOTICE
37
NOTICE
@@ -1,37 +0,0 @@
|
||||
|
||||
NGINX Unit.
|
||||
|
||||
Copyright 2017-2024 NGINX, Inc.
|
||||
Copyright 2017-2024 Andrei Zeliankou
|
||||
Copyright 2018-2024 Konstantin Pavlov
|
||||
Copyright 2021-2024 Zhidao Hong
|
||||
Copyright 2022-2024 Andrew Clayton
|
||||
Copyright 2022-2024 Liam Crilly
|
||||
Copyright 2023-2024 Dan Callahan
|
||||
Copyright 2023-2024 Danielle De Leo
|
||||
Copyright 2023-2024 Dylan Arbour
|
||||
Copyright 2023-2024 Gabor Javorszky
|
||||
Copyright 2023-2024 Igor Ippolitov
|
||||
Copyright 2023-2024 Taryn Musgrave
|
||||
Copyright 2021-2023 Alejandro Colomar
|
||||
Copyright 2017-2022 Valentin V. Bartenev
|
||||
Copyright 2017-2022 Max Romanov
|
||||
Copyright 2021-2022 Oisín Canty
|
||||
Copyright 2017-2021 Igor Sysoev
|
||||
Copyright 2017-2021 Andrei Belov
|
||||
Copyright 2019-2021 Tiago Natel de Moura
|
||||
Copyright 2019-2020 Axel Duch
|
||||
Copyright 2018-2019 Alexander Borisov
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
198
README.md
198
README.md
@@ -1,198 +0,0 @@
|
||||
# NGINX Unit
|
||||
|
||||
## Universal Web App Server
|
||||
|
||||

|
||||
|
||||
NGINX Unit is a lightweight and versatile open-source server that has
|
||||
two primary capabilities:
|
||||
|
||||
- serves static media assets,
|
||||
- runs application code in seven languages.
|
||||
|
||||
Unit compresses several layers of the modern application stack into a potent,
|
||||
coherent solution with a focus on performance, low latency, and scalability. It
|
||||
is intended as a universal building block for any web architecture regardless
|
||||
of its complexity, from enterprise-scale deployments to your pet's homepage.
|
||||
|
||||
Its native [RESTful JSON API](#openapi-specification) enables dynamic
|
||||
updates with zero interruptions and flexible configuration, while its
|
||||
out-of-the-box productivity reliably scales to production-grade workloads. We
|
||||
achieve that with a complex, asynchronous, multithreading architecture
|
||||
comprising multiple processes to ensure security and robustness while getting
|
||||
the most out of today's computing platforms.
|
||||
|
||||
|
||||
## Quick Installation
|
||||
|
||||
### macOS
|
||||
|
||||
``` console
|
||||
$ brew install nginx/unit/unit
|
||||
```
|
||||
|
||||
For details and available language packages, see the
|
||||
[docs](https://unit.nginx.org/installation/#homebrew).
|
||||
|
||||
|
||||
### Docker
|
||||
|
||||
``` console
|
||||
$ docker pull unit
|
||||
```
|
||||
|
||||
For a description of image tags, see the
|
||||
[docs](https://unit.nginx.org/installation/#docker-images).
|
||||
|
||||
|
||||
### Amazon Linux, Fedora, Red Hat
|
||||
|
||||
``` console
|
||||
$ wget https://raw.githubusercontent.com/nginx/unit/master/tools/setup-unit && chmod +x setup-unit
|
||||
# ./setup-unit repo-config && yum install unit
|
||||
# ./setup-unit welcome
|
||||
```
|
||||
|
||||
For details and available language packages, see the
|
||||
[docs](https://unit.nginx.org/installation/#official-packages).
|
||||
|
||||
|
||||
### Debian, Ubuntu
|
||||
|
||||
``` console
|
||||
$ wget https://raw.githubusercontent.com/nginx/unit/master/tools/setup-unit && chmod +x setup-unit
|
||||
# ./setup-unit repo-config && apt install unit
|
||||
# ./setup-unit welcome
|
||||
```
|
||||
|
||||
For details and available language packages, see the
|
||||
[docs](https://unit.nginx.org/installation/#official-packages).
|
||||
|
||||
|
||||
## Running a Hello World App
|
||||
|
||||
Unit runs apps in a
|
||||
[variety of languages](https://unit.nginx.org/howto/samples/).
|
||||
Let's consider a basic example,
|
||||
choosing PHP for no particular reason.
|
||||
|
||||
Suppose you saved a PHP script as `/www/helloworld/index.php`:
|
||||
``` php
|
||||
<?php echo "Hello, PHP on Unit!"; ?>
|
||||
```
|
||||
|
||||
To run it on Unit with the `unit-php` module installed, first set up an
|
||||
application object. Let's store our first config snippet in a file called
|
||||
`config.json`:
|
||||
|
||||
``` json
|
||||
{
|
||||
"helloworld": {
|
||||
"type": "php",
|
||||
"root": "/www/helloworld/"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Saving it as a file isn't necessary, but can come in handy with larger objects.
|
||||
|
||||
Now, `PUT` it into the `/config/applications` section of Unit's control API,
|
||||
usually available by default via a Unix domain socket:
|
||||
|
||||
``` console
|
||||
# curl -X PUT --data-binary @config.json --unix-socket \
|
||||
/path/to/control.unit.sock http://localhost/config/applications
|
||||
```
|
||||
``` json
|
||||
|
||||
{
|
||||
"success": "Reconfiguration done."
|
||||
}
|
||||
```
|
||||
|
||||
Next, reference the app from a listener object in the `/config/listeners`
|
||||
section of the API. This time, we pass the config snippet straight from the
|
||||
command line:
|
||||
|
||||
``` console
|
||||
# curl -X PUT -d '{"127.0.0.1:8080": {"pass": "applications/helloworld"}}' \
|
||||
--unix-socket /path/to/control.unit.sock http://localhost/config/listeners
|
||||
```
|
||||
``` json
|
||||
{
|
||||
"success": "Reconfiguration done."
|
||||
}
|
||||
```
|
||||
|
||||
Now Unit accepts requests at the specified IP and port, passing them to the
|
||||
application process. Your app works!
|
||||
|
||||
``` console
|
||||
$ curl 127.0.0.1:8080
|
||||
|
||||
Hello, PHP on Unit!
|
||||
```
|
||||
|
||||
Finally, query the entire `/config` section of the control API:
|
||||
|
||||
``` console
|
||||
# curl --unix-socket /path/to/control.unit.sock http://localhost/config/
|
||||
```
|
||||
|
||||
Unit's output should contain both snippets, neatly organized:
|
||||
|
||||
``` json
|
||||
{
|
||||
"listeners": {
|
||||
"127.0.0.1:8080": {
|
||||
"pass": "applications/helloworld"
|
||||
}
|
||||
},
|
||||
|
||||
"applications": {
|
||||
"helloworld": {
|
||||
"type": "php",
|
||||
"root": "/www/helloworld/"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For full details of configuration management, see the
|
||||
[docs](https://unit.nginx.org/configuration/#configuration-management).
|
||||
|
||||
## OpenAPI Specification
|
||||
|
||||
Our [OpenAPI specification](docs/unit-openapi.yaml) aims to simplify
|
||||
configuring and integrating NGINX Unit deployments and provide an authoritative
|
||||
source of knowledge about the control API.
|
||||
|
||||
Although the specification is still in the early beta stage, it is a promising
|
||||
step forward for the NGINX Unit community. While working on it, we kindly ask
|
||||
you to experiment and provide feedback to help improve its functionality and
|
||||
usability.
|
||||
|
||||
## Community
|
||||
|
||||
- The go-to place to start asking questions and share your thoughts is
|
||||
[GitHub Discussions](https://github.com/nginx/unit/discussions).
|
||||
|
||||
- Our [GitHub issues page](https://github.com/nginx/unit/issues) offers
|
||||
space for a more technical discussion at your own pace.
|
||||
|
||||
- The [project map](https://github.com/orgs/nginx/projects/1) on
|
||||
GitHub sheds some light on our current work and plans for the future.
|
||||
|
||||
- Our [official website](https://unit.nginx.org/) may provide answers
|
||||
not easily found otherwise.
|
||||
|
||||
- Get involved with the project by contributing! See the
|
||||
[contributing guide](CONTRIBUTING.md) for details.
|
||||
|
||||
- To reach the team directly, subscribe to the
|
||||
[mailing list](https://mailman.nginx.org/mailman/listinfo/unit).
|
||||
|
||||
- For security issues, [email us](security-alert@nginx.org), mentioning
|
||||
NGINX Unit in the subject and following the [CVSS
|
||||
v3.1](https://www.first.org/cvss/v3.1/specification-document) spec.
|
||||
|
||||
30
SECURITY.txt
30
SECURITY.txt
@@ -1,30 +0,0 @@
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA256
|
||||
|
||||
#
|
||||
# Please report security issues as below, specifically
|
||||
# mentioning NGINX Unit in the subject.
|
||||
#
|
||||
Canonical: https://unit.nginx.org/.well-known/security.txt
|
||||
Contact: mailto:security-alert@nginx.org
|
||||
Encryption: https://nginx.org/keys/maxim.key
|
||||
Encryption: https://nginx.org/keys/sb.key
|
||||
Encryption: https://nginx.org/keys/thresh.key
|
||||
Expires: 2025-01-01T00:00:00.000Z
|
||||
Policy: https://www.first.org/cvss/v3.1/specification-document
|
||||
Preferred-Languages: en
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQGzBAEBCAAdFiEEE8gqY7YDV2FW4wpOoOqYG2aw2WcFAmWdrbkACgkQoOqYG2aw
|
||||
2WdAIQv/UpQXSYWboNMq9DnXZsMNdeCdAg8nv1PdNYfDzr21YavHsdP3upEg2NUX
|
||||
M/9WiyO5HwV7FAWKQ8J6T0vg8EZITij5Dxhia4Z/h9QE6bXTH4rD/UViJ+/RTtwF
|
||||
3WvaMNGUSlTQUNCRQ0QGTAb/jXUQCE8OwFz2UM0ZgqyUmIdkuxMEhsNd4AfAUS4A
|
||||
OOhM6qfXXAulPNVFZ65Lx7NIner37OyNuzhyuQxIFsnbGagMEIvptkevNIMEy8WO
|
||||
BeseYx/fp1gHdLTIUKl+nvKR7as5O+fFZSm/eG3VpkS6Fall54WX6zzalhZN7Pie
|
||||
pze8YdbUukdMUV6wQ/pQH4e/QyEEI8RCk95cZE9mSfxygpbIfBypj66GTaOUC/2z
|
||||
iTv2tX/DXiGQbSpkNLzwntVvuN5P9BebxmSKdspwfszccPzNhhCVQMkkhzvNVeQ6
|
||||
UTorp2O3xvi5fBIUWQU5xkrKqwAmZBYHMPDA97H9hiTmHkytd7YYkvPmJKNDksSa
|
||||
ui3gNrJe
|
||||
=yDJD
|
||||
-----END PGP SIGNATURE-----
|
||||
122
auto/atomic
122
auto/atomic
@@ -1,122 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# GCC 4.1+ builtin atomic operations.
|
||||
|
||||
nxt_feature="GCC builtin atomic operations"
|
||||
nxt_feature_name=NXT_HAVE_GCC_ATOMIC
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int main(void) {
|
||||
long n = 0;
|
||||
|
||||
if (!__sync_bool_compare_and_swap(&n, 0, 3))
|
||||
return 1;
|
||||
if (__sync_fetch_and_add(&n, 1) != 3)
|
||||
return 1;
|
||||
if (__sync_lock_test_and_set(&n, 5) != 4)
|
||||
return 1;
|
||||
if (n != 5)
|
||||
return 1;
|
||||
if (__sync_or_and_fetch(&n, 2) != 7)
|
||||
return 1;
|
||||
if (__sync_and_and_fetch(&n, 5) != 5)
|
||||
return 1;
|
||||
__sync_lock_release(&n);
|
||||
if (n != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# Solaris 10 builtin atomic operations.
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
nxt_feature="Solaris builtin atomic operations"
|
||||
nxt_feature_name=NXT_HAVE_SOLARIS_ATOMIC
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <atomic.h>
|
||||
|
||||
int main(void) {
|
||||
ulong_t n = 0;
|
||||
|
||||
if (atomic_cas_ulong(&n, 0, 3) != 0)
|
||||
return 1;
|
||||
if (atomic_add_long_nv(&n, 1) != 4)
|
||||
return 1;
|
||||
if (atomic_swap_ulong(&n, 5) != 4)
|
||||
return 1;
|
||||
if (n != 5)
|
||||
return 1;
|
||||
if (atomic_or_ulong_nv(&n, 2) != 7)
|
||||
return 1;
|
||||
if (atomic_and_ulong_nv(&n, 5) != 5)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# AIX xlC builtin atomic operations.
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
if [ $NXT_64BIT = 1 ]; then
|
||||
nxt_feature_test="int main(void) {
|
||||
long n = 0;
|
||||
long o = 0;
|
||||
|
||||
if (!__compare_and_swaplp(&n, &o, 3))
|
||||
return 1;
|
||||
if (__fetch_and_addlp(&n, 1) != 3)
|
||||
return 1;
|
||||
if (__fetch_and_swaplp(&n, 5) != 4)
|
||||
return 1;
|
||||
if (n != 5)
|
||||
return 1;
|
||||
__isync();
|
||||
__lwsync();
|
||||
return 0;
|
||||
}"
|
||||
else
|
||||
nxt_feature_test="int main(void) {
|
||||
int n = 0;
|
||||
int o = 0;
|
||||
|
||||
if (!__compare_and_swap(&n, &o, 3))
|
||||
return 1;
|
||||
if (__fetch_and_add(&n, 1) != 3)
|
||||
return 1;
|
||||
if (__fetch_and_swap(&n, 5) != 4)
|
||||
return 1;
|
||||
if (n != 5)
|
||||
return 1;
|
||||
__isync();
|
||||
__lwsync();
|
||||
return 0;
|
||||
}"
|
||||
fi
|
||||
|
||||
nxt_feature="xlC builtin atomic operations"
|
||||
nxt_feature_name=NXT_HAVE_XLC_ATOMIC
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no atomic operations found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
# Linux capability
|
||||
|
||||
nxt_feature="Linux capability"
|
||||
nxt_feature_name=NXT_HAVE_LINUX_CAPABILITY
|
||||
nxt_feature_test="#include <linux/capability.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
int main(void) {
|
||||
struct __user_cap_header_struct hdr;
|
||||
hdr.version = _LINUX_CAPABILITY_VERSION;
|
||||
syscall(SYS_capget, &hdr, 0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
25
auto/cc/deps
25
auto/cc/deps
@@ -1,25 +0,0 @@
|
||||
|
||||
case "$NXT_CC_NAME" in
|
||||
|
||||
SunC):
|
||||
nxt_gen_dep_flags() {
|
||||
$echo "-xMMD -xMF $NXT_BUILD_DIR/$nxt_dep.tmp"
|
||||
}
|
||||
|
||||
nxt_gen_dep_post() {
|
||||
$echo -n "@sed -e 's#^.*:#$NXT_BUILD_DIR/$nxt_obj:#' "
|
||||
$echo -n "$NXT_BUILD_DIR/$nxt_dep.tmp > $NXT_BUILD_DIR/$nxt_dep"
|
||||
$echo " && rm -f $NXT_BUILD_DIR/$nxt_dep.tmp"
|
||||
}
|
||||
;;
|
||||
|
||||
*)
|
||||
nxt_gen_dep_flags() {
|
||||
$echo "-MMD -MF $NXT_BUILD_DIR/$nxt_dep -MT $NXT_BUILD_DIR/$nxt_obj"
|
||||
}
|
||||
|
||||
nxt_gen_dep_post() {
|
||||
$echo ""
|
||||
}
|
||||
;;
|
||||
esac
|
||||
209
auto/cc/test
209
auto/cc/test
@@ -1,209 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
$echo checking for C compiler: $CC
|
||||
cat << END >> $NXT_AUTOCONF_ERR
|
||||
----------------------------------------
|
||||
checking for C compiler: $CC
|
||||
END
|
||||
|
||||
|
||||
# Allow error exit status.
|
||||
set +e
|
||||
|
||||
if [ -z `which $CC` ]; then
|
||||
$echo
|
||||
$echo $0: error: $CC not found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
if `/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" >> $NXT_AUTOCONF_ERR 2>&1`
|
||||
then
|
||||
NXT_CC_NAME=gcc
|
||||
$echo " + using GNU C compiler"
|
||||
NXT_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" 2>&1`
|
||||
$echo " + $NXT_CC_VERSION"
|
||||
|
||||
else
|
||||
if `/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" >> $NXT_AUTOCONF_ERR 2>&1`
|
||||
then
|
||||
NXT_CC_NAME=clang
|
||||
$echo " + using Clang C compiler"
|
||||
NXT_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" 2>&1`
|
||||
$echo " + $NXT_CC_VERSION"
|
||||
|
||||
else
|
||||
if `/bin/sh -c "($CC -v)" 2>&1 \
|
||||
| grep "Apple LLVM version" >> $NXT_AUTOCONF_ERR 2>&1`
|
||||
then
|
||||
NXT_CC_NAME=clang
|
||||
$echo " + using Clang C compiler"
|
||||
NXT_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "Apple LLVM version" 2>&1`
|
||||
$echo " + $NXT_CC_VERSION"
|
||||
|
||||
else
|
||||
if `/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" >> $NXT_AUTOCONF_ERR 2>&1`
|
||||
then
|
||||
NXT_CC_NAME=SunC
|
||||
$echo " + using Sun C compiler"
|
||||
NXT_CC_VERSION=`/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" 2>&1`
|
||||
$echo " + $NXT_CC_VERSION"
|
||||
|
||||
else
|
||||
if `/bin/sh -c "($CC -qversion)" 2>&1 \
|
||||
| grep "^IBM XL" >> $NXT_AUTOCONF_ERR 2>&1`
|
||||
then
|
||||
NXT_CC_NAME=xlC
|
||||
$echo " + using AIX xlC compiler"
|
||||
NXT_CC_VERSION=`/bin/sh -c "($CC -qversion)" 2>&1 | grep "IBM XL" 2>&1`
|
||||
$echo " + $NXT_CC_VERSION"
|
||||
|
||||
else
|
||||
if `/bin/sh -c "($CC -V)" 2>&1 | grep "Intel(R) C" >> $NXT_AUTOCONF_ERR 2>&1`
|
||||
then
|
||||
NXT_CC_NAME=ICC
|
||||
$echo " + using Intel C++ compiler"
|
||||
NXT_CC_VERSION=ICC
|
||||
|
||||
else
|
||||
if `/bin/sh -c "($CC -v)" 2>&1 \
|
||||
| grep "Microsoft (R) 32-bit C/C" >> $NXT_AUTOCONF_ERR 2>&1`
|
||||
then
|
||||
NXT_CC_NAME=MSVC
|
||||
$echo " + using MS Visual C++ compiler"
|
||||
NXT_CC_VERSION=MSVC
|
||||
|
||||
else
|
||||
NXT_CC_NAME=cc
|
||||
NXT_CC_VERSION=cc
|
||||
|
||||
fi # MSVC
|
||||
fi # ICC
|
||||
fi # xlC
|
||||
fi # SunC
|
||||
fi # Apple LLVM clang
|
||||
fi # clang
|
||||
fi # gcc
|
||||
|
||||
|
||||
case $NXT_CC_NAME in
|
||||
|
||||
gcc)
|
||||
nxt_have=NXT_GCC . auto/have
|
||||
|
||||
NXT_CFLAGS="$NXT_CFLAGS -pipe"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -fPIC"
|
||||
|
||||
# Do not export symbols except explicitly marked with NXT_EXPORT.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
|
||||
|
||||
# c99/gnu99 conflict with Solaris XOPEN.
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -std=gnu99"
|
||||
|
||||
NXT_CFLAGS="$NXT_CFLAGS -O"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -O0"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
|
||||
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -Wunused-result"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Wno-unused-parameter"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -Wshorten-64-to-32"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Wwrite-strings"
|
||||
|
||||
# -O2 enables -fstrict-aliasing and -fstrict-overflow.
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -O2"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -Wno-strict-aliasing"
|
||||
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -fomit-frame-pointer"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -momit-leaf-frame-pointer"
|
||||
|
||||
# -Wstrict-overflow is supported by GCC 4.2+.
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -Wstrict-overflow=5"
|
||||
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
|
||||
|
||||
# Stop on warning.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Werror"
|
||||
|
||||
# Debug.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -g"
|
||||
;;
|
||||
|
||||
clang)
|
||||
nxt_have=NXT_CLANG . auto/have
|
||||
|
||||
NXT_CFLAGS="$NXT_CFLAGS -pipe"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -fPIC"
|
||||
|
||||
# Do not export symbols except explicitly marked with NXT_EXPORT.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
|
||||
|
||||
NXT_CFLAGS="$NXT_CFLAGS -O"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -O0"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
|
||||
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -Wunused-result"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Wno-unused-parameter"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -Wshorten-64-to-32"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Wwrite-strings"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -O2"
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -fomit-frame-pointer"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -fstrict-aliasing"
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Wstrict-overflow=5"
|
||||
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
|
||||
|
||||
# Stop on warning.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -Werror"
|
||||
|
||||
# Debug.
|
||||
|
||||
if [ "$NXT_SYSTEM_PLATFORM" != "powerpc" ]; then
|
||||
# "-g" flag causes the "unknown pseudo-op: `.cfi_sections'"
|
||||
# error on PowerPC Clang.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -g"
|
||||
fi
|
||||
;;
|
||||
|
||||
SunC)
|
||||
nxt_have=NXT_SUNC . auto/have
|
||||
|
||||
NXT_CFLAGS="$NXT_CFLAGS -fPIC"
|
||||
# Optimization.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -O -fast"
|
||||
# Stop on warning.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -errwarn=%all"
|
||||
# Debug.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -g"
|
||||
;;
|
||||
|
||||
xlC)
|
||||
nxt_have=NXT_XLC . auto/have
|
||||
|
||||
#NXT_CFLAGS="$NXT_CFLAGS -qalloca"
|
||||
# alloca support.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -qlanglvl=extc99"
|
||||
# __thread support.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -qtls"
|
||||
# Suppress warning
|
||||
# 1506-159 (E) Bit field type specified for XXX is not valid.
|
||||
# Type unsigned assumed.
|
||||
NXT_CFLAGS="$NXT_CFLAGS -qsuppress=1506-159"
|
||||
;;
|
||||
|
||||
ICC)
|
||||
;;
|
||||
|
||||
MSVC)
|
||||
;;
|
||||
|
||||
*)
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Stop on error exit status again.
|
||||
set -e
|
||||
22
auto/cgroup
22
auto/cgroup
@@ -1,22 +0,0 @@
|
||||
# Copyright (C) Andrew Clayton
|
||||
# Copyright (C) F5, Inc.
|
||||
|
||||
NXT_HAVE_CGROUP=NO
|
||||
|
||||
if [ -f "/proc/mounts" ]; then
|
||||
CGROUP=$(grep cgroup2 /proc/mounts | head -n 1 | cut -d " " -f 2)
|
||||
|
||||
if [ "$CGROUP" ]; then
|
||||
NXT_HAVE_CGROUP=YES
|
||||
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#ifndef NXT_HAVE_CGROUP
|
||||
#define NXT_HAVE_CGROUP 1
|
||||
#define NXT_CGROUP_ROOT "$CGROUP"
|
||||
#endif
|
||||
|
||||
END
|
||||
|
||||
fi
|
||||
fi
|
||||
196
auto/clang
196
auto/clang
@@ -1,196 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# C language features.
|
||||
|
||||
|
||||
nxt_feature="C99 variadic macro"
|
||||
nxt_feature_name=NXT_HAVE_C99_VARIADIC_MACRO
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#define set(dummy, ...) sprintf(__VA_ARGS__)
|
||||
|
||||
int main(void) {
|
||||
char buf[4];
|
||||
|
||||
buf[0] = '0';
|
||||
set(0, buf, \"%d\", 1);
|
||||
|
||||
if (buf[0] == '1')
|
||||
return 0;
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
nxt_feature="GCC variadic macro"
|
||||
nxt_feature_name=NXT_HAVE_GCC_VARIADIC_MACRO
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#define set(dummy, args...) sprintf(args)
|
||||
|
||||
int main(void) {
|
||||
char buf[4];
|
||||
|
||||
buf[0] = '0';
|
||||
set(0, buf, \"%d\", 1);
|
||||
|
||||
if (buf[0] == '1')
|
||||
return 0;
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="GCC __builtin_expect()"
|
||||
nxt_feature_name=NXT_HAVE_BUILTIN_EXPECT
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int main(int argc, char *const *argv) {
|
||||
if ((__typeof__(argc == 0))
|
||||
__builtin_expect((argc == 0), 0))
|
||||
return 0;
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __builtin_unreachable()"
|
||||
nxt_feature_name=NXT_HAVE_BUILTIN_UNREACHABLE
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int main(void) {
|
||||
__builtin_unreachable();
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __builtin_prefetch()"
|
||||
nxt_feature_name=NXT_HAVE_BUILTIN_PREFETCH
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int main(void) {
|
||||
__builtin_prefetch(0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __builtin_clz()"
|
||||
nxt_feature_name=NXT_HAVE_BUILTIN_CLZ
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int main(void) {
|
||||
if (__builtin_clz(1) == 31)
|
||||
return 0;
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __builtin_popcount()"
|
||||
nxt_feature_name=NXT_HAVE_BUILTIN_POPCOUNT
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int main(void) {
|
||||
if (__builtin_popcount(5) == 2)
|
||||
return 0;
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __attribute__ visibility"
|
||||
nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_VISIBILITY
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int n __attribute__ ((visibility(\"default\")));
|
||||
|
||||
int main(void) {
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __attribute__ aligned"
|
||||
nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_ALIGNED
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="int n __attribute__ ((aligned(64)));
|
||||
|
||||
int main(void) {
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __attribute__ malloc"
|
||||
nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_MALLOC
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
|
||||
void *f(void) __attribute__ ((__malloc__));
|
||||
|
||||
void *f(void) {
|
||||
return malloc(1);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
if (f() != NULL) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __attribute__ packed"
|
||||
nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_PACKED
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="struct s {
|
||||
char c;
|
||||
int i;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
int main(void) {
|
||||
return 1;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="GCC __attribute__ unused"
|
||||
nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_UNUSED
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="static void f(void) __attribute__ ((__unused__));
|
||||
|
||||
static void f(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
echo.exe: echo.c
|
||||
mingw32-gcc -o echo.exe -O2 echo.c
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
$echo 'building an "echo" program'
|
||||
|
||||
rm -f $NXT_BUILD_DIR/bin/echo
|
||||
|
||||
nxt_echo_test="$CC -o $NXT_BUILD_DIR/bin/echo -O $NXT_CC_OPT
|
||||
auto/echo/echo.c $NXT_LD_OPT"
|
||||
|
||||
# "|| true" is to bypass "set -e" setting.
|
||||
nxt_echo_err=`$nxt_echo_test 2>&1 || true`
|
||||
|
||||
if [ ! -x $NXT_BUILD_DIR/bin/echo ]; then
|
||||
$echo
|
||||
$echo $0: error: cannot build an \"echo\" program:
|
||||
$echo
|
||||
$echo $nxt_echo_test
|
||||
$echo
|
||||
$echo $nxt_echo_err
|
||||
$echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo=$NXT_BUILD_DIR/bin/echo
|
||||
@@ -1,43 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) Igor Sysoev
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*
|
||||
* A portable "echo" program that supports "-n" option:
|
||||
* echo Hello world!
|
||||
* echo "Hello world!"
|
||||
* echo -n Hello world!
|
||||
* echo
|
||||
*
|
||||
* It also passes "\c" characters as is.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *const *argv)
|
||||
{
|
||||
int i = 1;
|
||||
int nl = 1;
|
||||
|
||||
if (argc > 1) {
|
||||
if (strcmp(argv[1], "-n") == 0) {
|
||||
nl = 0;
|
||||
i++;
|
||||
}
|
||||
|
||||
while (i < argc) {
|
||||
printf("%s%s", argv[i], (i == argc - 1) ? "" : " ");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nl) {
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
31
auto/endian
31
auto/endian
@@ -1,31 +0,0 @@
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Andrew Clayton
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
nxt_feature="endianness"
|
||||
nxt_feature_name=
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int i = 0x11223344;
|
||||
uint8_t *p;
|
||||
|
||||
p = (uint8_t *)&i;
|
||||
if (*p == 0x44)
|
||||
printf(\"little endian\");
|
||||
else
|
||||
printf(\"big endian\");
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ "$nxt_feature_value" = "little endian" ]; then
|
||||
nxt_have=NXT_HAVE_LITTLE_ENDIAN . auto/have
|
||||
else
|
||||
nxt_have=NXT_HAVE_BIG_ENDIAN . auto/have
|
||||
fi
|
||||
196
auto/events
196
auto/events
@@ -1,196 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Linux epoll.
|
||||
|
||||
nxt_feature="Linux epoll"
|
||||
nxt_feature_name=NXT_HAVE_EPOLL
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/epoll.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
n = epoll_create(1);
|
||||
close(n);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_EPOLL=YES
|
||||
|
||||
nxt_feature="Linux signalfd()"
|
||||
nxt_feature_name=NXT_HAVE_SIGNALFD
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <signal.h>
|
||||
#include <sys/signalfd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
sigset_t mask;
|
||||
|
||||
sigemptyset(&mask);
|
||||
n = signalfd(-1, &mask, 0);
|
||||
close(n);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="Linux eventfd()"
|
||||
nxt_feature_name=NXT_HAVE_EVENTFD
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/eventfd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
n = eventfd(0, 0);
|
||||
close(n);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
else
|
||||
NXT_HAVE_EPOLL=NO
|
||||
fi
|
||||
|
||||
|
||||
# FreeBSD, MacOSX, NetBSD, OpenBSD kqueue.
|
||||
|
||||
nxt_feature="kqueue"
|
||||
nxt_feature_name=NXT_HAVE_KQUEUE
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/types.h>
|
||||
#include <sys/event.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
n = kqueue();
|
||||
close(n);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_KQUEUE=YES
|
||||
|
||||
nxt_feature="kqueue EVFILT_USER"
|
||||
nxt_feature_name=NXT_HAVE_EVFILT_USER
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/event.h>
|
||||
|
||||
int main(void) {
|
||||
struct kevent kev;
|
||||
|
||||
kev.filter = EVFILT_USER;
|
||||
kevent(0, &kev, 1, NULL, 0, NULL);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
else
|
||||
NXT_HAVE_KQUEUE=NO
|
||||
fi
|
||||
|
||||
|
||||
# Solaris event port.
|
||||
|
||||
nxt_feature="Solaris event port"
|
||||
nxt_feature_name=NXT_HAVE_EVENTPORT
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <port.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
n = port_create();
|
||||
close(n);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_EVENTPORT=YES
|
||||
else
|
||||
NXT_HAVE_EVENTPORT=NO
|
||||
fi
|
||||
|
||||
|
||||
# Solaris, HP-UX, IRIX, Tru64 UNIX /dev/poll.
|
||||
|
||||
nxt_feature="/dev/poll"
|
||||
nxt_feature_name=NXT_HAVE_DEVPOLL
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/devpoll.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
n = open(\"/dev/poll\", O_RDWR);
|
||||
close(n);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_DEVPOLL=YES
|
||||
else
|
||||
NXT_HAVE_DEVPOLL=NO
|
||||
fi
|
||||
|
||||
|
||||
# AIX pollset.
|
||||
|
||||
nxt_feature="AIX pollset"
|
||||
nxt_feature_name=NXT_HAVE_POLLSET
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <fcntl.h>
|
||||
#include <sys/poll.h>
|
||||
#include <sys/pollset.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
pollset_t n;
|
||||
|
||||
n = pollset_create(-1);
|
||||
pollset_destroy(n);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_POLLSET=YES
|
||||
else
|
||||
NXT_HAVE_POLLSET=NO
|
||||
fi
|
||||
116
auto/feature
116
auto/feature
@@ -1,116 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
$echo -n "checking for $nxt_feature ..."
|
||||
|
||||
cat << END >> $NXT_AUTOCONF_ERR
|
||||
----------------------------------------
|
||||
checking for $nxt_feature
|
||||
END
|
||||
|
||||
|
||||
nxt_found=no
|
||||
nxt_feature_value=
|
||||
nxt_feature_inc_path=
|
||||
|
||||
if test -n "$nxt_feature_incs"; then
|
||||
case "$nxt_feature_incs" in
|
||||
-*)
|
||||
nxt_feature_inc_path="$nxt_feature_incs"
|
||||
;;
|
||||
|
||||
*)
|
||||
for nxt_temp in $nxt_feature_incs; do
|
||||
nxt_feature_inc_path="$nxt_feature_inc_path -I $nxt_temp"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
cat << END > $NXT_AUTOTEST.c
|
||||
$nxt_feature_test
|
||||
END
|
||||
|
||||
|
||||
nxt_test="$CC $CFLAGS $NXT_CFLAGS $NXT_CC_OPT $NXT_TEST_CFLAGS \
|
||||
$nxt_feature_inc_path -o $NXT_AUTOTEST $NXT_AUTOTEST.c \
|
||||
$nxt_feature_libs $NXT_LD_OPT $NXT_TEST_LIBS"
|
||||
|
||||
# /bin/sh -c "(...)" is to intercept "Killed", "Abort trap",
|
||||
# "Segmentation fault", or other shell messages.
|
||||
# "|| true" is to bypass "set -e" setting.
|
||||
|
||||
/bin/sh -c "($nxt_test || true)" >> $NXT_AUTOCONF_ERR 2>&1
|
||||
|
||||
|
||||
if [ -x $NXT_AUTOTEST ]; then
|
||||
|
||||
case "$nxt_feature_run" in
|
||||
|
||||
value)
|
||||
if /bin/sh -c "($NXT_AUTOTEST)" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
$echo >> $NXT_AUTOCONF_ERR
|
||||
nxt_found=yes
|
||||
nxt_feature_value=`$NXT_AUTOTEST`
|
||||
$echo " $nxt_feature_value"
|
||||
if [ -n "$nxt_feature_name" ]; then
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#ifndef $nxt_feature_name
|
||||
#define $nxt_feature_name $nxt_feature_value
|
||||
#endif
|
||||
|
||||
END
|
||||
fi
|
||||
else
|
||||
$echo " not found"
|
||||
fi
|
||||
;;
|
||||
|
||||
yes)
|
||||
if /bin/sh -c "($NXT_AUTOTEST)" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
$echo " found"
|
||||
nxt_found=yes
|
||||
if [ -n "$nxt_feature_name" ]; then
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#ifndef $nxt_feature_name
|
||||
#define $nxt_feature_name 1
|
||||
#endif
|
||||
|
||||
END
|
||||
fi
|
||||
else
|
||||
$echo " found but is not working"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
$echo " found"
|
||||
nxt_found=yes
|
||||
if [ -n "$nxt_feature_name" ]; then
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#ifndef $nxt_feature_name
|
||||
#define $nxt_feature_name 1
|
||||
#endif
|
||||
|
||||
END
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
$echo " not found"
|
||||
|
||||
$echo "----------" >> $NXT_AUTOCONF_ERR
|
||||
cat $NXT_AUTOTEST.c >> $NXT_AUTOCONF_ERR
|
||||
$echo "----------" >> $NXT_AUTOCONF_ERR
|
||||
$echo $nxt_test >> $NXT_AUTOCONF_ERR
|
||||
$echo "----------" >> $NXT_AUTOCONF_ERR
|
||||
fi
|
||||
|
||||
rm -rf $NXT_AUTOTEST*
|
||||
83
auto/files
83
auto/files
@@ -1,83 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Linux 2.6, FreeBSD 8.2, 9.1, Solaris 11.
|
||||
|
||||
nxt_feature="posix_fadvise()"
|
||||
nxt_feature_name=NXT_HAVE_POSIX_FADVISE
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <fcntl.h>
|
||||
|
||||
int main(void) {
|
||||
(void) posix_fadvise(0, 0, 0, POSIX_FADV_WILLNEED);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# FreeBSD 8.0.
|
||||
|
||||
nxt_feature="fcntl(F_READAHEAD)"
|
||||
nxt_feature_name=NXT_HAVE_READAHEAD
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <fcntl.h>
|
||||
|
||||
int main(void) {
|
||||
(void) fcntl(0, F_READAHEAD, 1024);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# MacOSX, FreeBSD 8.0.
|
||||
|
||||
nxt_feature="fcntl(F_RDAHEAD)"
|
||||
nxt_feature_name=NXT_HAVE_RDAHEAD
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <fcntl.h>
|
||||
|
||||
int main(void) {
|
||||
(void) fcntl(0, F_RDAHEAD, 1);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="openat2()"
|
||||
nxt_feature_name=NXT_HAVE_OPENAT2
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/openat2.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void) {
|
||||
struct open_how how;
|
||||
|
||||
memset(&how, 0, sizeof(how));
|
||||
|
||||
how.flags = O_RDONLY;
|
||||
how.mode = O_NONBLOCK;
|
||||
how.resolve = RESOLVE_IN_ROOT
|
||||
| RESOLVE_NO_SYMLINKS
|
||||
| RESOLVE_NO_XDEV;
|
||||
|
||||
int fd = syscall(SYS_openat2, AT_FDCWD, \".\",
|
||||
&how, sizeof(how));
|
||||
if (fd == -1)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
12
auto/have
12
auto/have
@@ -1,12 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#ifndef $nxt_have
|
||||
#define $nxt_have 1
|
||||
#endif
|
||||
|
||||
END
|
||||
87
auto/help
87
auto/help
@@ -1,87 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
cat << END
|
||||
|
||||
./configure options:
|
||||
|
||||
--cc=FILE set C compiler filename, default: "$CC"
|
||||
--cc-opt=OPTIONS set additional C compiler options
|
||||
--ld-opt=OPTIONS set additional linker options
|
||||
|
||||
--prefix=DIR default: "/usr/local"
|
||||
--exec-prefix=DIR default: "\$prefix"
|
||||
--bindir=DIR default: "\$exec_prefix/bin"
|
||||
--sbindir=DIR default: "\$exec_prefix/sbin"
|
||||
--includedir=DIR default: "\$prefix/include"
|
||||
--libdir=DIR default: "\$exec_prefix/lib"
|
||||
--modulesdir=DIR default: "\$libdir/unit/modules"
|
||||
--datarootdir=DIR default: "\$prefix/share"
|
||||
--mandir=DIR default: "\$datarootdir/man"
|
||||
--pkgconfigdir=DIR default: "\$datarootdir/pkgconfig"
|
||||
--localstatedir=DIR default: "\$prefix/var"
|
||||
--statedir=DIR default: "\$localstatedir/lib/unit"
|
||||
--runstatedir=DIR default: "\$localstatedir/run/unit"
|
||||
--logdir=DIR default: "\$localstatedir/log/unit"
|
||||
--tmpdir=DIR default: "/tmp"
|
||||
|
||||
--incdir=DIR [deprecated] synonym for --includedir
|
||||
--modules=DIR [deprecated] synonym for --modulesdir
|
||||
--state=DIR [deprecated] synonym for --statedir
|
||||
--tmp=DIR [deprecated] synonym for --tmpdir
|
||||
|
||||
--pid=FILE set pid filename, default: "\$runstatedir/unit.pid"
|
||||
--log=FILE set log filename, default: "\$logdir/unit.log"
|
||||
|
||||
--control=ADDRESS set address of control API socket
|
||||
default: "unix:\$runstatedir/control.unit.sock"
|
||||
|
||||
--user=USER set non-privileged processes to run as specified user
|
||||
default: "$NXT_USER"
|
||||
--group=GROUP set non-privileged processes to run as specified group
|
||||
default: user's primary group
|
||||
|
||||
--no-ipv6 disable IPv6 support
|
||||
--no-unix-sockets disable Unix domain sockets support
|
||||
--no-regex disable regular expression support
|
||||
--no-pcre2 force using PCRE library
|
||||
|
||||
--openssl enable OpenSSL library usage
|
||||
|
||||
--njs enable NJS library usage
|
||||
|
||||
--debug enable debug logging
|
||||
|
||||
|
||||
python OPTIONS configure Python module
|
||||
run "./configure python --help" to see available options
|
||||
|
||||
php OPTIONS configure PHP module
|
||||
run "./configure php --help" to see available options
|
||||
|
||||
go OPTIONS configure Go module
|
||||
run "./configure go --help" to see available options
|
||||
|
||||
perl OPTIONS configure Perl module
|
||||
run "./configure perl --help" to see available options
|
||||
|
||||
ruby OPTIONS configure Ruby module
|
||||
run "./configure ruby --help" to see available options
|
||||
|
||||
nodejs OPTIONS configure Node.js module
|
||||
run "./configure nodejs --help" to see available options
|
||||
|
||||
java OPTIONS configure Java module
|
||||
run "./configure java --help" to see available options
|
||||
|
||||
wasm OPTIONS configure WebAssembly module
|
||||
run "./configure wasm --help" to see available options
|
||||
|
||||
wasm-wasi-component OPTIONS
|
||||
configure WebAssembly Component Model module
|
||||
run "./configure wasm-wasi-component --help" to see
|
||||
available options
|
||||
|
||||
END
|
||||
200
auto/isolation
200
auto/isolation
@@ -1,200 +0,0 @@
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
# Linux clone syscall.
|
||||
|
||||
NXT_ISOLATION=NO
|
||||
NXT_HAVE_LINUX_NS=NO
|
||||
NXT_HAVE_CLONE_NEWUSER=NO
|
||||
NXT_HAVE_MOUNT=NO
|
||||
NXT_HAVE_UNMOUNT=NO
|
||||
NXT_HAVE_ROOTFS=NO
|
||||
|
||||
nsflags="USER NS PID NET UTS CGROUP"
|
||||
|
||||
nxt_feature="Linux unshare()"
|
||||
nxt_feature_name=NXT_HAVE_LINUX_NS
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <sched.h>
|
||||
|
||||
int main(void) {
|
||||
return unshare(0);
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_LINUX_NS=YES
|
||||
|
||||
# Test all isolation flags
|
||||
for flag in $nsflags; do
|
||||
nxt_feature="CLONE_NEW${flag}"
|
||||
nxt_feature_name=NXT_HAVE_CLONE_NEW${flag}
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <sys/wait.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sched.h>
|
||||
|
||||
int main(void) {
|
||||
return CLONE_NEW$flag;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
if [ $flag = "USER" ]; then
|
||||
NXT_HAVE_CLONE_NEWUSER=YES
|
||||
fi
|
||||
|
||||
if [ "$NXT_ISOLATION" = "NO" ]; then
|
||||
NXT_ISOLATION=$flag
|
||||
else
|
||||
NXT_ISOLATION="$NXT_ISOLATION $flag"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="Linux pivot_root()"
|
||||
nxt_feature_name=NXT_HAVE_LINUX_PIVOT_ROOT
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/syscall.h>
|
||||
#if !defined(__linux__)
|
||||
# error
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
return SYS_pivot_root;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="<mntent.h>"
|
||||
nxt_feature_name=NXT_HAVE_MNTENT_H
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <mntent.h>
|
||||
|
||||
int main(void) {
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="prctl(PR_SET_NO_NEW_PRIVS)"
|
||||
nxt_feature_name=NXT_HAVE_PR_SET_NO_NEW_PRIVS
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/prctl.h>
|
||||
|
||||
int main(void) {
|
||||
return PR_SET_NO_NEW_PRIVS;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="prctl(PR_SET_CHILD_SUBREAPER)"
|
||||
nxt_feature_name=NXT_HAVE_PR_SET_CHILD_SUBREAPER
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/prctl.h>
|
||||
|
||||
int main(void) {
|
||||
return PR_SET_CHILD_SUBREAPER;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="Linux mount()"
|
||||
nxt_feature_name=NXT_HAVE_LINUX_MOUNT
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/mount.h>
|
||||
|
||||
int main(void) {
|
||||
return mount(\"/\", \"/\", \"bind\",
|
||||
MS_BIND | MS_REC, \"\");
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_MOUNT=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
nxt_feature="FreeBSD nmount()"
|
||||
nxt_feature_name=NXT_HAVE_FREEBSD_NMOUNT
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/mount.h>
|
||||
|
||||
int main(void) {
|
||||
return nmount((void *)0, 0, 0);
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_MOUNT=YES
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="Linux umount2()"
|
||||
nxt_feature_name=NXT_HAVE_LINUX_UMOUNT2
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/mount.h>
|
||||
|
||||
int main(void) {
|
||||
return umount2((void *)0, 0);
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_UNMOUNT=YES
|
||||
fi
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
nxt_feature="unmount()"
|
||||
nxt_feature_name=NXT_HAVE_UNMOUNT
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/mount.h>
|
||||
|
||||
int main(void) {
|
||||
return unmount((void *)0, 0);
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_UNMOUNT=YES
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $NXT_HAVE_MOUNT = YES -a $NXT_HAVE_UNMOUNT = YES ]; then
|
||||
NXT_HAVE_ROOTFS=YES
|
||||
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#ifndef NXT_HAVE_ISOLATION_ROOTFS
|
||||
#define NXT_HAVE_ISOLATION_ROOTFS 1
|
||||
#endif
|
||||
|
||||
END
|
||||
|
||||
fi
|
||||
475
auto/make
475
auto/make
@@ -1,475 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Valentin V. Bartenev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
. auto/cc/deps
|
||||
|
||||
$echo "creating $NXT_MAKEFILE"
|
||||
|
||||
|
||||
cat << END > $NXT_MAKEFILE
|
||||
|
||||
CC = $CC
|
||||
AR = $AR
|
||||
|
||||
CFLAGS = $NXT_CFLAGS $NXT_CC_OPT $CFLAGS
|
||||
|
||||
NXT_EXEC_LINK = $NXT_EXEC_LINK $NXT_LD_OPT
|
||||
NXT_SHARED_LOCAL_LINK = $NXT_SHARED_LOCAL_LINK $NXT_LD_OPT
|
||||
NXT_MODULE_LINK = $NXT_MODULE_LINK
|
||||
|
||||
all: $NXT_DAEMON manpage
|
||||
|
||||
.PHONY: $NXT_DAEMON manpage
|
||||
$NXT_DAEMON: $NXT_BUILD_DIR/sbin/$NXT_DAEMON
|
||||
manpage: $NXT_BUILD_DIR/share/man/man8/unitd.8
|
||||
|
||||
END
|
||||
|
||||
|
||||
# The include paths list.
|
||||
|
||||
$echo -n "NXT_LIB_INCS =" >> $NXT_MAKEFILE
|
||||
|
||||
for nxt_inc in src $NXT_BUILD_DIR/include
|
||||
do
|
||||
$echo -n " -I $nxt_inc" >> $NXT_MAKEFILE
|
||||
done
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
|
||||
# Library object files list.
|
||||
|
||||
$echo "NXT_LIB_OBJS = \\" >> $NXT_MAKEFILE
|
||||
|
||||
for nxt_src in $NXT_LIB_SRCS
|
||||
do
|
||||
nxt_obj=${nxt_src%.c}.o
|
||||
$echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE
|
||||
done
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
$echo "NXT_LIB_UNIT_OBJS = \\" >> $NXT_MAKEFILE
|
||||
$echo " $NXT_BUILD_DIR/src/nxt_lvlhsh.o \\" >> $NXT_MAKEFILE
|
||||
$echo " $NXT_BUILD_DIR/src/nxt_murmur_hash.o \\" >> $NXT_MAKEFILE
|
||||
$echo " $NXT_BUILD_DIR/src/nxt_socket_msg.o \\" >> $NXT_MAKEFILE
|
||||
$echo " $NXT_BUILD_DIR/src/nxt_websocket.o \\" >> $NXT_MAKEFILE
|
||||
|
||||
for nxt_src in $NXT_LIB_UNIT_SRCS
|
||||
do
|
||||
nxt_obj=${nxt_src%.c}.o
|
||||
$echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE
|
||||
done
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
|
||||
# The version file.
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
include version
|
||||
|
||||
$NXT_VERSION_H: version
|
||||
$echo '#define NXT_VERSION "\$(NXT_VERSION)"' > $NXT_VERSION_H
|
||||
$echo '#define NXT_VERNUM \$(NXT_VERNUM)' >> $NXT_VERSION_H
|
||||
|
||||
END
|
||||
|
||||
|
||||
# Shared and static library.
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
libnxt: $NXT_BUILD_DIR/lib/$NXT_LIB_SHARED $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC
|
||||
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_SHARED: \$(NXT_LIB_OBJS)
|
||||
\$(NXT_SHARED_LOCAL_LINK) -o \$@ \$(NXT_LIB_OBJS) \\
|
||||
$NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
|
||||
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS)
|
||||
$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS)
|
||||
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC: \$(NXT_LIB_UNIT_OBJS) \\
|
||||
$NXT_BUILD_DIR/share/pkgconfig/unit.pc \\
|
||||
$NXT_BUILD_DIR/share/pkgconfig/unit-uninstalled.pc
|
||||
$NXT_STATIC_LINK \$@ \$(NXT_LIB_UNIT_OBJS)
|
||||
|
||||
END
|
||||
|
||||
|
||||
# Object files.
|
||||
|
||||
for nxt_src in $NXT_LIB_SRCS $NXT_TEST_SRCS $NXT_LIB_UNIT_SRCS \
|
||||
src/test/nxt_unit_app_test.c \
|
||||
src/test/nxt_unit_websocket_chat.c \
|
||||
src/test/nxt_unit_websocket_echo.c
|
||||
do
|
||||
nxt_obj=${nxt_src%.c}.o
|
||||
nxt_dep=${nxt_src%.c}.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) \$(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
|
||||
|
||||
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
|
||||
|
||||
|
||||
if [ $NXT_TESTS = YES ]; then
|
||||
|
||||
# Test object files list.
|
||||
|
||||
$echo "NXT_TEST_OBJS = \\" >> $NXT_MAKEFILE
|
||||
|
||||
for nxt_src in $NXT_TEST_SRCS
|
||||
do
|
||||
nxt_obj=${nxt_src%.c}.o
|
||||
$echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE
|
||||
done
|
||||
|
||||
# Test executables.
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.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
|
||||
|
||||
$NXT_BUILD_DIR/tests: \$(NXT_TEST_OBJS) \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC
|
||||
\$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/tests \\
|
||||
\$(CFLAGS) \$(NXT_TEST_OBJS) \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\
|
||||
$NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
|
||||
|
||||
$NXT_BUILD_DIR/utf8_file_name_test: $NXT_LIB_UTF8_FILE_NAME_TEST_SRCS \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC
|
||||
\$(CC) \$(CFLAGS) \$(NXT_LIB_INCS) $NXT_LIB_AUX_CFLAGS \\
|
||||
-o $NXT_BUILD_DIR/utf8_file_name_test \\
|
||||
$NXT_LIB_UTF8_FILE_NAME_TEST_SRCS \\
|
||||
$NXT_BUILD_DIR/lib/$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/lib/$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/lib/$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/lib/$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/lib/$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/lib/$NXT_LIB_UNIT_STATIC
|
||||
\$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/unit_app_test \\
|
||||
\$(CFLAGS) $NXT_BUILD_DIR/src/test/nxt_unit_app_test.o \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC \\
|
||||
$NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
|
||||
|
||||
$NXT_BUILD_DIR/unit_websocket_chat: \\
|
||||
$NXT_BUILD_DIR/src/test/nxt_unit_websocket_chat.o \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC
|
||||
\$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/unit_websocket_chat \\
|
||||
\$(CFLAGS) $NXT_BUILD_DIR/src/test/nxt_unit_websocket_chat.o \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC \\
|
||||
$NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
|
||||
|
||||
$NXT_BUILD_DIR/unit_websocket_echo: \\
|
||||
$NXT_BUILD_DIR/src/test/nxt_unit_websocket_echo.o \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC
|
||||
\$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/unit_websocket_echo \\
|
||||
\$(CFLAGS) $NXT_BUILD_DIR/src/test/nxt_unit_websocket_echo.o \\
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC \\
|
||||
$NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
|
||||
|
||||
END
|
||||
|
||||
else
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: tests
|
||||
tests:
|
||||
@(echo; \\
|
||||
echo "error: to make tests you need to configure --tests option."; \\
|
||||
echo; \\
|
||||
exit 1)
|
||||
|
||||
END
|
||||
|
||||
fi
|
||||
|
||||
|
||||
NXT_MAKE_INCS="src $NXT_BUILD_DIR/include"
|
||||
NXT_MAKE_SRCS="$NXT_SRCS"
|
||||
|
||||
|
||||
# The include paths list.
|
||||
|
||||
$echo -n "NXT_INCS =" >> $NXT_MAKEFILE
|
||||
|
||||
for nxt_inc in $NXT_MAKE_INCS
|
||||
do
|
||||
$echo -n " -I $nxt_inc" >> $NXT_MAKEFILE
|
||||
done
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
|
||||
# Object files list.
|
||||
|
||||
$echo "NXT_OBJS = \\" >> $NXT_MAKEFILE
|
||||
|
||||
for nxt_src in $NXT_MAKE_SRCS
|
||||
do
|
||||
nxt_obj=${nxt_src%.c}.o
|
||||
$echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE
|
||||
done
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
|
||||
# unit executable.
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/sbin/$NXT_DAEMON: $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\
|
||||
\$(NXT_OBJS)
|
||||
\$(NXT_EXEC_LINK) -o \$@ \$(CFLAGS) \\
|
||||
\$(NXT_OBJS) $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\
|
||||
$NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
|
||||
|
||||
END
|
||||
|
||||
|
||||
# unitd man page
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/share/man/man8/unitd.8: docs/man/man8/unitd.8.in \\
|
||||
$NXT_BUILD_DIR/include/nxt_auto_config.h
|
||||
sed -e "s|%%ERROR_LOG_PATH%%|$NXT_LOG|" \\
|
||||
-e "s|%%PID_PATH%%|$NXT_PID|" \\
|
||||
-e "s|%%SOCKET_PATH%%|$NXT_CONTROL|" \\
|
||||
< docs/man/man8/unitd.8.in > \$@
|
||||
|
||||
END
|
||||
|
||||
|
||||
# unit object files.
|
||||
|
||||
for nxt_src in $NXT_MAKE_SRCS
|
||||
do
|
||||
nxt_obj=${nxt_src%.c}.o
|
||||
nxt_dep=${nxt_src%.c}.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) \$(NXT_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
|
||||
|
||||
done
|
||||
|
||||
|
||||
# install
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: install ${NXT_DAEMON}-install install-check manpage-install
|
||||
|
||||
install: ${NXT_DAEMON}-install manpage-install
|
||||
|
||||
install-check:
|
||||
@test -n "\$(DESTDIR)$NXT_PREFIX" \\
|
||||
|| (echo; \\
|
||||
echo "error: to make install you need either"; \\
|
||||
echo " to configure --prefix option"; \\
|
||||
echo " or to set DESTDIR environment variable."; \\
|
||||
echo; \\
|
||||
exit 1)
|
||||
|
||||
${NXT_DAEMON}-install: $NXT_DAEMON install-check
|
||||
test -d \$(DESTDIR)$NXT_SBINDIR \
|
||||
|| install -d \$(DESTDIR)$NXT_SBINDIR
|
||||
install -p $NXT_BUILD_DIR/sbin/$NXT_DAEMON \$(DESTDIR)$NXT_SBINDIR/
|
||||
test -d \$(DESTDIR)$NXT_STATEDIR \
|
||||
|| install -d \$(DESTDIR)$NXT_STATEDIR
|
||||
test -d \$(DESTDIR)$NXT_LOGDIR \
|
||||
|| install -d \$(DESTDIR)$NXT_LOGDIR
|
||||
test -d \$(DESTDIR)$NXT_RUNSTATEDIR \
|
||||
|| install -d \$(DESTDIR)$NXT_RUNSTATEDIR
|
||||
|
||||
manpage-install: manpage install-check
|
||||
test -d \$(DESTDIR)$NXT_MANDIR/man8 \
|
||||
|| install -d \$(DESTDIR)$NXT_MANDIR/man8
|
||||
install -p -m644 $NXT_BUILD_DIR/share/man/man8/unitd.8 \
|
||||
\$(DESTDIR)$NXT_MANDIR/man8/
|
||||
|
||||
.PHONY: uninstall ${NXT_DAEMON}-uninstall manpage-uninstall
|
||||
|
||||
uninstall: ${NXT_DAEMON}-uninstall manpage-uninstall
|
||||
|
||||
${NXT_DAEMON}-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_SBINDIR/$NXT_DAEMON
|
||||
@rmdir -p \$(DESTDIR)$NXT_SBINDIR 2>/dev/null || true
|
||||
|
||||
manpage-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_MANDIR/man8/unitd.8
|
||||
@rmdir -p \$(DESTDIR)$NXT_MANDIR/man8 2>/dev/null || true
|
||||
|
||||
END
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: libunit-install libunit-uninstall
|
||||
|
||||
libunit-install: $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC
|
||||
test -d \$(DESTDIR)$NXT_LIBDIR \
|
||||
|| install -d \$(DESTDIR)$NXT_LIBDIR
|
||||
install -p -m u=rw,go=r $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC \
|
||||
\$(DESTDIR)$NXT_LIBDIR/
|
||||
test -d \$(DESTDIR)$NXT_PKGCONFIGDIR \
|
||||
|| install -d \$(DESTDIR)$NXT_PKGCONFIGDIR
|
||||
install -p -m u=rw,go=r $NXT_BUILD_DIR/share/pkgconfig/unit.pc \
|
||||
\$(DESTDIR)$NXT_PKGCONFIGDIR/
|
||||
test -d \$(DESTDIR)$NXT_INCLUDEDIR \
|
||||
|| install -d \$(DESTDIR)$NXT_INCLUDEDIR
|
||||
install -p -m u=rw,go=r src/nxt_unit.h \
|
||||
src/nxt_unit_field.h \
|
||||
src/nxt_unit_request.h \
|
||||
src/nxt_unit_response.h \
|
||||
src/nxt_unit_sptr.h \
|
||||
src/nxt_unit_typedefs.h \
|
||||
src/nxt_unit_websocket.h \
|
||||
$NXT_BUILD_DIR/include/nxt_auto_config.h \
|
||||
$NXT_BUILD_DIR/include/nxt_version.h \
|
||||
src/nxt_websocket_header.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/
|
||||
|
||||
libunit-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_LIBDIR/$NXT_LIB_UNIT_STATIC
|
||||
@rmdir -p \$(DESTDIR)$NXT_LIBDIR 2>/dev/null || true
|
||||
rm -f \$(DESTDIR)$NXT_PKGCONFIGDIR/unit.pc
|
||||
@rmdir -p \$(DESTDIR)$NXT_PKGCONFIGDIR 2>/dev/null || true
|
||||
rm -f \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_field.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_request.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_response.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_sptr.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_typedefs.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_websocket.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_auto_config.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_version.h \
|
||||
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_websocket_header.h
|
||||
@rmdir -p \$(DESTDIR)$NXT_INCLUDEDIR 2>/dev/null || true
|
||||
|
||||
END
|
||||
|
||||
# pkg-config files
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/share/pkgconfig/unit.pc: src/unit.pc.in
|
||||
sed -e "s|@PREFIX@|$NXT_PREFIX|" \\
|
||||
-e "s|@LIBDIR@|$NXT_LIBDIR|" \\
|
||||
-e "s|@CFLAGS@|-I$NXT_INCLUDEDIR|" \\
|
||||
-e "s|@VERSION@|\$(NXT_VERSION)|" \\
|
||||
-e "s|@EXTRA_LIBS@|$NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS|" \\
|
||||
-e "s|@CONFARGS@|$(echo $NXT_CONFIGURE_OPTIONS | sed -e 's| -pie||' -e 's| --njs||')|" \\
|
||||
-e "s|@MODULESDIR@|$NXT_MODULESDIR|" \\
|
||||
< src/unit.pc.in > \$@
|
||||
|
||||
$NXT_BUILD_DIR/share/pkgconfig/unit-uninstalled.pc: src/unit.pc.in
|
||||
sed -e "s|@PREFIX@|$(pwd)/$NXT_BUILD_DIR|" \\
|
||||
-e "s|@LIBDIR@|$(pwd)/$NXT_BUILD_DIR/lib|" \\
|
||||
-e "s|@CFLAGS@|-I$(pwd)/src -I$(pwd)$NXT_BUILD_DIR/include|" \\
|
||||
-e "s|@VERSION@|\$(NXT_VERSION)|" \\
|
||||
-e "s|@EXTRA_LIBS@|$NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS|" \\
|
||||
-e "s|@CONFARGS@|$(echo $NXT_CONFIGURE_OPTIONS | sed -e 's| -pie||' -e 's| --njs||')|" \\
|
||||
< src/unit.pc.in > \$@
|
||||
|
||||
END
|
||||
|
||||
# Makefile.
|
||||
# *.dSYM is MacOSX Clang debug information.
|
||||
|
||||
cat << END > Makefile
|
||||
|
||||
include $NXT_MAKEFILE
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $NXT_BUILD_DIR *.dSYM Makefile
|
||||
|
||||
END
|
||||
175
auto/malloc
175
auto/malloc
@@ -1,175 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Linux glibc 2.1.91, FreeBSD 7.0, Solaris 11,
|
||||
# MacOSX 10.6 (Snow Leopard), NetBSD 5.0.
|
||||
|
||||
nxt_feature="posix_memalign()"
|
||||
nxt_feature_name=NXT_HAVE_POSIX_MEMALIGN
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
void *p;
|
||||
|
||||
if (posix_memalign(&p, 4096, 4096) != 0)
|
||||
return 1;
|
||||
|
||||
free(p);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Solaris, HP-UX.
|
||||
|
||||
nxt_feature="memalign()"
|
||||
nxt_feature_name=NXT_HAVE_MEMALIGN
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
void *p;
|
||||
|
||||
p = memalign(4096, 4096);
|
||||
if (p == NULL)
|
||||
return 1;
|
||||
|
||||
free(p);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# Linux malloc_usable_size().
|
||||
|
||||
nxt_feature="Linux malloc_usable_size()"
|
||||
nxt_feature_name=NXT_HAVE_MALLOC_USABLE_SIZE
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <malloc.h>
|
||||
|
||||
int main(void) {
|
||||
void *p;
|
||||
|
||||
p = malloc(4096);
|
||||
if (malloc_usable_size(p) < 4096)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# FreeBSD malloc_usable_size().
|
||||
|
||||
nxt_feature="FreeBSD malloc_usable_size()"
|
||||
nxt_feature_name=NXT_HAVE_MALLOC_USABLE_SIZE
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <malloc_np.h>
|
||||
|
||||
int main(void) {
|
||||
void *p;
|
||||
|
||||
p = malloc(4096);
|
||||
if (malloc_usable_size(p) < 4096)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# MacOSX malloc_good_size().
|
||||
|
||||
nxt_feature="MacOSX malloc_good_size()"
|
||||
nxt_feature_name=NXT_HAVE_MALLOC_GOOD_SIZE
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <malloc/malloc.h>
|
||||
|
||||
int main(void) {
|
||||
if (malloc_good_size(4096) < 4096)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# alloca().
|
||||
|
||||
# Linux, FreeBSD, MacOSX.
|
||||
|
||||
nxt_feature="alloca()"
|
||||
nxt_feature_name=NXT_HAVE_ALLOCA
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
void *p;
|
||||
|
||||
p = alloca(256);
|
||||
if (p == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Linux, Solaris, MacOSX.
|
||||
|
||||
nxt_feature="alloca() in alloca.h"
|
||||
nxt_feature_name=NXT_HAVE_ALLOCA_H
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <alloca.h>
|
||||
|
||||
int main(void) {
|
||||
void *p;
|
||||
|
||||
p = alloca(256);
|
||||
if (p == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# Linux mallopt().
|
||||
|
||||
nxt_feature="Linux mallopt()"
|
||||
nxt_feature_name=NXT_HAVE_MALLOPT
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <malloc.h>
|
||||
|
||||
int main(void) {
|
||||
mallopt(M_PERTURB, 0x55);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
87
auto/mmap
87
auto/mmap
@@ -1,87 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Linux, FreeBSD, Solaris, MacOSX.
|
||||
|
||||
nxt_feature="MAP_ANON"
|
||||
nxt_feature_name=NXT_HAVE_MAP_ANON
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int main(void) {
|
||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANON, -1, 0)
|
||||
== MAP_FAILED)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Linux, Solaris, HP-UX.
|
||||
|
||||
nxt_feature="MAP_ANONYMOUS"
|
||||
nxt_feature_name=NXT_HAVE_MAP_ANONYMOUS
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int main(void) {
|
||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)
|
||||
== MAP_FAILED)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# Linux.
|
||||
|
||||
nxt_feature="MAP_POPULATE"
|
||||
nxt_feature_name=NXT_HAVE_MAP_POPULATE
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int main(void) {
|
||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED | MAP_POPULATE, -1, 0)
|
||||
== MAP_FAILED)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# FreeBSD.
|
||||
|
||||
nxt_feature="MAP_PREFAULT_READ"
|
||||
nxt_feature_name=NXT_HAVE_MAP_PREFAULT_READ
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int main(void) {
|
||||
if (mmap(NULL, 4096, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANON | MAP_PREFAULT_READ,
|
||||
-1, 0)
|
||||
== MAP_FAILED)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
@@ -1,51 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
case "$nxt_module" in
|
||||
|
||||
python)
|
||||
. auto/modules/python
|
||||
;;
|
||||
|
||||
php)
|
||||
. auto/modules/php
|
||||
;;
|
||||
|
||||
go)
|
||||
. auto/modules/go
|
||||
;;
|
||||
|
||||
perl)
|
||||
. auto/modules/perl
|
||||
;;
|
||||
|
||||
ruby)
|
||||
. auto/modules/ruby
|
||||
;;
|
||||
|
||||
nodejs)
|
||||
. auto/modules/nodejs
|
||||
;;
|
||||
|
||||
java)
|
||||
. auto/modules/java
|
||||
;;
|
||||
|
||||
wasm)
|
||||
. auto/modules/wasm
|
||||
;;
|
||||
|
||||
wasm-wasi-component)
|
||||
. auto/modules/wasm-wasi-component
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
141
auto/modules/go
141
auto/modules/go
@@ -1,141 +0,0 @@
|
||||
|
||||
# Copyright (C) Max Romanov
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
shift
|
||||
|
||||
NXT_GO=go
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
--go=*) NXT_GO="$value" ;;
|
||||
--go-path=*) NXT_GO_PATH="$value" ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--go=NAME set go executable
|
||||
--go-path=PATH set GOPATH variable to install package
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid Go option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
|
||||
$echo "configuring Go package"
|
||||
$echo "configuring Go package ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
$echo -n "checking for Go ..."
|
||||
$echo "checking for Go ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
|
||||
if /bin/sh -c "${NXT_GO} version" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
$echo " found"
|
||||
|
||||
NXT_GO_VERSION="`${NXT_GO} version`"
|
||||
$echo " + ${NXT_GO_VERSION}"
|
||||
|
||||
else
|
||||
$echo
|
||||
$echo $0: error: no Go found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
NXT_GO_PATH=${NXT_GO_PATH=`${NXT_GO} env GOPATH`}
|
||||
NXT_GO_PATH=${NXT_GO_PATH:-${PWD}/${NXT_BUILD_DIR}/${NXT_GO}}
|
||||
|
||||
NXT_GO_PKG=unit.nginx.org/go
|
||||
|
||||
$echo " + Go package path: \"${NXT_GO_PATH}\""
|
||||
|
||||
if grep ^$NXT_GO: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_GO\" package configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
NXT_GO_LDFLAGS=
|
||||
|
||||
for o in ${CFLAGS} ${NXT_CC_OPT}; do
|
||||
case "$o" in
|
||||
-fsanitize* | -L* | -l*) NXT_GO_LDFLAGS="${NXT_GO_LDFLAGS} $o" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_GO}
|
||||
.PHONY: ${NXT_GO}-install
|
||||
.PHONY: ${NXT_GO}-install-src
|
||||
.PHONY: ${NXT_GO}-uninstall
|
||||
|
||||
GOPATH = $NXT_GO_PATH
|
||||
GOOS = `${NXT_GO} env GOOS`
|
||||
GOARCH = `${NXT_GO} env GOARCH`
|
||||
|
||||
NXT_GO_DST = ${NXT_GO_PATH%%:*}
|
||||
|
||||
install: ${NXT_GO}-install
|
||||
|
||||
${NXT_GO}:
|
||||
|
||||
${NXT_GO}-install: ${NXT_GO}-install-src ${NXT_GO}-install-env
|
||||
cd \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG} && \
|
||||
GOPATH=\$(DESTDIR)\$(GOPATH) ${NXT_GO} build ${NXT_GO_PKG}
|
||||
|
||||
${NXT_GO}-install-src:
|
||||
install -d \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}
|
||||
install -p -m644 ./go/* \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}/
|
||||
|
||||
${NXT_GO}-install-env: \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}/env.go \
|
||||
${NXT_VERSION_H} ${NXT_BUILD_DIR}/lib/${NXT_LIB_UNIT_STATIC}
|
||||
|
||||
\$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}/env.go:
|
||||
install -d \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}
|
||||
$echo "package unit" > \$@
|
||||
$echo "/*" >> \$@
|
||||
$echo "#cgo CFLAGS: ${CFLAGS} ${NXT_CC_OPT}" >> \$@
|
||||
$echo "#cgo CPPFLAGS: -I${PWD}/src -I${PWD}/${NXT_BUILD_DIR}/include" >> \$@
|
||||
$echo "#cgo LDFLAGS: -L${PWD}/${NXT_BUILD_DIR}/lib ${NXT_GO_LDFLAGS} ${NXT_LD_OPT}" >> \$@
|
||||
$echo "*/" >> \$@
|
||||
$echo 'import "C"' >> \$@
|
||||
|
||||
|
||||
uninstall: ${NXT_GO}-uninstall
|
||||
|
||||
${NXT_GO}-uninstall:
|
||||
rm -rf \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}
|
||||
rm -rf \$(DESTDIR)\$(NXT_GO_DST)/pkg/\$(GOOS)_\$(GOARCH)/${NXT_GO_PKG}
|
||||
|
||||
END
|
||||
@@ -1,641 +0,0 @@
|
||||
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
shift
|
||||
|
||||
NXT_JAVA_HOME=${JAVA_HOME-}
|
||||
NXT_JAR_REPO=https://repo1.maven.org/maven2/
|
||||
NXT_JAR_LOCAL_REPO=$HOME/.m2/repository/
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
|
||||
--module=*) NXT_JAVA_MODULE="$value" ;;
|
||||
--home=*) NXT_JAVA_HOME="$value" ;;
|
||||
--lib-path=*) NXT_JAVA_LIB_PATH="$value" ;;
|
||||
--repo=*) NXT_JAR_REPO="$value" ;;
|
||||
--local-repo=*) NXT_JAR_LOCAL_REPO="$value" ;;
|
||||
--sha512=*) NXT_SHA512_TOOL="$value" ;;
|
||||
--jars=*) NXT_JARS="$value" ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--module=NAME set unit Java module name
|
||||
--home=DIR set Java home directory
|
||||
--lib-path=DIRECTORY set directory path to libjvm.so library
|
||||
--repo=URL set Maven remote repository URL
|
||||
default: "$NXT_JAR_REPO"
|
||||
--local-repo=DIR set local repository directory
|
||||
default: "$NXT_JAR_LOCAL_REPO"
|
||||
--sha512=SHA512 set command for SHA512 check
|
||||
--jars=DIR set jars install/search directory
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid Java option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
|
||||
NXT_JARS=${NXT_JARS=$NXT_MODULESDIR}
|
||||
NXT_JAVA_MODULE=${NXT_JAVA_MODULE=java}
|
||||
NXT_JAVA_LIB_PATH=${NXT_JAVA_LIB_PATH=}
|
||||
|
||||
$echo "configuring Java module"
|
||||
$echo "configuring Java module ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if [ -n "${NXT_JAVA_HOME}" ]; then
|
||||
$echo "using java.home ${NXT_JAVA_HOME}"
|
||||
$echo "using java.home ${NXT_JAVA_HOME}" >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if [ ! -d "${NXT_JAVA_HOME}" ]; then
|
||||
$echo
|
||||
$echo $0: error: Java home directory not found.
|
||||
$echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NXT_JAVA="${NXT_JAVA_HOME}/bin/java"
|
||||
|
||||
else
|
||||
$echo -n "checking for java executable ..."
|
||||
$echo "checking for java executable ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
NXT_JAVA=`which java || :`
|
||||
if [ -z "$NXT_JAVA" -o ! -x "$NXT_JAVA" ]; then
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: java executable not found.
|
||||
$echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$echo " found $NXT_JAVA"
|
||||
$echo "found $NXT_JAVA" >> $NXT_AUTOCONF_ERR
|
||||
|
||||
"$NXT_JAVA" -version
|
||||
|
||||
$echo -n "checking java.home ..."
|
||||
$echo "checking java.home ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
NXT_JAVA_HOME=`$NXT_JAVA -XshowSettings 2>&1 | grep -F -e java.home | sed -e 's/^.*= //'`
|
||||
if [ -z "$NXT_JAVA_HOME" ]; then
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: java.home not found.
|
||||
$echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$echo " $NXT_JAVA_HOME"
|
||||
$echo "got java.home $NXT_JAVA_HOME" >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if [ ! -x "${NXT_JAVA_HOME}/bin/javac" ]; then
|
||||
NXT_JAVA_HOME_=${NXT_JAVA_HOME%/jre}
|
||||
if [ -x "${NXT_JAVA_HOME_}/bin/javac" ]; then
|
||||
$echo "adjust java.home $NXT_JAVA_HOME_"
|
||||
$echo "adjust java.home $NXT_JAVA_HOME_" >> $NXT_AUTOCONF_ERR
|
||||
|
||||
NXT_JAVA_HOME="$NXT_JAVA_HOME_"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
NXT_JAVAC="${NXT_JAVA_HOME}/bin/javac"
|
||||
|
||||
if [ ! -x "$NXT_JAVAC" ]; then
|
||||
$echo
|
||||
$echo $0: error: javac not found.
|
||||
$echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NXT_JAVA_INCLUDE="-I${NXT_JAVA_HOME}/include"
|
||||
|
||||
case "$NXT_SYSTEM" in
|
||||
Linux)
|
||||
NXT_JAVA_INCLUDE="${NXT_JAVA_INCLUDE} -I${NXT_JAVA_HOME}/include/linux"
|
||||
;;
|
||||
Darwin)
|
||||
NXT_JAVA_INCLUDE="${NXT_JAVA_INCLUDE} -I${NXT_JAVA_HOME}/include/darwin"
|
||||
;;
|
||||
FreeBSD)
|
||||
NXT_JAVA_INCLUDE="${NXT_JAVA_INCLUDE} -I${NXT_JAVA_HOME}/include/freebsd"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NXT_JAVA_LIB_PATH" ]; then
|
||||
$echo -n "checking library path ..."
|
||||
$echo "checking library path ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if [ ! -x "$NXT_JAVA" ]; then
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: java executable not found.
|
||||
$echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NXT_JAVA_LIB_PATH=`$NXT_JAVA -XshowSettings 2>&1 | grep -F -e sun.boot.library.path | sed -e 's/^.*= //'`
|
||||
|
||||
if [ -z "$NXT_JAVA_LIB_PATH" ]; then
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: library path not found.
|
||||
$echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$echo " $NXT_JAVA_LIB_PATH"
|
||||
$echo "got library path $NXT_JAVA_LIB_PATH" >> $NXT_AUTOCONF_ERR
|
||||
fi
|
||||
|
||||
NXT_JAVA_LIB_SERVER_PATH="${NXT_JAVA_LIB_PATH}/server"
|
||||
|
||||
NXT_JAVA_LDFLAGS="-L${NXT_JAVA_LIB_SERVER_PATH} -Wl,-rpath,${NXT_JAVA_LIB_SERVER_PATH} -ljvm"
|
||||
|
||||
|
||||
nxt_found=no
|
||||
|
||||
nxt_feature="JNI"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="${NXT_JAVA_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_JAVA_LDFLAGS}"
|
||||
nxt_feature_test="
|
||||
#include <jni.h>
|
||||
|
||||
int main(void) {
|
||||
JNI_CreateJavaVM(NULL, NULL, NULL);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no JNI found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
NXT_JAVA_VERSION=`$NXT_JAVAC -version 2>&1`
|
||||
NXT_JAVA_VERSION=${NXT_JAVA_VERSION#javac }
|
||||
NXT_JAVA_INCLUDE="$NXT_JAVA_INCLUDE -I$NXT_BUILD_DIR/$NXT_JAVA_MODULE -DNXT_JAVA_VERSION=$NXT_JAVA_VERSION"
|
||||
|
||||
if grep ^$NXT_JAVA_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_JAVA_MODULE\" module configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
. ./version
|
||||
|
||||
NXT_UNIT_JAR=nginx-unit-jsc-${NXT_JAVA_MODULE}-$NXT_VERSION.jar
|
||||
NXT_WS_API_JAR=websocket-api-${NXT_JAVA_MODULE}-$NXT_VERSION.jar
|
||||
|
||||
NXT_JAVA_BUILD_CP=$NXT_BUILD_DIR/$NXT_JAVA_MODULE
|
||||
NXT_JAVA_INSTALL_JARS=
|
||||
NXT_JAVA_UNINSTALL_JARS=
|
||||
|
||||
NXT_JAVA_JARS=$NXT_BUILD_DIR/$NXT_JAVA_MODULE/nxt_jars.h
|
||||
mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE
|
||||
|
||||
cat << END > $NXT_JAVA_JARS
|
||||
#ifndef _NXT_JAVA_JARS_INCLUDED_
|
||||
#define _NXT_JAVA_JARS_INCLUDED_
|
||||
|
||||
#define NXT_JARS "$NXT_JARS"
|
||||
|
||||
static const char *nxt_java_system_jars[] = {
|
||||
END
|
||||
|
||||
NXT_TOMCAT_VERSION=9.0.86
|
||||
|
||||
NXT_JAR_VERSION=$NXT_TOMCAT_VERSION
|
||||
|
||||
NXT_JAR_NAME=tomcat-servlet-api
|
||||
NXT_JAR_NAMESPACE=org/apache/tomcat/
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-el-api
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-jsp-api
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-jasper
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-jasper-el
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-juli
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-api
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-util-scan
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=tomcat-util
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=ecj
|
||||
NXT_JAR_VERSION=3.26.0
|
||||
NXT_JAR_NAMESPACE=org/eclipse/jdt/
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
cat << END >> $NXT_JAVA_JARS
|
||||
"$NXT_WS_API_JAR",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *nxt_java_unit_jars[] = {
|
||||
"$NXT_UNIT_JAR",
|
||||
END
|
||||
|
||||
NXT_JAR_VERSION=9.4.54.v20240208
|
||||
NXT_JAR_NAMESPACE=org/eclipse/jetty/
|
||||
|
||||
NXT_JAR_NAME=jetty-util
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=jetty-server
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=jetty-http
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
NXT_JAR_NAME=classgraph
|
||||
NXT_JAR_VERSION=4.8.165
|
||||
NXT_JAR_NAMESPACE=io/github/classgraph/
|
||||
. auto/modules/java_get_jar
|
||||
|
||||
cat << END >> $NXT_JAVA_JARS
|
||||
NULL
|
||||
};
|
||||
|
||||
#endif /* _NXT_JAVA_JARS_INCLUDED_ */
|
||||
END
|
||||
|
||||
NXT_JAVA_LIBJVM="$NXT_JAVA_LIB_SERVER_PATH/libjvm.so"
|
||||
|
||||
if [ "$NXT_SYSTEM" = "Darwin" ]; then
|
||||
NXT_JAVA_LIBC_DIR="/usr/lib"
|
||||
else
|
||||
NXT_JAVA_LIBC_DIR=`ldd "$NXT_JAVA_LIBJVM" | grep -F libc. | cut -d' ' -f3`
|
||||
NXT_JAVA_LIBC_DIR=`dirname $NXT_JAVA_LIBC_DIR`
|
||||
fi
|
||||
|
||||
|
||||
NXT_JAVA_MOUNTS_HEADER=nxt_${NXT_JAVA_MODULE}_mounts.h
|
||||
|
||||
cat << END > $NXT_BUILD_DIR/include/$NXT_JAVA_MOUNTS_HEADER
|
||||
#ifndef _NXT_JAVA_MOUNTS_H_INCLUDED_
|
||||
#define _NXT_JAVA_MOUNTS_H_INCLUDED_
|
||||
|
||||
|
||||
static const nxt_fs_mount_t nxt_java_mounts[] = {
|
||||
{(u_char *) "$NXT_JAVA_LIBC_DIR", (u_char *) "$NXT_JAVA_LIBC_DIR",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
{(u_char *) "$NXT_JAVA_HOME", (u_char *) "$NXT_JAVA_HOME",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
};
|
||||
|
||||
|
||||
#endif /* _NXT_JAVA_MOUNTS_H_INCLUDED_ */
|
||||
END
|
||||
|
||||
$echo " + Java module: ${NXT_JAVA_MODULE}.unit.so"
|
||||
|
||||
. auto/cc/deps
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
NXT_JAVA_MODULE_SRCS=" \
|
||||
src/nxt_java.c \
|
||||
src/java/nxt_jni.c \
|
||||
src/java/nxt_jni_Context.c \
|
||||
src/java/nxt_jni_HeaderNamesEnumeration.c \
|
||||
src/java/nxt_jni_HeadersEnumeration.c \
|
||||
src/java/nxt_jni_InputStream.c \
|
||||
src/java/nxt_jni_OutputStream.c \
|
||||
src/java/nxt_jni_Request.c \
|
||||
src/java/nxt_jni_Response.c \
|
||||
src/java/nxt_jni_Thread.c \
|
||||
src/java/nxt_jni_URLClassLoader.c \
|
||||
"
|
||||
|
||||
# The Java module object files.
|
||||
|
||||
nxt_objs=$NXT_BUILD_DIR/src/nxt_unit.o
|
||||
|
||||
for nxt_src in $NXT_JAVA_MODULE_SRCS; do
|
||||
|
||||
nxt_obj=${nxt_src%.c}-$NXT_JAVA_MODULE.o
|
||||
nxt_dep=${nxt_src%.c}-$NXT_JAVA_MODULE.dep
|
||||
nxt_dep_flags=`nxt_gen_dep_flags`
|
||||
nxt_dep_post=`nxt_gen_dep_post`
|
||||
nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj"
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
|
||||
mkdir -p $NXT_BUILD_DIR/src/java
|
||||
\$(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
|
||||
|
||||
-include $NXT_BUILD_DIR/$nxt_dep
|
||||
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
NXT_JAVA_SRCS=" \
|
||||
src/java/nginx/unit/Context.java \
|
||||
src/java/nginx/unit/DynamicDispatcherRequest.java \
|
||||
src/java/nginx/unit/DynamicPathRequest.java \
|
||||
src/java/nginx/unit/ForwardRequestWrapper.java \
|
||||
src/java/nginx/unit/HeaderNamesEnumeration.java \
|
||||
src/java/nginx/unit/HeadersEnumeration.java \
|
||||
src/java/nginx/unit/IncludeRequestWrapper.java \
|
||||
src/java/nginx/unit/IncludeResponseWrapper.java \
|
||||
src/java/nginx/unit/InitParams.java \
|
||||
src/java/nginx/unit/InputStream.java \
|
||||
src/java/nginx/unit/JspPropertyGroup.java \
|
||||
src/java/nginx/unit/OutputStream.java \
|
||||
src/java/nginx/unit/Request.java \
|
||||
src/java/nginx/unit/RequestAttrProxy.java \
|
||||
src/java/nginx/unit/Response.java \
|
||||
src/java/nginx/unit/Session.java \
|
||||
src/java/nginx/unit/SessionAttrProxy.java \
|
||||
src/java/nginx/unit/Taglib.java \
|
||||
src/java/nginx/unit/UnitSessionCookieConfig.java \
|
||||
src/java/nginx/unit/websocket/AsyncChannelGroupUtil.java \
|
||||
src/java/nginx/unit/websocket/AsyncChannelWrapper.java \
|
||||
src/java/nginx/unit/websocket/AsyncChannelWrapperNonSecure.java \
|
||||
src/java/nginx/unit/websocket/AsyncChannelWrapperSecure.java \
|
||||
src/java/nginx/unit/websocket/AuthenticationException.java \
|
||||
src/java/nginx/unit/websocket/Authenticator.java \
|
||||
src/java/nginx/unit/websocket/AuthenticatorFactory.java \
|
||||
src/java/nginx/unit/websocket/BackgroundProcess.java \
|
||||
src/java/nginx/unit/websocket/BackgroundProcessManager.java \
|
||||
src/java/nginx/unit/websocket/BasicAuthenticator.java \
|
||||
src/java/nginx/unit/websocket/Constants.java \
|
||||
src/java/nginx/unit/websocket/DecoderEntry.java \
|
||||
src/java/nginx/unit/websocket/DigestAuthenticator.java \
|
||||
src/java/nginx/unit/websocket/FutureToSendHandler.java \
|
||||
src/java/nginx/unit/websocket/MessageHandlerResult.java \
|
||||
src/java/nginx/unit/websocket/MessageHandlerResultType.java \
|
||||
src/java/nginx/unit/websocket/MessagePart.java \
|
||||
src/java/nginx/unit/websocket/PerMessageDeflate.java \
|
||||
src/java/nginx/unit/websocket/ReadBufferOverflowException.java \
|
||||
src/java/nginx/unit/websocket/Transformation.java \
|
||||
src/java/nginx/unit/websocket/TransformationFactory.java \
|
||||
src/java/nginx/unit/websocket/TransformationResult.java \
|
||||
src/java/nginx/unit/websocket/Util.java \
|
||||
src/java/nginx/unit/websocket/WrappedMessageHandler.java \
|
||||
src/java/nginx/unit/websocket/WsContainerProvider.java \
|
||||
src/java/nginx/unit/websocket/WsExtension.java \
|
||||
src/java/nginx/unit/websocket/WsExtensionParameter.java \
|
||||
src/java/nginx/unit/websocket/WsFrameBase.java \
|
||||
src/java/nginx/unit/websocket/WsFrameClient.java \
|
||||
src/java/nginx/unit/websocket/WsHandshakeResponse.java \
|
||||
src/java/nginx/unit/websocket/WsIOException.java \
|
||||
src/java/nginx/unit/websocket/WsPongMessage.java \
|
||||
src/java/nginx/unit/websocket/WsRemoteEndpointAsync.java \
|
||||
src/java/nginx/unit/websocket/WsRemoteEndpointBase.java \
|
||||
src/java/nginx/unit/websocket/WsRemoteEndpointBasic.java \
|
||||
src/java/nginx/unit/websocket/WsRemoteEndpointImplBase.java \
|
||||
src/java/nginx/unit/websocket/WsRemoteEndpointImplClient.java \
|
||||
src/java/nginx/unit/websocket/WsSession.java \
|
||||
src/java/nginx/unit/websocket/WsWebSocketContainer.java \
|
||||
src/java/nginx/unit/websocket/pojo/Constants.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoEndpointBase.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoEndpointClient.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoEndpointServer.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerBase.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialBase.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialBinary.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialText.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeBase.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeBinary.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholePong.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeText.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoMethodMapping.java \
|
||||
src/java/nginx/unit/websocket/pojo/PojoPathParam.java \
|
||||
src/java/nginx/unit/websocket/pojo/package-info.java \
|
||||
src/java/nginx/unit/websocket/server/Constants.java \
|
||||
src/java/nginx/unit/websocket/server/DefaultServerEndpointConfigurator.java \
|
||||
src/java/nginx/unit/websocket/server/UpgradeUtil.java \
|
||||
src/java/nginx/unit/websocket/server/UriTemplate.java \
|
||||
src/java/nginx/unit/websocket/server/WsContextListener.java \
|
||||
src/java/nginx/unit/websocket/server/WsFilter.java \
|
||||
src/java/nginx/unit/websocket/server/WsHandshakeRequest.java \
|
||||
src/java/nginx/unit/websocket/server/WsHttpUpgradeHandler.java \
|
||||
src/java/nginx/unit/websocket/server/WsMappingResult.java \
|
||||
src/java/nginx/unit/websocket/server/WsPerSessionServerEndpointConfig.java \
|
||||
src/java/nginx/unit/websocket/server/WsRemoteEndpointImplServer.java \
|
||||
src/java/nginx/unit/websocket/server/WsSci.java \
|
||||
src/java/nginx/unit/websocket/server/WsServerContainer.java \
|
||||
src/java/nginx/unit/websocket/server/WsSessionListener.java \
|
||||
src/java/nginx/unit/websocket/server/WsWriteTimeout.java \
|
||||
src/java/nginx/unit/websocket/server/package-info.java \
|
||||
"
|
||||
|
||||
NXT_JAVA_WS_API_SRCS=" \
|
||||
src/java/javax/websocket/ClientEndpoint.java \
|
||||
src/java/javax/websocket/ClientEndpointConfig.java \
|
||||
src/java/javax/websocket/CloseReason.java \
|
||||
src/java/javax/websocket/ContainerProvider.java \
|
||||
src/java/javax/websocket/DecodeException.java \
|
||||
src/java/javax/websocket/Decoder.java \
|
||||
src/java/javax/websocket/DefaultClientEndpointConfig.java \
|
||||
src/java/javax/websocket/DeploymentException.java \
|
||||
src/java/javax/websocket/EncodeException.java \
|
||||
src/java/javax/websocket/Encoder.java \
|
||||
src/java/javax/websocket/Endpoint.java \
|
||||
src/java/javax/websocket/EndpointConfig.java \
|
||||
src/java/javax/websocket/Extension.java \
|
||||
src/java/javax/websocket/HandshakeResponse.java \
|
||||
src/java/javax/websocket/MessageHandler.java \
|
||||
src/java/javax/websocket/OnClose.java \
|
||||
src/java/javax/websocket/OnError.java \
|
||||
src/java/javax/websocket/OnMessage.java \
|
||||
src/java/javax/websocket/OnOpen.java \
|
||||
src/java/javax/websocket/PongMessage.java \
|
||||
src/java/javax/websocket/RemoteEndpoint.java \
|
||||
src/java/javax/websocket/SendHandler.java \
|
||||
src/java/javax/websocket/SendResult.java \
|
||||
src/java/javax/websocket/Session.java \
|
||||
src/java/javax/websocket/SessionException.java \
|
||||
src/java/javax/websocket/WebSocketContainer.java \
|
||||
src/java/javax/websocket/server/DefaultServerEndpointConfig.java \
|
||||
src/java/javax/websocket/server/HandshakeRequest.java \
|
||||
src/java/javax/websocket/server/PathParam.java \
|
||||
src/java/javax/websocket/server/ServerApplicationConfig.java \
|
||||
src/java/javax/websocket/server/ServerContainer.java \
|
||||
src/java/javax/websocket/server/ServerEndpoint.java \
|
||||
src/java/javax/websocket/server/ServerEndpointConfig.java \
|
||||
"
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_JAVA_MODULE}
|
||||
.PHONY: ${NXT_JAVA_MODULE}-install
|
||||
.PHONY: ${NXT_JAVA_MODULE}-uninstall
|
||||
|
||||
all: ${NXT_JAVA_MODULE}
|
||||
|
||||
${NXT_JAVA_MODULE}: $NXT_BUILD_DIR/lib/unit/modules/${NXT_JAVA_MODULE}.unit.so \
|
||||
$NXT_BUILD_DIR/$NXT_UNIT_JAR \
|
||||
$NXT_BUILD_DIR/$NXT_WS_API_JAR
|
||||
|
||||
$NXT_BUILD_DIR/lib/unit/modules/${NXT_JAVA_MODULE}.unit.so: $nxt_objs
|
||||
\$(NXT_MODULE_LINK) -o \$@ $nxt_objs $NXT_JAVA_LDFLAGS $NXT_LD_OPT
|
||||
|
||||
|
||||
install: ${NXT_JAVA_MODULE}-install
|
||||
|
||||
${NXT_JAVA_MODULE}-install: \\
|
||||
$NXT_BUILD_DIR/lib/unit/modules/${NXT_JAVA_MODULE}.unit.so \\
|
||||
$NXT_BUILD_DIR/$NXT_UNIT_JAR \\
|
||||
$NXT_BUILD_DIR/$NXT_WS_API_JAR \\
|
||||
java-shared-install
|
||||
install -d \$(DESTDIR)$NXT_MODULESDIR
|
||||
install -p $NXT_BUILD_DIR/lib/unit/modules/${NXT_JAVA_MODULE}.unit.so \\
|
||||
\$(DESTDIR)$NXT_MODULESDIR/
|
||||
install -d \$(DESTDIR)$NXT_JARS
|
||||
install -p -m 0644 $NXT_BUILD_DIR/$NXT_UNIT_JAR \$(DESTDIR)$NXT_JARS/
|
||||
install -p -m 0644 $NXT_BUILD_DIR/$NXT_WS_API_JAR \$(DESTDIR)$NXT_JARS/
|
||||
|
||||
|
||||
uninstall: ${NXT_JAVA_MODULE}-uninstall
|
||||
|
||||
${NXT_JAVA_MODULE}-uninstall: java-shared-uninstall
|
||||
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_JAVA_MODULE}.unit.so
|
||||
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
|
||||
rm -f \$(DESTDIR)$NXT_JARS/$NXT_UNIT_JAR
|
||||
rm -f \$(DESTDIR)$NXT_JARS/$NXT_WS_API_JAR
|
||||
@rmdir -p \$(DESTDIR)$NXT_JARS 2>/dev/null || true
|
||||
|
||||
END
|
||||
|
||||
if ! grep ^$NXT_BUILD_DIR/$NXT_UNIT_JAR: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
NXT_JAVA_SRCS = $NXT_JAVA_SRCS
|
||||
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes: \$(NXT_JAVA_SRCS) \\
|
||||
$NXT_BUILD_DIR/$NXT_WS_API_JAR
|
||||
rm -rf $NXT_BUILD_DIR/$NXT_JAVA_MODULE/nginx/unit
|
||||
$NXT_JAVAC -d $NXT_BUILD_DIR/$NXT_JAVA_MODULE \\
|
||||
-cp $NXT_JAVA_BUILD_CP:$NXT_BUILD_DIR/$NXT_WS_API_JAR \\
|
||||
\$(NXT_JAVA_SRCS)
|
||||
touch \$@
|
||||
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE: LICENSE
|
||||
mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF
|
||||
cp -p LICENSE \$@
|
||||
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE: NOTICE
|
||||
mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF
|
||||
cp -p NOTICE \$@
|
||||
|
||||
$NXT_BUILD_DIR/$NXT_UNIT_JAR: \\
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes \\
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE \\
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE
|
||||
$NXT_JAVA_HOME/bin/jar c -C $NXT_BUILD_DIR/$NXT_JAVA_MODULE META-INF \\
|
||||
-C $NXT_BUILD_DIR/$NXT_JAVA_MODULE nginx/unit > \$@
|
||||
|
||||
NXT_JAVA_WS_API_SRCS = $NXT_JAVA_WS_API_SRCS
|
||||
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.javax.websocket.classes: \$(NXT_JAVA_WS_API_SRCS)
|
||||
rm -rf $NXT_BUILD_DIR/$NXT_JAVA_MODULE/javax/websocket
|
||||
$NXT_JAVAC -d $NXT_BUILD_DIR/$NXT_JAVA_MODULE -cp $NXT_JAVA_BUILD_CP \\
|
||||
\$(NXT_JAVA_WS_API_SRCS)
|
||||
touch \$@
|
||||
|
||||
$NXT_BUILD_DIR/$NXT_WS_API_JAR: \\
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.javax.websocket.classes \\
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE \\
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE
|
||||
$NXT_JAVA_HOME/bin/jar c -C $NXT_BUILD_DIR/$NXT_JAVA_MODULE META-INF \\
|
||||
-C $NXT_BUILD_DIR/$NXT_JAVA_MODULE javax/websocket > \$@
|
||||
|
||||
END
|
||||
|
||||
NXT_PROPS="\
|
||||
nginx/unit/websocket/LocalStrings.properties \
|
||||
nginx/unit/websocket/pojo/LocalStrings.properties \
|
||||
nginx/unit/websocket/server/LocalStrings.properties \
|
||||
"
|
||||
|
||||
for nxt_prop in $NXT_PROPS ; do
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/$nxt_prop: src/java/$nxt_prop \\
|
||||
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes
|
||||
cp src/java/$nxt_prop \$@
|
||||
|
||||
$NXT_BUILD_DIR/$NXT_UNIT_JAR: $NXT_BUILD_DIR/$NXT_JAVA_MODULE/$nxt_prop
|
||||
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
if ! grep ^java-shared-install: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: java-shared-install
|
||||
.PHONY: java-shared-uninstall
|
||||
|
||||
java-shared-install: $NXT_JAVA_INSTALL_JARS
|
||||
install -d \$(DESTDIR)$NXT_JARS
|
||||
install -p -m 0644 $NXT_JAVA_INSTALL_JARS \$(DESTDIR)$NXT_JARS/
|
||||
|
||||
java-shared-uninstall:
|
||||
rm -f $NXT_JAVA_UNINSTALL_JARS
|
||||
@rmdir -p \$(DESTDIR)$NXT_JARS 2>/dev/null || true
|
||||
|
||||
END
|
||||
|
||||
fi
|
||||
@@ -1,49 +0,0 @@
|
||||
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
# NXT_JAR_FILE=
|
||||
# NXT_JAR_CHK_FILE=
|
||||
|
||||
NXT_SHA512_TOOL=${NXT_SHA512_TOOL=}
|
||||
|
||||
if [ -z "$NXT_SHA512_TOOL" ]; then
|
||||
$echo -n "looking for sha512 check tool ..."
|
||||
$echo "looking for sha512 check tool ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if sha512sum --version >/dev/null 2>&1; then
|
||||
NXT_SHA512_TOOL="sha512sum --check"
|
||||
else
|
||||
if shasum --version >/dev/null 2>&1; then
|
||||
NXT_SHA512_TOOL="shasum -a 512 --check"
|
||||
else
|
||||
if openssl version >/dev/null 2>&1; then
|
||||
NXT_SHA512_TOOL="openssl dgst -sha512"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$NXT_SHA512_TOOL" ]; then
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: no sha512 tool found.
|
||||
$echo
|
||||
$echo "error: no sha512 tool found" >> $NXT_AUTOCONF_ERR
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$echo " $NXT_SHA512_TOOL"
|
||||
$echo "found $NXT_SHA512_TOOL" >> $NXT_AUTOCONF_ERR
|
||||
fi
|
||||
|
||||
if [ -f "$NXT_JAR_CHK_FILE" ]; then
|
||||
NXT_JAR_SHA512=`grep -F $NXT_JAR_FILE auto/modules/java_jar.sha512 | head -c 128`
|
||||
NXT_JAR_CHK=${NXT_JAR_CHK_FILE}.sha512.$$
|
||||
$echo "$NXT_JAR_SHA512 $NXT_JAR_CHK_FILE" > $NXT_JAR_CHK
|
||||
|
||||
if ! $NXT_SHA512_TOOL $NXT_JAR_CHK >/dev/null 2>&1; then
|
||||
$echo "SHA512 not matched for $NXT_JAR_FILE, removing $NXT_JAR_CHK_FILE"
|
||||
rm -f $NXT_JAR_CHK_FILE
|
||||
fi
|
||||
|
||||
rm -f $NXT_JAR_CHK
|
||||
fi
|
||||
@@ -1,46 +0,0 @@
|
||||
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
# NXT_JAR_NAME=
|
||||
# NXT_JAR_VERSION=
|
||||
# NXT_JAR_NAMESPACE=
|
||||
# NXT_JAR_REPO=http://central.maven.org/maven2/
|
||||
# NXT_JAR_LOCAL_REPO=$HOME/.m2/repository/
|
||||
|
||||
NXT_JAR_FILE=${NXT_JAR_NAME}-${NXT_JAR_VERSION}.jar
|
||||
NXT_JAR_LOCAL_DIR="${NXT_JAR_LOCAL_REPO}${NXT_JAR_NAMESPACE}${NXT_JAR_NAME}/${NXT_JAR_VERSION}"
|
||||
NXT_JAR_LOCAL="${NXT_JAR_LOCAL_DIR}/${NXT_JAR_FILE}"
|
||||
NXT_JAR_LOCAL_TMP="${NXT_JAR_LOCAL_DIR}/.${NXT_JAR_FILE}.$$"
|
||||
NXT_JAR_URL=${NXT_JAR_REPO}${NXT_JAR_NAMESPACE}${NXT_JAR_NAME}/${NXT_JAR_VERSION}/${NXT_JAR_FILE}
|
||||
|
||||
NXT_JAR_CHK_FILE="$NXT_BUILD_DIR/$NXT_JAR_FILE"
|
||||
. auto/modules/java_chk_sha512
|
||||
|
||||
if [ ! -f "$NXT_BUILD_DIR/$NXT_JAR_FILE" ]; then
|
||||
NXT_JAR_CHK_FILE=$NXT_JAR_LOCAL
|
||||
. auto/modules/java_chk_sha512
|
||||
|
||||
if [ ! -f "${NXT_JAR_LOCAL}" ]; then
|
||||
$echo "getting remote $NXT_JAR_FILE ... "
|
||||
$echo "getting remote $NXT_JAR_FILE ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
mkdir -p "${NXT_JAR_LOCAL_DIR}"
|
||||
curl --progress-bar "$NXT_JAR_URL" -o "$NXT_JAR_LOCAL_TMP"
|
||||
|
||||
NXT_JAR_CHK_FILE=$NXT_JAR_LOCAL_TMP
|
||||
. auto/modules/java_chk_sha512
|
||||
|
||||
mv "$NXT_JAR_LOCAL_TMP" "$NXT_JAR_LOCAL"
|
||||
else
|
||||
$echo "getting local $NXT_JAR_FILE"
|
||||
$echo "getting local $NXT_JAR_FILE ..." >> $NXT_AUTOCONF_ERR
|
||||
fi
|
||||
|
||||
cp "$NXT_JAR_LOCAL" "$NXT_BUILD_DIR/$NXT_JAR_FILE"
|
||||
fi
|
||||
|
||||
NXT_JAVA_BUILD_CP="${NXT_JAVA_BUILD_CP}:$NXT_BUILD_DIR/$NXT_JAR_FILE"
|
||||
NXT_JAVA_INSTALL_JARS="$NXT_JAVA_INSTALL_JARS $NXT_BUILD_DIR/$NXT_JAR_FILE"
|
||||
NXT_JAVA_UNINSTALL_JARS="$NXT_JAVA_UNINSTALL_JARS \$(DESTDIR)$NXT_JARS/$NXT_JAR_FILE"
|
||||
|
||||
$echo " \"$NXT_JAR_FILE\"," >> $NXT_JAVA_JARS
|
||||
@@ -1,14 +0,0 @@
|
||||
d0c17607eee55e181baa03f1abb2cf77f50e5114c471c2031607206768d8549c74ebb0a276d87dd3f8ea44db5e54e56087311c229ba18ad6013c388fc861beed classgraph-4.8.165.jar
|
||||
ab441acf5551a7dc81c353eaccb3b3df9e89a48987294d19e39acdb83a5b640fcdff7414cee29f5b96eaa8826647f1d5323e185018fe33a64c402d69c73c9158 ecj-3.26.0.jar
|
||||
6e1d6fdffcb2acf8daa9ce5b3ad973526a30b3556dc8e950254c68c64cd70e101b28a8acac41b3bd74de6b9c8eac10676afdc3c58ccb1f61a74323721592e0b5 jetty-http-9.4.54.v20240208.jar
|
||||
780ee47a8722bdfb4b159f440acbfb69afdb73cc329906392b10eba8d30c564aa6377fab129e61b85a56945f01c4403913c80b6ce3158d108d88a3ad64527f06 jetty-server-9.4.54.v20240208.jar
|
||||
fbe9cf7efeba9f29297f75de3f1c2d98f0e02816a1dc9e6eaddcabb84c3a699a9332218c532017a3707ec57f4f99066bc671708bde4ec84dd873b8403422d7e9 jetty-util-9.4.54.v20240208.jar
|
||||
1aa9024f49f74b44252f7c90d00bbfdd6aae4e96866708a0c2325def0314c8b7e5ad2fd17bb6b4b135eb2c513fe74b5b591d4b0fe3d1921192cfecadf140b7fa tomcat-api-9.0.86.jar
|
||||
60a9991ff7b95ef4edfac57cd7c18b6c5177d9aee4f775b5794b5833246b928e1a685b80785babd2f450e3cd18383c58b843b0b5e742252a37044494bc90d608 tomcat-el-api-9.0.86.jar
|
||||
b09cbfb834564cc7025ffad7bf069569989d3efa3bd176696045aea08bfb53622aa1aece5c84ea4371f0193d4fd477b9179999399e75d04205b219a3ab19bb66 tomcat-jasper-9.0.86.jar
|
||||
1431469e91debc0ffcf820df2973782221be955dac0739a77d9030ac619cde96320970cb27eb2ff9de1e6bde3227a70b1645d1934da8e10fe2b32c069d33afec tomcat-jasper-el-9.0.86.jar
|
||||
1ad9ebc1c49beb243c18ab2c459dbd54cab9514223c44b5c7e05d53d290c64c49990fc0fe276c66b1f6f6625acca651fdcb4b7df9e23fb0cc43bc05ad3900798 tomcat-jsp-api-9.0.86.jar
|
||||
d30055aabf5d45ad350e01702ed0ff4bfbcdd14bee40e1e8a9a7690719816aff019ca961b7970234eaba673c3c13f5cea5dbf1bc0612ce4e8f7de795af2f170d tomcat-juli-9.0.86.jar
|
||||
d7fa7d7bf35b35b7bb925cce6284e2f750e8e94ee54057daff4e369a32b361e6044e9011048a9dff54b12371ee785d34e82306b60ffae8add76602071e5fc9c5 tomcat-servlet-api-9.0.86.jar
|
||||
b4a268b79fbfcd610ea5d14446ef71ad5f2ad3da247ae148669e3082ff5fd7f7256a2ecdf2529e4280ed393f53c3a7f6d09a5c38d5653b30b25ab3c4b74ed732 tomcat-util-9.0.86.jar
|
||||
f2086356c8eca5cfe890232056ce30378422d3994c499845f52ec8641453af02041ae31ffdcb567bb998f0f24465d1ab65456b23e8f781058efdc01658c7252d tomcat-util-scan-9.0.86.jar
|
||||
@@ -1,216 +0,0 @@
|
||||
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
shift
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
--node=*) NXT_NODE="$value" ;;
|
||||
--npm=*) NXT_NPM="$value" ;;
|
||||
--node-gyp=*) NXT_NODE_GYP="$value" ;;
|
||||
--local=*) NXT_NODE_LOCAL="$value" ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--node=FILE set node executable
|
||||
--npm=FILE set npm executable
|
||||
--node-gyp=FILE set node-gyp executable
|
||||
--local=DIRECTORY set directory path for local installation
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid Node option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
|
||||
NXT_NODE=${NXT_NODE=node}
|
||||
NXT_NPM=${NXT_NPM=npm}
|
||||
NXT_NODE_GYP=${NXT_NODE_GYP=node-gyp}
|
||||
NXT_NODE_LOCAL=${NXT_NODE_LOCAL=}
|
||||
|
||||
|
||||
$echo "configuring nodejs module"
|
||||
$echo "configuring nodejs module..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
$echo -n "checking for node ..."
|
||||
$echo "checking for node ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if /bin/sh -c "${NXT_NODE} -v" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
$echo " found"
|
||||
|
||||
NXT_NODE_VERSION="`${NXT_NODE} -v`"
|
||||
$echo " + node version ${NXT_NODE_VERSION}"
|
||||
|
||||
else
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: no Node found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
$echo -n "checking for npm ..."
|
||||
$echo "checking for npm ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if /bin/sh -c "${NXT_NPM} -v" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
$echo " found"
|
||||
|
||||
NXT_NPM_VERSION="`${NXT_NPM} -v`"
|
||||
$echo " + npm version ${NXT_NPM_VERSION}"
|
||||
|
||||
else
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: no npm found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
$echo -n "checking for node-gyp ..."
|
||||
$echo "checking for node-gyp ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
if /bin/sh -c "${NXT_NODE_GYP} -v" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
$echo " found"
|
||||
|
||||
NXT_NODE_GYP_VERSION="`${NXT_NODE_GYP} -v`"
|
||||
$echo " + node-gyp version ${NXT_NODE_GYP_VERSION}"
|
||||
|
||||
else
|
||||
$echo " not found"
|
||||
$echo
|
||||
$echo $0: error: no node-gyp found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if grep ^$NXT_NODE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_NODE\" package configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
NXT_NODE_TMP=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http
|
||||
NXT_NODE_TMP_G=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http-g
|
||||
NXT_NODE_TARBALL=${NXT_BUILD_DIR}/src/${NXT_NODE}-unit-http.tar.gz
|
||||
NXT_NODE_TARBALL_G=${NXT_BUILD_DIR}/src/${NXT_NODE}-unit-http-g.tar.gz
|
||||
NXT_NODE_VERSION_FILE=${NXT_BUILD_DIR}/src/${NXT_NODE}/version.h
|
||||
NXT_NODE_PACKAGE_FILE=${NXT_BUILD_DIR}/src/${NXT_NODE}/package.json
|
||||
NXT_NODE_EXPORTS="export UNIT_SRC_PATH=${PWD}/src \
|
||||
&& export UNIT_BUILD_PATH=${PWD}/${NXT_BUILD_DIR} \
|
||||
&& export UNIT_LIB_STATIC_PATH=${PWD}/${NXT_BUILD_DIR}/lib/libunit.a"
|
||||
|
||||
if [ -n "$NXT_NODE_LOCAL" ]; then
|
||||
NXT_NODE_INSTALL=local-install
|
||||
else
|
||||
NXT_NODE_INSTALL=install
|
||||
fi
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_NODE}
|
||||
.PHONY: ${NXT_NODE}-copy
|
||||
.PHONY: ${NXT_NODE}-copy-g
|
||||
.PHONY: ${NXT_NODE}-install
|
||||
.PHONY: ${NXT_NODE}-uninstall
|
||||
.PHONY: ${NXT_NODE}-local-check
|
||||
.PHONY: ${NXT_NODE}-local-install
|
||||
.PHONY: ${NXT_NODE}-build
|
||||
.PHONY: ${NXT_NODE}-publish
|
||||
|
||||
${NXT_NODE}: ${NXT_NODE}-copy $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC
|
||||
${NXT_NODE_EXPORTS} && \\
|
||||
cd ${NXT_NODE_TMP} && ${NXT_NODE_GYP} configure build clean
|
||||
|
||||
${NXT_NODE}-copy: ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE}
|
||||
mkdir -p ${NXT_NODE_TMP}
|
||||
cp -rp src/nodejs/unit-http/* ${NXT_NODE_TMP}/
|
||||
cp -p ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE} ${NXT_NODE_TMP}/
|
||||
rm -f ${NXT_NODE_TMP}/binding_pub.gyp
|
||||
|
||||
${NXT_NODE}-copy-g: ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE}
|
||||
mkdir -p ${NXT_NODE_TMP_G}
|
||||
cp -rp src/nodejs/unit-http/* ${NXT_NODE_TMP_G}/
|
||||
cp -p ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE} ${NXT_NODE_TMP_G}/
|
||||
mv ${NXT_NODE_TMP_G}/binding_pub.gyp ${NXT_NODE_TMP_G}/binding.gyp
|
||||
|
||||
${NXT_NODE_VERSION_FILE}: ${NXT_VERSION_H}
|
||||
mkdir -p ${NXT_BUILD_DIR}/src/${NXT_NODE}
|
||||
$echo '#define NXT_NODE_VERNUM \$(NXT_VERNUM)' > $NXT_NODE_VERSION_FILE
|
||||
|
||||
${NXT_NODE_PACKAGE_FILE}: ${NXT_VERSION_H} src/nodejs/unit-http/package.json
|
||||
mkdir -p ${NXT_BUILD_DIR}/src/${NXT_NODE}
|
||||
sed -e "s|%%VERSION%%|\$(NXT_VERSION)|" \
|
||||
src/nodejs/unit-http/package.json > ${NXT_NODE_PACKAGE_FILE}
|
||||
|
||||
${NXT_NODE_TARBALL}: ${NXT_NODE}-copy
|
||||
cd ${NXT_NODE_TMP} && npm pack
|
||||
mv ${NXT_NODE_TMP}/unit-http-\$(NXT_VERSION).tgz ${NXT_NODE_TARBALL}
|
||||
|
||||
${NXT_NODE_TARBALL_G}: ${NXT_NODE}-copy-g
|
||||
cd ${NXT_NODE_TMP_G} && npm pack
|
||||
mv ${NXT_NODE_TMP_G}/unit-http-\$(NXT_VERSION).tgz ${NXT_NODE_TARBALL_G}
|
||||
|
||||
|
||||
install: ${NXT_NODE}-$NXT_NODE_INSTALL
|
||||
|
||||
${NXT_NODE}-install: ${NXT_NODE_TARBALL_G} libunit-install
|
||||
${NXT_NPM} install -g --unsafe-perm ${PWD}/${NXT_NODE_TARBALL_G}
|
||||
|
||||
${NXT_NODE}-uninstall:
|
||||
${NXT_NPM} uninstall -g unit-http
|
||||
|
||||
${NXT_NODE}-local-check:
|
||||
@test -n "\$(DESTDIR)$NXT_NODE_LOCAL" \\
|
||||
|| (echo; \\
|
||||
echo "error: to make ${NXT_NODE}-local-install you need either"; \\
|
||||
echo " to configure --local option"; \\
|
||||
echo " or to set DESTDIR environment variable."; \\
|
||||
echo; \\
|
||||
exit 1)
|
||||
|
||||
${NXT_NODE}-local-install: ${NXT_NODE_TARBALL} ${NXT_NODE}-local-check \
|
||||
$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC
|
||||
${NXT_NODE_EXPORTS} && \\
|
||||
mkdir -p \$(DESTDIR)${NXT_NODE_LOCAL} && \\
|
||||
cd \$(DESTDIR)${NXT_NODE_LOCAL} && \\
|
||||
${NXT_NPM} install ${PWD}/${NXT_NODE_TARBALL}
|
||||
|
||||
|
||||
${NXT_NODE}-build: ${NXT_NODE}
|
||||
|
||||
${NXT_NODE}-publish: ${NXT_NODE}
|
||||
cd ${NXT_NODE_TMP} && ${NXT_NPM} publish
|
||||
|
||||
END
|
||||
@@ -1,208 +0,0 @@
|
||||
|
||||
# Copyright (C) Alexander Borisov
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
shift
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
--perl=*) NXT_PERL="$value" ;;
|
||||
--module=*) NXT_PERL_MODULE="$value" ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--perl=FILE set perl executable, default: perl
|
||||
--module=NAME set unit perl module name
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid Perl option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
$echo "configuring Perl module"
|
||||
$echo "configuring Perl module ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
NXT_PERL=${NXT_PERL=perl}
|
||||
NXT_PERL_MODULE=${NXT_PERL_MODULE=${NXT_PERL##*/}}
|
||||
|
||||
nxt_found=no
|
||||
|
||||
if /bin/sh -c "$NXT_PERL -MConfig -e 'print \"Perl version: \",
|
||||
\$Config{version}, \"\\n\"'" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
|
||||
NXT_PERL_CFLAGS=`$NXT_PERL -MExtUtils::Embed -e ccflags | sed -e 's/^ //;s/ $//'`
|
||||
NXT_PERL_INCLUDE=`$NXT_PERL -MExtUtils::Embed -e perl_inc | sed -e 's/^ //;s/ $//'`
|
||||
NXT_PERL_LDOPTS=`$NXT_PERL -MExtUtils::Embed -e ldopts | sed -e 's/^ //;s/ $//'`
|
||||
|
||||
if [ "$NXT_SYSTEM" = "Darwin" ]; then
|
||||
# OS X system perl wants to link universal binaries
|
||||
NXT_PERL_LDOPTS=`echo $NXT_PERL_LDOPTS \
|
||||
| sed -e 's/-arch i386//' -e 's/-arch x86_64//'`
|
||||
fi
|
||||
|
||||
nxt_feature="Perl"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="${NXT_PERL_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PERL_LDOPTS}"
|
||||
nxt_feature_test="
|
||||
#define _GNU_SOURCE
|
||||
#include <EXTERN.h>
|
||||
#include <perl.h>
|
||||
|
||||
static PerlInterpreter *my_perl;
|
||||
|
||||
int main(void) {
|
||||
char argv[] = \"\\0-e\\00\";
|
||||
char *embedding[] = { &argv[0], &argv[1], &argv[4] };
|
||||
|
||||
int pargc = 0;
|
||||
char **pargv = NULL, **penv = NULL;
|
||||
PERL_SYS_INIT3(&pargc, &pargv, &penv);
|
||||
|
||||
my_perl = perl_alloc();
|
||||
perl_construct(my_perl);
|
||||
perl_parse(my_perl, NULL, 3, embedding, NULL);
|
||||
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
|
||||
perl_run(my_perl);
|
||||
|
||||
perl_destruct(my_perl);
|
||||
perl_free(my_perl);
|
||||
PERL_SYS_TERM();
|
||||
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
else
|
||||
$echo "checking for Perl ... not found"
|
||||
fi
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no Perl found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="Perl version"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_PERL_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PERL_LDOPTS}"
|
||||
nxt_feature_test="
|
||||
#define _GNU_SOURCE
|
||||
#include <EXTERN.h>
|
||||
#include <perl.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%s\", PERL_VERSION_STRING);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
if grep ^$NXT_PERL_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_PERL_MODULE\" module configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
$echo " + Perl module: ${NXT_PERL_MODULE}.unit.so"
|
||||
|
||||
. auto/cc/deps
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
NXT_PERL_MODULE_SRCS=" \
|
||||
src/perl/nxt_perl_psgi.c \
|
||||
src/perl/nxt_perl_psgi_layer.c
|
||||
"
|
||||
|
||||
# The Perl module object files.
|
||||
|
||||
nxt_objs=$NXT_BUILD_DIR/src/nxt_unit.o
|
||||
|
||||
for nxt_src in $NXT_PERL_MODULE_SRCS; do
|
||||
|
||||
nxt_obj=${nxt_src%.c}-$NXT_PERL_MODULE.o
|
||||
nxt_dep=${nxt_src%.c}-$NXT_PERL_MODULE.dep
|
||||
nxt_dep_flags=`nxt_gen_dep_flags`
|
||||
nxt_dep_post=`nxt_gen_dep_post`
|
||||
nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj"
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
|
||||
mkdir -p $NXT_BUILD_DIR/src/perl
|
||||
\$(CC) -c \$(CFLAGS) $NXT_PERL_CFLAGS \$(NXT_INCS) $NXT_PERL_INCLUDE \\
|
||||
$nxt_dep_flags \\
|
||||
-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
|
||||
$nxt_dep_post
|
||||
|
||||
-include $NXT_BUILD_DIR/$nxt_dep
|
||||
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_PERL_MODULE}
|
||||
.PHONY: ${NXT_PERL_MODULE}-install
|
||||
.PHONY: ${NXT_PERL_MODULE}-uninstall
|
||||
|
||||
all: ${NXT_PERL_MODULE}
|
||||
|
||||
${NXT_PERL_MODULE}: $NXT_BUILD_DIR/lib/unit/modules/${NXT_PERL_MODULE}.unit.so
|
||||
|
||||
$NXT_BUILD_DIR/lib/unit/modules/${NXT_PERL_MODULE}.unit.so: $nxt_objs
|
||||
\$(NXT_MODULE_LINK) -o \$@ $nxt_objs $NXT_PERL_LDOPTS $NXT_LD_OPT
|
||||
|
||||
|
||||
install: ${NXT_PERL_MODULE}-install
|
||||
|
||||
${NXT_PERL_MODULE}-install: ${NXT_PERL_MODULE} install-check
|
||||
install -d \$(DESTDIR)$NXT_MODULESDIR
|
||||
install -p $NXT_BUILD_DIR/lib/unit/modules/${NXT_PERL_MODULE}.unit.so \\
|
||||
\$(DESTDIR)$NXT_MODULESDIR/
|
||||
|
||||
|
||||
uninstall: ${NXT_PERL_MODULE}-uninstall
|
||||
|
||||
${NXT_PERL_MODULE}-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PERL_MODULE}.unit.so
|
||||
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
|
||||
|
||||
END
|
||||
289
auto/modules/php
289
auto/modules/php
@@ -1,289 +0,0 @@
|
||||
|
||||
# Copyright (C) Max Romanov
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
shift
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
--config=*) NXT_PHP_CONFIG="$value" ;;
|
||||
--module=*) NXT_PHP_MODULE="$value" ;;
|
||||
--lib-path=*) NXT_PHP_LIB_PATH="$value" ;;
|
||||
--lib-static) NXT_PHP_LIB_STATIC=yes ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--config=FILE set php-config filename
|
||||
--module=NAME set unit php module name
|
||||
--lib-path=DIRECTORY set directory path to libphp.so library
|
||||
--lib-static enable linking with static libphp.a library
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid PHP option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
|
||||
NXT_PHP_CONFIG=${NXT_PHP_CONFIG=php-config}
|
||||
NXT_PHP=${NXT_PHP_CONFIG%-config*}
|
||||
NXT_PHP_MODULE=${NXT_PHP_MODULE=${NXT_PHP##*/}}
|
||||
NXT_PHP_LIB_PATH=${NXT_PHP_LIB_PATH=}
|
||||
NXT_PHP_LIB_STATIC=${NXT_PHP_LIB_STATIC=no}
|
||||
NXT_PHP_ADDITIONAL_FLAGS=
|
||||
|
||||
|
||||
$echo "configuring PHP module"
|
||||
$echo "configuring PHP module ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
$echo -n "checking for PHP ..."
|
||||
$echo "checking for PHP ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
NXT_PHP_LDFLAGS=
|
||||
|
||||
if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
|
||||
$echo " found"
|
||||
|
||||
NXT_PHP_VERSION="`${NXT_PHP_CONFIG} --version`"
|
||||
NXT_PHP_EXT_DIR="`${NXT_PHP_CONFIG} --extension-dir`"
|
||||
|
||||
$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%%.*}
|
||||
|
||||
if [ $NXT_PHP_MAJOR_VERSION = 5 -a $NXT_PHP_MINOR_VERSION -lt 4 ]; then
|
||||
NXT_PHP_ADDITIONAL_FLAGS=-Wno-write-strings
|
||||
fi
|
||||
|
||||
NXT_PHP_INCLUDE="`${NXT_PHP_CONFIG} --includes`"
|
||||
|
||||
if [ $NXT_PHP_LIB_STATIC = yes ]; then
|
||||
|
||||
if [ "$NXT_PHP_LIB_PATH" = "" ]; then
|
||||
$echo
|
||||
$echo $0: error: --lib-static option requires --lib-path option.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
NXT_PHP_LIB="$NXT_PHP_LIB_PATH/libphp${NXT_PHP_VERSION%%.*}.a"
|
||||
NXT_PHP_LDFLAGS="`${NXT_PHP_CONFIG} --ldflags` \
|
||||
`${NXT_PHP_CONFIG} --libs`"
|
||||
|
||||
else
|
||||
if [ $NXT_PHP_MAJOR_VERSION -ge 8 ]; then
|
||||
NXT_PHP_LIB="-lphp"
|
||||
else
|
||||
NXT_PHP_LIB="-lphp${NXT_PHP_VERSION%%.*}"
|
||||
fi
|
||||
|
||||
if [ "$NXT_PHP_LIB_PATH" != "" ]; then
|
||||
# "php-config --ldflags" does not contain path to libphp, but
|
||||
# contains usually path to libraries required by extensions.
|
||||
NXT_PHP_LDFLAGS="-L${NXT_PHP_LIB_PATH} -Wl,-rpath,${NXT_PHP_LIB_PATH}"
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
$echo
|
||||
$echo $0: error: no PHP found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="PHP version"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_PHP_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
|
||||
nxt_feature_test="
|
||||
#include <php.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%s\", PHP_VERSION);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="PHP embed SAPI"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="${NXT_PHP_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
|
||||
nxt_feature_test="
|
||||
#include <php.h>
|
||||
#include <php_main.h>
|
||||
|
||||
int main(void) {
|
||||
#if (PHP_VERSION_ID < 80200)
|
||||
php_module_startup(NULL, NULL, 0);
|
||||
#else
|
||||
php_module_startup(NULL, NULL);
|
||||
#endif
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no PHP embed SAPI found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="PHP Zend Thread Safety"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="${NXT_PHP_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
|
||||
nxt_feature_test="
|
||||
#include <php.h>
|
||||
#include <php_main.h>
|
||||
|
||||
int main(void) {
|
||||
#ifndef ZTS
|
||||
#error ZTS is not defined.
|
||||
#endif
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
# Bug #71041 (https://bugs.php.net/bug.php?id=71041).
|
||||
|
||||
nxt_feature="PHP zend_signal_startup()"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="${NXT_PHP_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
|
||||
nxt_feature_test="
|
||||
#include <php.h>
|
||||
#include <php_main.h>
|
||||
|
||||
int main(void) {
|
||||
zend_signal_startup();
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_ZEND_SIGNAL_STARTUP=1
|
||||
else
|
||||
NXT_ZEND_SIGNAL_STARTUP=0
|
||||
fi
|
||||
|
||||
|
||||
if grep ^$NXT_PHP_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_PHP_MODULE\" module configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
$echo " + PHP module: ${NXT_PHP_MODULE}.unit.so"
|
||||
|
||||
. auto/cc/deps
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
NXT_PHP_MODULE_SRCS=" \
|
||||
src/nxt_php_sapi.c \
|
||||
"
|
||||
|
||||
# The php module object files.
|
||||
|
||||
nxt_objs=$NXT_BUILD_DIR/src/nxt_unit.o
|
||||
|
||||
for nxt_src in $NXT_PHP_MODULE_SRCS; do
|
||||
|
||||
nxt_obj=${nxt_src%.c}-$NXT_PHP_MODULE.o
|
||||
nxt_dep=${nxt_src%.c}-$NXT_PHP_MODULE.dep
|
||||
nxt_dep_flags=`nxt_gen_dep_flags`
|
||||
nxt_dep_post=`nxt_gen_dep_post`
|
||||
nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj"
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
|
||||
\$(CC) -c \$(CFLAGS) $NXT_PHP_ADDITIONAL_FLAGS \$(NXT_INCS) \\
|
||||
$NXT_PHP_INCLUDE -DNXT_ZEND_SIGNAL_STARTUP=$NXT_ZEND_SIGNAL_STARTUP \\
|
||||
$nxt_dep_flags \\
|
||||
-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
|
||||
$nxt_dep_post
|
||||
|
||||
-include $NXT_BUILD_DIR/$nxt_dep
|
||||
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_PHP_MODULE}
|
||||
.PHONY: ${NXT_PHP_MODULE}-install
|
||||
.PHONY: ${NXT_PHP_MODULE}-uninstall
|
||||
|
||||
all: ${NXT_PHP_MODULE}
|
||||
|
||||
${NXT_PHP_MODULE}: $NXT_BUILD_DIR/lib/unit/modules/${NXT_PHP_MODULE}.unit.so
|
||||
|
||||
$NXT_BUILD_DIR/lib/unit/modules/${NXT_PHP_MODULE}.unit.so: $nxt_objs
|
||||
\$(NXT_MODULE_LINK) -o \$@ \\
|
||||
$nxt_objs ${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS} $NXT_LD_OPT
|
||||
|
||||
|
||||
install: ${NXT_PHP_MODULE}-install
|
||||
|
||||
${NXT_PHP_MODULE}-install: ${NXT_PHP_MODULE} install-check
|
||||
install -d \$(DESTDIR)$NXT_MODULESDIR
|
||||
install -p $NXT_BUILD_DIR/lib/unit/modules/${NXT_PHP_MODULE}.unit.so \\
|
||||
\$(DESTDIR)$NXT_MODULESDIR/
|
||||
|
||||
|
||||
uninstall: ${NXT_PHP_MODULE}-uninstall
|
||||
|
||||
${NXT_PHP_MODULE}-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PHP_MODULE}.unit.so
|
||||
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
|
||||
|
||||
END
|
||||
@@ -1,237 +0,0 @@
|
||||
|
||||
# Copyright (C) Valentin V. Bartenev
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
shift
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
|
||||
--config=*) NXT_PYTHON_CONFIG="$value" ;;
|
||||
--module=*) NXT_PYTHON_MODULE="$value" ;;
|
||||
--lib-path=*) NXT_PYTHON_LIB_PATH="$value" ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--config=FILE set python-config filename
|
||||
--module=NAME set unit python module name
|
||||
--lib-path=DIRECTORY set directory path to libpython.so library
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid Python option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
|
||||
NXT_PYTHON_CONFIG=${NXT_PYTHON_CONFIG=python-config}
|
||||
NXT_PYTHON=${NXT_PYTHON_CONFIG%-config*}
|
||||
NXT_PYTHON_MODULE=${NXT_PYTHON_MODULE=${NXT_PYTHON##*/}}
|
||||
NXT_PYTHON_LIB_PATH=${NXT_PYTHON_LIB_PATH=}
|
||||
|
||||
|
||||
$echo "configuring Python module"
|
||||
$echo "configuring Python module ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
nxt_found=no
|
||||
|
||||
if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
|
||||
if ${NXT_PYTHON_CONFIG} --embed >/dev/null 2>&1; then
|
||||
NXT_PYTHON_CONFIG="${NXT_PYTHON_CONFIG} --embed"
|
||||
fi
|
||||
|
||||
NXT_PYTHON_INCLUDE=`${NXT_PYTHON_CONFIG} --includes`
|
||||
NXT_PYTHON_LIBS=`${NXT_PYTHON_CONFIG} --ldflags`
|
||||
|
||||
if [ "$NXT_PYTHON_LIB_PATH" != "" ]; then
|
||||
# "python-config --ldflags" may not contain path to libpython.
|
||||
NXT_PYTHON_LDFLAGS="-L$NXT_PYTHON_LIB_PATH -Wl,-rpath,$NXT_PYTHON_LIB_PATH"
|
||||
else
|
||||
NXT_PYTHON_LDFLAGS=""
|
||||
fi
|
||||
|
||||
nxt_feature="Python"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="${NXT_PYTHON_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PYTHON_LIBS} $NXT_PYTHON_LDFLAGS"
|
||||
nxt_feature_test="
|
||||
#include <Python.h>
|
||||
|
||||
int main(void) {
|
||||
Py_Initialize();
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
else
|
||||
$echo "checking for Python ... not found"
|
||||
fi
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no Python found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="Python version"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_PYTHON_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PYTHON_LIBS} $NXT_PYTHON_LDFLAGS"
|
||||
nxt_feature_test="
|
||||
#include <Python.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%s\", PY_VERSION);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
if grep ^$NXT_PYTHON_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_PYTHON_MODULE\" module configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
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_mounts[] = {")
|
||||
|
||||
pattern = "{(u_char *) \"%s\", (u_char *) \"%s\", NXT_FS_BIND, (u_char *) \"bind\", 0, NULL, 1, 1},"
|
||||
base = None
|
||||
for p in sys.path:
|
||||
if len(p) > 0:
|
||||
if os.path.basename(p) == pyver:
|
||||
base = p
|
||||
|
||||
if base is None:
|
||||
raise Exception("failed to compute sys.path mount points")
|
||||
|
||||
print(pattern % (base, base))
|
||||
|
||||
for p in sys.path:
|
||||
if len(p) > 0:
|
||||
if not p.startswith(base):
|
||||
print(pattern % (p, p))
|
||||
|
||||
print("};\n\n")
|
||||
|
||||
' > $NXT_BUILD_DIR/include/$NXT_PYTHON_MOUNTS_HEADER
|
||||
|
||||
|
||||
$echo " + Python module: ${NXT_PYTHON_MODULE}.unit.so"
|
||||
|
||||
. auto/cc/deps
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
NXT_PYTHON_MODULE_SRCS=" \
|
||||
src/python/nxt_python.c \
|
||||
src/python/nxt_python_asgi.c \
|
||||
src/python/nxt_python_asgi_http.c \
|
||||
src/python/nxt_python_asgi_lifespan.c \
|
||||
src/python/nxt_python_asgi_str.c \
|
||||
src/python/nxt_python_asgi_websocket.c \
|
||||
src/python/nxt_python_wsgi.c \
|
||||
"
|
||||
|
||||
# The python module object files.
|
||||
|
||||
nxt_objs=$NXT_BUILD_DIR/src/nxt_unit.o
|
||||
|
||||
for nxt_src in $NXT_PYTHON_MODULE_SRCS; do
|
||||
|
||||
nxt_obj=${nxt_src%.c}-$NXT_PYTHON_MODULE.o
|
||||
nxt_dep=${nxt_src%.c}-$NXT_PYTHON_MODULE.dep
|
||||
nxt_dep_flags=`nxt_gen_dep_flags`
|
||||
nxt_dep_post=`nxt_gen_dep_post`
|
||||
nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj"
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
|
||||
mkdir -p $NXT_BUILD_DIR/src/python
|
||||
\$(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
|
||||
|
||||
-include $NXT_BUILD_DIR/$nxt_dep
|
||||
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_PYTHON_MODULE}
|
||||
.PHONY: ${NXT_PYTHON_MODULE}-install
|
||||
.PHONY: ${NXT_PYTHON_MODULE}-uninstall
|
||||
|
||||
all: ${NXT_PYTHON_MODULE}
|
||||
|
||||
${NXT_PYTHON_MODULE}: $NXT_BUILD_DIR/lib/unit/modules/${NXT_PYTHON_MODULE}.unit.so
|
||||
|
||||
$NXT_BUILD_DIR/lib/unit/modules/${NXT_PYTHON_MODULE}.unit.so: $nxt_objs
|
||||
\$(NXT_MODULE_LINK) -o \$@ \\
|
||||
$nxt_objs $NXT_PYTHON_LIBS $NXT_PYTHON_LDFLAGS $NXT_LD_OPT
|
||||
|
||||
|
||||
install: ${NXT_PYTHON_MODULE}-install
|
||||
|
||||
${NXT_PYTHON_MODULE}-install: ${NXT_PYTHON_MODULE} install-check
|
||||
install -d \$(DESTDIR)$NXT_MODULESDIR
|
||||
install -p $NXT_BUILD_DIR/lib/unit/modules/${NXT_PYTHON_MODULE}.unit.so \\
|
||||
\$(DESTDIR)$NXT_MODULESDIR/
|
||||
|
||||
|
||||
uninstall: ${NXT_PYTHON_MODULE}-uninstall
|
||||
|
||||
${NXT_PYTHON_MODULE}-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_PYTHON_MODULE}.unit.so
|
||||
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
|
||||
|
||||
END
|
||||
@@ -1,274 +0,0 @@
|
||||
|
||||
# Copyright (C) Alexander Borisov
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
shift
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
--ruby=*) NXT_RUBY="$value" ;;
|
||||
--module=*) NXT_RUBY_MODULE="$value" ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--ruby=FILE set ruby executable, default: ruby
|
||||
--module=NAME set unit ruby module name
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid Ruby option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
$echo "configuring Ruby module"
|
||||
$echo "configuring Ruby module ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
NXT_RUBY=${NXT_RUBY=ruby}
|
||||
NXT_RUBY_MODULE=${NXT_RUBY_MODULE=${NXT_RUBY}}
|
||||
|
||||
nxt_found=no
|
||||
|
||||
if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
|
||||
NXT_RUBY_CFLAGS=
|
||||
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 -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"
|
||||
|
||||
if [ $NXT_CC_NAME = clang ]; then
|
||||
# Workaround Clang bug
|
||||
nxt_feature="-fdeclspec"
|
||||
nxt_feature_name=
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs="-fdeclspec"
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
|
||||
__declspec(noreturn) static void f(void);
|
||||
|
||||
static void f(void) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
f();
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_RUBY_CFLAGS="$NXT_RUBY_CFLAGS -fdeclspec"
|
||||
fi
|
||||
fi
|
||||
|
||||
nxt_feature="Ruby library"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_RUBY_INCPATH} ${NXT_RUBY_CFLAGS}"
|
||||
nxt_feature_libs="${NXT_RUBY_LIBS}"
|
||||
nxt_feature_test="
|
||||
#include <ruby.h>
|
||||
|
||||
int main(void) {
|
||||
static const char *argv[3] = {
|
||||
\"NGINX_Unit\", \"-rrbconfig\",
|
||||
\"-eprint RbConfig::CONFIG['libdir']\"
|
||||
};
|
||||
|
||||
RUBY_INIT_STACK;
|
||||
ruby_init();
|
||||
return ruby_run_node(ruby_options(3, (char **) argv));
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
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"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="${NXT_RUBY_INCPATH} ${NXT_RUBY_CFLAGS}"
|
||||
nxt_feature_libs="${NXT_RUBY_LIBS}"
|
||||
nxt_feature_test="
|
||||
#include <ruby.h>
|
||||
|
||||
int main(void) {
|
||||
ruby_init();
|
||||
return ruby_cleanup(0);
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
else
|
||||
$echo "checking for Ruby ... not found"
|
||||
fi
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no Ruby found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="Ruby version"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_RUBY_INCPATH} ${NXT_RUBY_CFLAGS}"
|
||||
nxt_feature_libs="${NXT_RUBY_LIBS}"
|
||||
nxt_feature_test="
|
||||
#include <ruby.h>
|
||||
#include <ruby/version.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%s\", ruby_version);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
if grep ^$NXT_RUBY_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_RUBY_MODULE\" module configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
NXT_RUBY_MOUNTS_HEADER=nxt_${NXT_RUBY_MODULE}_mounts.h
|
||||
NXT_RUBY_MOUNTS_PATH=$NXT_BUILD_DIR/include/$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",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
{(u_char *) "$NXT_RUBY_ARCHHDRDIR", (u_char *) "$NXT_RUBY_ARCHHDRDIR",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
{(u_char *) "$NXT_RUBY_SITEDIR", (u_char *) "$NXT_RUBY_SITEDIR",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
{(u_char *) "$NXT_RUBY_LIBDIR", (u_char *) "$NXT_RUBY_LIBDIR",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
{(u_char *) "$NXT_RUBY_TOPDIR", (u_char *) "$NXT_RUBY_TOPDIR",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
{(u_char *) "$NXT_RUBY_PREFIXDIR", (u_char *) "$NXT_RUBY_PREFIXDIR",
|
||||
NXT_FS_BIND, (u_char *) "bind", 0, NULL, 1, 1},
|
||||
|
||||
END
|
||||
|
||||
for path in `echo $NXT_RUBY_GEMPATH | tr ':' '\n'`; do
|
||||
$echo "{(u_char *) \"$path\", (u_char *) \"$path\"," >> $NXT_RUBY_MOUNTS_PATH
|
||||
$echo "NXT_FS_BIND, (u_char *) \"bind\", 0, NULL, 1, 1}," >> $NXT_RUBY_MOUNTS_PATH
|
||||
done
|
||||
|
||||
$echo "};" >> $NXT_RUBY_MOUNTS_PATH
|
||||
|
||||
|
||||
$echo " + Ruby module: ${NXT_RUBY_MODULE}.unit.so"
|
||||
|
||||
. auto/cc/deps
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
NXT_RUBY_MODULE_SRCS=" \
|
||||
src/ruby/nxt_ruby.c \
|
||||
src/ruby/nxt_ruby_stream_io.c
|
||||
"
|
||||
|
||||
# The Ruby module object files.
|
||||
|
||||
nxt_objs=$NXT_BUILD_DIR/src/nxt_unit.o
|
||||
|
||||
for nxt_src in $NXT_RUBY_MODULE_SRCS; do
|
||||
|
||||
nxt_obj=${nxt_src%.c}-$NXT_RUBY_MODULE.o
|
||||
nxt_dep=${nxt_src%.c}-$NXT_RUBY_MODULE.dep
|
||||
nxt_dep_flags=`nxt_gen_dep_flags`
|
||||
nxt_dep_post=`nxt_gen_dep_post`
|
||||
nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj"
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
|
||||
mkdir -p $NXT_BUILD_DIR/src/ruby
|
||||
\$(CC) -c \$(CFLAGS) $NXT_RUBY_CFLAGS -DNXT_RUBY_MOUNTS_H=\"$NXT_RUBY_MOUNTS_HEADER\" \\
|
||||
\$(NXT_INCS) $NXT_RUBY_INCPATH \\
|
||||
$nxt_dep_flags \\
|
||||
-o \$@ $nxt_src
|
||||
$nxt_dep_post
|
||||
|
||||
-include $NXT_BUILD_DIR/$nxt_dep
|
||||
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_RUBY_MODULE}
|
||||
.PHONY: ${NXT_RUBY_MODULE}-install
|
||||
.PHONY: ${NXT_RUBY_MODULE}-uninstall
|
||||
|
||||
all: ${NXT_RUBY_MODULE}
|
||||
|
||||
${NXT_RUBY_MODULE}: $NXT_BUILD_DIR/lib/unit/modules/${NXT_RUBY_MODULE}.unit.so
|
||||
|
||||
$NXT_BUILD_DIR/lib/unit/modules/${NXT_RUBY_MODULE}.unit.so: $nxt_objs
|
||||
\$(NXT_MODULE_LINK) -o \$@ $nxt_objs $NXT_RUBY_LIBS $NXT_LD_OPT
|
||||
|
||||
|
||||
install: ${NXT_RUBY_MODULE}-install
|
||||
|
||||
${NXT_RUBY_MODULE}-install: ${NXT_RUBY_MODULE} install-check
|
||||
install -d \$(DESTDIR)$NXT_MODULESDIR
|
||||
install -p $NXT_BUILD_DIR/lib/unit/modules/${NXT_RUBY_MODULE}.unit.so \\
|
||||
\$(DESTDIR)$NXT_MODULESDIR/
|
||||
|
||||
|
||||
uninstall: ${NXT_RUBY_MODULE}-uninstall
|
||||
|
||||
${NXT_RUBY_MODULE}-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_RUBY_MODULE}.unit.so
|
||||
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
|
||||
|
||||
END
|
||||
@@ -1,207 +0,0 @@
|
||||
# Copyright (C) Andrew Clayton
|
||||
# Copyright (C) F5, Inc.
|
||||
|
||||
|
||||
NXT_WASM_RUNTIME=wasmtime
|
||||
|
||||
shift
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
|
||||
--runtime=*) NXT_WASM_RUNTIME="$value" ;;
|
||||
--module=*) NXT_WASM_MODULE="$value" ;;
|
||||
--include-path=*) NXT_WASM_INCLUDE_PATH="$value" ;;
|
||||
--lib-path=*) NXT_WASM_LIB_PATH="$value" ;;
|
||||
--rpath*) NXT_WASM_RPATH="$value" ;;
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
--runtime=RUNTIME set the WASM runtime to use (default: wasmtime)
|
||||
--module=NAME set Unit WASM module name (default: wasm)
|
||||
--include-path=DIRECTORY set directory path to wasmtime includes
|
||||
--lib-path=DIRECTORY set directory path to libwasmtime.so library
|
||||
--rpath[=DIRECTORY] set the rpath (default: --lib-path)
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid wasm option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
NXT_WASM=wasm
|
||||
NXT_WASM_MODULE=${NXT_WASM_MODULE=${NXT_WASM##*/}}
|
||||
|
||||
NXT_WASM_INCLUDE_PATH=${NXT_WASM_INCLUDE_PATH=}
|
||||
NXT_WASM_LIB_PATH=${NXT_WASM_LIB_PATH=}
|
||||
NXT_WASM_LDFLAGS=
|
||||
if [ "$NXT_WASM_RUNTIME" = "wasmtime" ]; then
|
||||
NXT_WASM_LDFLAGS=-lwasmtime
|
||||
fi
|
||||
NXT_WASM_ADDITIONAL_FLAGS="-fno-strict-aliasing \
|
||||
-Wno-missing-field-initializers \
|
||||
-DNXT_HAVE_WASM_$(echo ${NXT_WASM_RUNTIME} | tr 'a-z' 'A-Z') \
|
||||
"
|
||||
|
||||
# Set the RPATH/RUNPATH.
|
||||
#
|
||||
# We temporarily disable warning on unbound variables here as
|
||||
# NXT_WASM_RPATH may be legitimately unset, in which case we
|
||||
# don't set a RPATH.
|
||||
#
|
||||
# If NXT_WASM_RPATH is set but null then we set a RPATH of the
|
||||
# value of $NXT_WASM_LIB (--lib-path) otherwise use the value
|
||||
# provided.
|
||||
set +u
|
||||
if [ "${NXT_WASM_RPATH+set}" = set ]; then
|
||||
if [ "$NXT_WASM_RPATH" = "" ]; then
|
||||
NXT_WASM_RPATH=$NXT_WASM_LIB_PATH
|
||||
fi
|
||||
|
||||
NXT_WASM_LDFLAGS="-Wl,-rpath,$NXT_WASM_RPATH $NXT_WASM_LDFLAGS"
|
||||
fi
|
||||
set -u
|
||||
|
||||
$echo "configuring WASM module"
|
||||
$echo "configuring WASM module ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
nxt_found=no
|
||||
|
||||
if [ "$NXT_WASM_RUNTIME" = "wasmtime" ]; then
|
||||
nxt_feature="wasmtime"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="-I${NXT_WASM_INCLUDE_PATH}"
|
||||
nxt_feature_libs="-L${NXT_WASM_LIB_PATH} $NXT_WASM_LDFLAGS"
|
||||
nxt_feature_test="
|
||||
#include <wasm.h>
|
||||
#include <wasi.h>
|
||||
#include <wasmtime.h>
|
||||
|
||||
int main(void) {
|
||||
wasm_config_t *c;
|
||||
|
||||
c = wasm_config_new();
|
||||
wasm_config_delete(c);
|
||||
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no $NXT_WASM_RUNTIME found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
if grep ^$NXT_WASM_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_WASM_MODULE\" module configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
$echo " + WASM module: ${NXT_WASM_MODULE}.unit.so"
|
||||
|
||||
. auto/cc/deps
|
||||
|
||||
$echo >> $NXT_MAKEFILE
|
||||
|
||||
NXT_WASM_MODULE_SRCS=" \
|
||||
src/wasm/nxt_wasm.c \
|
||||
"
|
||||
|
||||
if [ "$NXT_WASM_RUNTIME" = "wasmtime" ]; then
|
||||
NXT_WASM_MODULE_SRCS="$NXT_WASM_MODULE_SRCS src/wasm/nxt_rt_wasmtime.c"
|
||||
fi
|
||||
|
||||
|
||||
# The wasm module object files.
|
||||
|
||||
nxt_objs=$NXT_BUILD_DIR/src/nxt_unit.o
|
||||
|
||||
for nxt_src in $NXT_WASM_MODULE_SRCS; do
|
||||
|
||||
nxt_obj=${nxt_src%.c}-$NXT_WASM_MODULE.o
|
||||
nxt_dep=${nxt_src%.c}-$NXT_WASM_MODULE.dep
|
||||
nxt_dep_flags=`nxt_gen_dep_flags`
|
||||
nxt_dep_post=`nxt_gen_dep_post`
|
||||
nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj"
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
$NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H
|
||||
mkdir -p $NXT_BUILD_DIR/src/wasm
|
||||
\$(CC) -c \$(CFLAGS) $NXT_WASM_ADDITIONAL_FLAGS \$(NXT_INCS) \\
|
||||
-I$NXT_WASM_INCLUDE_PATH \\
|
||||
$nxt_dep_flags \\
|
||||
-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
|
||||
$nxt_dep_post
|
||||
|
||||
-include $NXT_BUILD_DIR/$nxt_dep
|
||||
|
||||
END
|
||||
|
||||
done
|
||||
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_WASM_MODULE}
|
||||
.PHONY: ${NXT_WASM_MODULE}-install
|
||||
.PHONY: ${NXT_WASM_MODULE}-uninstall
|
||||
|
||||
all: ${NXT_WASM_MODULE}
|
||||
|
||||
${NXT_WASM_MODULE}: $NXT_BUILD_DIR/lib/unit/modules/${NXT_WASM_MODULE}.unit.so
|
||||
|
||||
$NXT_BUILD_DIR/lib/unit/modules/${NXT_WASM_MODULE}.unit.so: $nxt_objs
|
||||
\$(NXT_MODULE_LINK) -o \$@ \\
|
||||
$nxt_objs -L${NXT_WASM_LIB_PATH} ${NXT_WASM_LDFLAGS} $NXT_LD_OPT
|
||||
|
||||
|
||||
install: ${NXT_WASM_MODULE}-install
|
||||
|
||||
${NXT_WASM_MODULE}-install: ${NXT_WASM_MODULE} install-check
|
||||
install -d \$(DESTDIR)$NXT_MODULESDIR
|
||||
install -p $NXT_BUILD_DIR/lib/unit/modules/${NXT_WASM_MODULE}.unit.so \\
|
||||
\$(DESTDIR)$NXT_MODULESDIR/
|
||||
|
||||
|
||||
uninstall: ${NXT_WASM_MODULE}-uninstall
|
||||
|
||||
${NXT_WASM_MODULE}-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_MODULESDIR/${NXT_WASM_MODULE}.unit.so
|
||||
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
|
||||
|
||||
END
|
||||
@@ -1,120 +0,0 @@
|
||||
# Copyright (C) Andrew Clayton
|
||||
# Copyright (C) F5, Inc.
|
||||
|
||||
|
||||
NXT_WCM_MODULE=wasm-wasi-component
|
||||
NXT_WCM_MOD_NAME=`echo $NXT_WCM_MODULE | tr '-' '_'`.unit.so
|
||||
|
||||
NXT_WCM_MOD_CARGO="src/wasm-wasi-component/target/release/libwasm_wasi_component.so"
|
||||
|
||||
|
||||
shift
|
||||
|
||||
for nxt_option; do
|
||||
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
|
||||
--help)
|
||||
cat << END
|
||||
|
||||
END
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo
|
||||
echo $0: error: invalid $NXT_WCM_MODULE option \"$nxt_option\"
|
||||
echo
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ ! -f $NXT_AUTOCONF_DATA ]; then
|
||||
echo
|
||||
echo Please run common $0 before configuring module \"$nxt_module\".
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. $NXT_AUTOCONF_DATA
|
||||
|
||||
NXT_WCM_WASM_TOOLS_BIN=${NXT_WCM_WASM_TOOLS_BIN=}
|
||||
|
||||
|
||||
$echo "configuring $NXT_WCM_MODULE module"
|
||||
$echo "configuring $NXT_WCM_MODULE module ..." >> $NXT_AUTOCONF_ERR
|
||||
|
||||
$echo -n "looking for rust compiler ... "
|
||||
|
||||
if [ -z `which rustc 2>/dev/null` ]; then
|
||||
$echo "not found."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
$echo "found."
|
||||
|
||||
$echo -n "looking for cargo ... "
|
||||
|
||||
if [ -z `which cargo 2>/dev/null` ]; then
|
||||
$echo "not found."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
$echo "found."
|
||||
|
||||
|
||||
if grep ^$NXT_WCM_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_WCM_MODULE\" module configured.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
$echo " + $NXT_WCM_MODULE module: $NXT_WCM_MOD_NAME"
|
||||
|
||||
|
||||
NXT_OS=$(uname -o)
|
||||
|
||||
if [ $NXT_OS = "Darwin" ]; then
|
||||
NXT_CARGO_CMD="cargo rustc --release --manifest-path src/wasm-wasi-component/Cargo.toml -- --emit link=target/release/libwasm_wasi_component.so -C link-args='-undefined dynamic_lookup'"
|
||||
else
|
||||
NXT_CARGO_CMD="cargo build --release --manifest-path src/wasm-wasi-component/Cargo.toml"
|
||||
fi
|
||||
|
||||
|
||||
cat << END >> $NXT_MAKEFILE
|
||||
|
||||
.PHONY: ${NXT_WCM_MODULE}
|
||||
.PHONY: ${NXT_WCM_MODULE}-install
|
||||
.PHONY: ${NXT_WCM_MODULE}-uninstall
|
||||
|
||||
all: ${NXT_WCM_MODULE}
|
||||
|
||||
${NXT_WCM_MODULE}: ${NXT_WCM_MOD_CARGO}
|
||||
|
||||
${NXT_WCM_MOD_CARGO}: build/src/nxt_unit.o
|
||||
$NXT_CARGO_CMD
|
||||
|
||||
install: ${NXT_WCM_MODULE}-install
|
||||
|
||||
${NXT_WCM_MODULE}-install: ${NXT_WCM_MODULE} install-check
|
||||
install -d \$(DESTDIR)$NXT_MODULESDIR
|
||||
install -p ${NXT_WCM_MOD_CARGO} \\
|
||||
\$(DESTDIR)$NXT_MODULESDIR/$NXT_WCM_MOD_NAME
|
||||
|
||||
uninstall: ${NXT_WCM_MODULE}-uninstall
|
||||
|
||||
${NXT_WCM_MODULE}-uninstall:
|
||||
rm -f \$(DESTDIR)$NXT_MODULESDIR/$NXT_WCM_MOD_NAME
|
||||
@rmdir -p \$(DESTDIR)$NXT_MODULESDIR 2>/dev/null || true
|
||||
|
||||
END
|
||||
53
auto/njs
53
auto/njs
@@ -1,53 +0,0 @@
|
||||
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
nxt_found=no
|
||||
NXT_HAVE_NJS=NO
|
||||
|
||||
if /bin/sh -c "(pkg-config njs --exists)" >> $NXT_AUTOCONF_ERR 2>&1;
|
||||
then
|
||||
NXT_NJS_AUX_CFLAGS=
|
||||
NXT_NJS_AUX_LIBS=
|
||||
NXT_NJS_CFLAGS=`pkg-config njs --cflags`
|
||||
NXT_NJS_LIBS=`pkg-config njs --libs`
|
||||
else
|
||||
NXT_NJS_AUX_CFLAGS=
|
||||
NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS"
|
||||
NXT_NJS_CFLAGS=
|
||||
NXT_NJS_LIBS="-lnjs"
|
||||
fi
|
||||
|
||||
nxt_feature="NJS"
|
||||
nxt_feature_name=NXT_HAVE_NJS
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="$NXT_NJS_CFLAGS $NXT_NJS_AUX_CFLAGS"
|
||||
nxt_feature_libs="$NXT_NJS_LIBS $NXT_NJS_AUX_LIBS"
|
||||
nxt_feature_test="#include <njs.h>
|
||||
|
||||
#if NJS_VERSION_NUMBER < 0x000800
|
||||
# error NJS < 0.8.0 is not supported.
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
njs_vm_t *vm;
|
||||
njs_vm_opt_t opts;
|
||||
|
||||
njs_vm_opt_init(&opts);
|
||||
|
||||
vm = njs_vm_create(&opts);
|
||||
if (vm == NULL)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no NJS library \>= 0.8.0 found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
NXT_LIB_AUX_CFLAGS="$NXT_LIB_AUX_CFLAGS $NXT_NJS_CFLAGS"
|
||||
NXT_LIB_AUX_LIBS="$NXT_NJS_LIBS $NXT_LIB_AUX_LIBS"
|
||||
172
auto/options
172
auto/options
@@ -1,172 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) Valentin V. Bartenev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
NXT_CONFIGURE_OPTIONS=
|
||||
NXT_CFLAGS=
|
||||
NXT_CC_OPT=
|
||||
NXT_LD_OPT=
|
||||
|
||||
NXT_DEBUG=NO
|
||||
|
||||
NXT_INET6=YES
|
||||
NXT_UNIX_DOMAIN=YES
|
||||
|
||||
NXT_PCRE_CFLAGS=
|
||||
NXT_PCRE_LIB=
|
||||
|
||||
NXT_REGEX=YES
|
||||
NXT_TRY_PCRE2=YES
|
||||
|
||||
NXT_TLS=NO
|
||||
NXT_OPENSSL=NO
|
||||
NXT_GNUTLS=NO
|
||||
NXT_CYASSL=NO
|
||||
NXT_POLARSSL=NO
|
||||
|
||||
NXT_NJS=NO
|
||||
|
||||
NXT_TEST_BUILD_EPOLL=NO
|
||||
NXT_TEST_BUILD_EVENTPORT=NO
|
||||
NXT_TEST_BUILD_DEVPOLL=NO
|
||||
NXT_TEST_BUILD_POLLSET=NO
|
||||
|
||||
NXT_TEST_BUILD_FREEBSD_SENDFILE=NO
|
||||
NXT_TEST_BUILD_LINUX_SENDFILE=NO
|
||||
NXT_TEST_BUILD_MACOSX_SENDFILE=NO
|
||||
NXT_TEST_BUILD_SOLARIS_SENDFILEV=NO
|
||||
NXT_TEST_BUILD_AIX_SEND_FILE=NO
|
||||
NXT_TEST_BUILD_HPUX_SENDFILE=NO
|
||||
|
||||
NXT_TESTS=NO
|
||||
|
||||
NXT_HELP=NO
|
||||
|
||||
for nxt_option
|
||||
do
|
||||
case "$nxt_option" in
|
||||
-*=*) value=`$echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) value="" ;;
|
||||
esac
|
||||
|
||||
case "$nxt_option" in
|
||||
--cc=*) CC="$value" ;;
|
||||
--cc-opt=*) NXT_CC_OPT="$value" ;;
|
||||
--ld-opt=*) NXT_LD_OPT="$value" ;;
|
||||
|
||||
--prefix=*) NXT_PREFIX="$value" ;;
|
||||
--exec-prefix=*) NXT_EXEC_PREFIX="$value" ;;
|
||||
--bindir=*) NXT_BINDIR="$value" ;;
|
||||
--sbindir=*) NXT_SBINDIR="$value" ;;
|
||||
--includedir=*) NXT_INCLUDEDIR="$value" ;;
|
||||
--incdir=*)
|
||||
>&2 echo "[warn] option --incdir is deprecated; use --includedir"
|
||||
NXT_INCLUDEDIR="$value"
|
||||
;;
|
||||
--libdir=*) NXT_LIBDIR="$value" ;;
|
||||
--modulesdir=*) NXT_MODULESDIR="$value" ;;
|
||||
--modules=*)
|
||||
>&2 echo "[warn] option --modules is deprecated; use --modulesdir"
|
||||
NXT_MODULESDIR="$value"
|
||||
;;
|
||||
--datarootdir=*) NXT_DATAROOTDIR="$value" ;;
|
||||
--mandir=*) NXT_MANDIR="$value" ;;
|
||||
--pkgconfigdir=*) NXT_PKGCONFIGDIR="$value" ;;
|
||||
--localstatedir=*) NXT_LOCALSTATEDIR="$value" ;;
|
||||
--statedir=*) NXT_STATEDIR="$value" ;;
|
||||
--state=*)
|
||||
>&2 echo "[warn] option --state is deprecated; use --statedir"
|
||||
NXT_STATEDIR="$value"
|
||||
;;
|
||||
--logdir=*) NXT_LOGDIR="$value" ;;
|
||||
--runstatedir=*) NXT_RUNSTATEDIR="$value" ;;
|
||||
--tmpdir=*) NXT_TMPDIR="$value" ;;
|
||||
--tmp=*)
|
||||
>&2 echo "[warn] option --tmp is deprecated; use --tmpdir"
|
||||
NXT_TMPDIR="$value"
|
||||
;;
|
||||
|
||||
--pid=*) NXT_PID="$value" ;;
|
||||
--log=*) NXT_LOG="$value" ;;
|
||||
|
||||
--control=*) NXT_CONTROL="$value" ;;
|
||||
|
||||
--user=*) NXT_USER="$value" ;;
|
||||
--group=*) NXT_GROUP="$value" ;;
|
||||
|
||||
--debug) NXT_DEBUG=YES ;;
|
||||
|
||||
--no-ipv6) NXT_INET6=NO ;;
|
||||
--no-unix-sockets) NXT_UNIX_DOMAIN=NO ;;
|
||||
|
||||
--no-regex) NXT_REGEX=NO ;;
|
||||
--no-pcre2) NXT_TRY_PCRE2=NO ;;
|
||||
|
||||
--openssl) NXT_OPENSSL=YES ;;
|
||||
--gnutls) NXT_GNUTLS=YES ;;
|
||||
--cyassl) NXT_CYASSL=YES ;;
|
||||
--polarssl) NXT_POLARSSL=YES ;;
|
||||
|
||||
--njs) NXT_NJS=YES ;;
|
||||
|
||||
--test-build-epoll) NXT_TEST_BUILD_EPOLL=YES ;;
|
||||
--test-build-eventport) NXT_TEST_BUILD_EVENTPORT=YES ;;
|
||||
--test-build-devpoll) NXT_TEST_BUILD_DEVPOLL=YES ;;
|
||||
--test-build-pollset) NXT_TEST_BUILD_POLLSET=YES ;;
|
||||
|
||||
--test-build-freebsd-sendfile) NXT_TEST_BUILD_FREEBSD_SENDFILE=YES ;;
|
||||
--test-build-linux-sendfile) NXT_TEST_BUILD_LINUX_SENDFILE=YES ;;
|
||||
--test-build-solaris-sendfilev) NXT_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
|
||||
--test-build-macosx-sendfile) NXT_TEST_BUILD_MACOSX_SENDFILE=YES ;;
|
||||
--test-build-aix-send_file) NXT_TEST_BUILD_AIX_SEND_FILE=YES ;;
|
||||
--test-build-hpux-sendfile) NXT_TEST_BUILD_HPUX_SENDFILE=YES ;;
|
||||
|
||||
--tests) NXT_TESTS=YES ;;
|
||||
|
||||
--help)
|
||||
. auto/help
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
$echo
|
||||
$echo $0: error: invalid option \"$nxt_option\".
|
||||
$echo Run \"$0 --help\" to see available options.
|
||||
$echo
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
nxt_opt=`$echo $nxt_option | sed -e "s/\(--[^=]*=\)\(.* .*\)/\1'\2'/"`
|
||||
|
||||
NXT_CONFIGURE_OPTIONS="$NXT_CONFIGURE_OPTIONS $nxt_opt"
|
||||
|
||||
done
|
||||
|
||||
|
||||
NXT_PREFIX="${NXT_PREFIX-"/usr/local"}"
|
||||
|
||||
NXT_EXEC_PREFIX="${NXT_EXEC_PREFIX-"$NXT_PREFIX"}"
|
||||
NXT_BINDIR="${NXT_BINDIR-"$NXT_EXEC_PREFIX/bin"}"
|
||||
NXT_SBINDIR="${NXT_SBINDIR-"$NXT_EXEC_PREFIX/sbin"}"
|
||||
|
||||
NXT_INCLUDEDIR="${NXT_INCLUDEDIR-"$NXT_PREFIX/include"}"
|
||||
|
||||
NXT_LIBDIR="${NXT_LIBDIR-"$NXT_PREFIX/lib"}"
|
||||
NXT_MODULESDIR="${NXT_MODULESDIR-"$NXT_LIBDIR/unit/modules"}"
|
||||
|
||||
NXT_DATAROOTDIR="${NXT_DATAROOTDIR-"$NXT_PREFIX/share"}"
|
||||
NXT_MANDIR="${NXT_MANDIR-"$NXT_DATAROOTDIR/man"}"
|
||||
NXT_PKGCONFIGDIR="${NXT_PKGCONFIGDIR-"$NXT_DATAROOTDIR/pkgconfig"}"
|
||||
|
||||
NXT_LOCALSTATEDIR="${NXT_LOCALSTATEDIR-"$NXT_PREFIX/var"}"
|
||||
NXT_STATEDIR="${NXT_STATEDIR-"$NXT_LOCALSTATEDIR/lib/unit"}"
|
||||
NXT_LOGDIR="${NXT_LOGDIR-"$NXT_LOCALSTATEDIR/log/unit"}"
|
||||
NXT_LOG="${NXT_LOG-"$NXT_LOGDIR/unit.log"}"
|
||||
NXT_RUNSTATEDIR="${NXT_RUNSTATEDIR-"$NXT_LOCALSTATEDIR/run/unit"}"
|
||||
NXT_CONTROL="${NXT_CONTROL-"unix:$NXT_RUNSTATEDIR/control.unit.sock"}"
|
||||
NXT_PID="${NXT_PID-"$NXT_RUNSTATEDIR/unit.pid"}"
|
||||
|
||||
NXT_TMPDIR="${NXT_TMPDIR-"/tmp"}"
|
||||
278
auto/os/conf
278
auto/os/conf
@@ -1,278 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# To support dynamically loaded modules libnxt library must be a shared
|
||||
# object itself because an application linked with static libnxt library
|
||||
# may lack code required by the modules. Dynamic linkers allow to specify
|
||||
# relative path in SONAME library entry or in RPATH executable entry.
|
||||
#
|
||||
# Solaris 7, Linux 2.2, and FreeBSD 7.3 support $ORIGIN variable.
|
||||
# MacOSX supports @executable_path variable.
|
||||
# NetBSD does not support $ORIGIN variable.
|
||||
#
|
||||
# "ar -r" is enough to create a static library, ranlib is surplus.
|
||||
# "ar -c" disables the "creating archive" warning.
|
||||
|
||||
|
||||
case "$NXT_SYSTEM" in
|
||||
|
||||
Linux)
|
||||
nxt_have=NXT_LINUX . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared -Wl,-soname,libnxt.so"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared \
|
||||
-Wl,-soname,\\\$\$ORIGIN/libnxt.so"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
# "-Wl,-E" exports symbols of executable file.
|
||||
NXT_EXEC_LINK="\$(CC) -Wl,-E"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_LIBRT $NXT_LIBDL $NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
FreeBSD)
|
||||
nxt_have=NXT_FREEBSD . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared -Wl,-soname,libnxt.so"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared \
|
||||
-Wl,-soname,\\\$\$ORIGIN/libnxt.so"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
# "-Wl,-E" exports symbols of executable file.
|
||||
NXT_EXEC_LINK="\$(CC) -Wl,-E"
|
||||
# "-Wl,-z,origin" enables $ORIGIN processing.
|
||||
NXT_SHARED_LOCAL_EXEC_LINK="-Wl,-z,origin"
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_LIBRT $NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
SunOS)
|
||||
nxt_have=NXT_SOLARIS . auto/have
|
||||
|
||||
case "$NXT_CC_NAME" in
|
||||
|
||||
SunC):
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -G -h libnxt.so"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -G -h \\\$\$ORIGIN/libnxt.so"
|
||||
NXT_MODULE_LINK="\$(CC) -G"
|
||||
;;
|
||||
|
||||
*)
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared -Wl,-soname,libnxt.so"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared \
|
||||
-Wl,-soname,\\\$\$ORIGIN/libnxt.so"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
;;
|
||||
esac
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_EXEC_LINK="\$(CC)"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="-lsocket $NXT_LIBSENDFILE"
|
||||
NXT_LIBS="$NXT_LIBS $NXT_LIBRT $NXT_LIBDL $NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
Darwin)
|
||||
nxt_have=NXT_MACOSX . auto/have
|
||||
|
||||
# HFS+ volumes are caseless by default.
|
||||
nxt_have=NXT_HAVE_CASELESS_FILESYSTEM . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -dynamiclib"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -dynamiclib \
|
||||
-install_name @executable_path/libnxt.dylib"
|
||||
NXT_MODULE_LINK="\$(CC) -dynamiclib -undefined dynamic_lookup"
|
||||
|
||||
NXT_EXEC_LINK="\$(CC)"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.dylib"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.dylib"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
# MacOSX libm.dylib is a symlink to libSystem.dylib.
|
||||
NXT_LIBM=
|
||||
NXT_LIBS=
|
||||
|
||||
;;
|
||||
|
||||
NetBSD)
|
||||
nxt_have=NXT_NETBSD . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
# "-Wl,-E" exports symbols of executable file.
|
||||
NXT_EXEC_LINK="\$(CC) -Wl,-E"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_LIBRT $NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
OpenBSD)
|
||||
nxt_have=NXT_OPENBSD . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
# "-Wl,-E" exports symbols of executable file.
|
||||
NXT_EXEC_LINK="\$(CC) -Wl,-E"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
DragonFly)
|
||||
nxt_have=NXT_DRAGONFLY . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
# "-Wl,-E" exports symbols of executable file.
|
||||
NXT_EXEC_LINK="\$(CC) -Wl,-E"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_LIBRT $NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
AIX)
|
||||
nxt_have=NXT_AIX . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -G"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -G"
|
||||
NXT_MODULE_LINK="\$(CC) -G"
|
||||
|
||||
NXT_EXEC_LINK="\$(CC)"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
HP-UX)
|
||||
nxt_have=NXT_HPUX . auto/have
|
||||
|
||||
NXT_EXEC_LINK="\$(CC)"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_PTHREAD $NXT_LIBHG"
|
||||
;;
|
||||
|
||||
QNX)
|
||||
nxt_have=NXT_QNX . auto/have
|
||||
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
NXT_EXEC_LINK="\$(CC)"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_PTHREAD"
|
||||
;;
|
||||
|
||||
*)
|
||||
NXT_STATIC_LINK="\$(AR) -r -c"
|
||||
NXT_SHARED_LINK="\$(CC) -shared"
|
||||
NXT_SHARED_LOCAL_LINK="\$(CC) -shared"
|
||||
NXT_MODULE_LINK="\$(CC) -shared"
|
||||
|
||||
# "-Wl,-E" exports symbols of executable file.
|
||||
NXT_EXEC_LINK="\$(CC) -Wl,-E"
|
||||
NXT_SHARED_LOCAL_EXEC_LINK=
|
||||
|
||||
NXT_LIB_STATIC="libnxt.a"
|
||||
NXT_LIB_SHARED="libnxt.so"
|
||||
NXT_LIB_SHARED_LOCAL="$NXT_BUILD_DIR/lib/libnxt.so"
|
||||
|
||||
NXT_LIB_UNIT_STATIC="libunit.a"
|
||||
|
||||
NXT_LIBM="-lm"
|
||||
NXT_LIBS="$NXT_LIBRT $NXT_LIBDL $NXT_PTHREAD"
|
||||
;;
|
||||
esac
|
||||
101
auto/os/test
101
auto/os/test
@@ -1,101 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
NXT_SYSTEM=`uname -s 2>/dev/null`
|
||||
|
||||
|
||||
case "$NXT_SYSTEM" in
|
||||
|
||||
Linux)
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
# Linux uname -p can return "unknown".
|
||||
NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-cc}
|
||||
AR=${AR:-ar}
|
||||
;;
|
||||
|
||||
FreeBSD | NetBSD | OpenBSD | DragonFly)
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-cc}
|
||||
AR=${AR:-ar}
|
||||
;;
|
||||
|
||||
SunOS)
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-gcc}
|
||||
AR=${AR:-ar}
|
||||
|
||||
NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE"
|
||||
NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
|
||||
NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D__EXTENSIONS__"
|
||||
NXT_TEST_LIBS="-lsocket"
|
||||
;;
|
||||
|
||||
Darwin)
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-cc}
|
||||
AR=${AR:-ar}
|
||||
;;
|
||||
|
||||
AIX)
|
||||
NXT_SYSTEM_VERSION="`uname -v 2>/dev/null`.`uname -r 2>/dev/null`"
|
||||
NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-gcc}
|
||||
AR=${AR:-ar}
|
||||
;;
|
||||
|
||||
HP-UX)
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-gcc}
|
||||
AR=${AR:-ar}
|
||||
|
||||
NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE"
|
||||
NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE_EXTENDED"
|
||||
NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_HPUX_ALT_XOPEN_SOCKET_API"
|
||||
;;
|
||||
|
||||
QNX)
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-gcc}
|
||||
AR=${AR:-ar}
|
||||
;;
|
||||
|
||||
MINGW*)
|
||||
# MinGW /bin/sh builtin "echo" omits newline under Wine
|
||||
# for some reason, so use a portable echo.c program built
|
||||
# using MinGW GCC with only msvcrt.dll dependence.
|
||||
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
|
||||
echo=auto/echo/echo.exe
|
||||
CC=${CC:-cl}
|
||||
AR=${AR:-ar}
|
||||
NXT_WINDOWS=YES
|
||||
;;
|
||||
|
||||
*)
|
||||
NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
|
||||
NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
|
||||
echo=echo
|
||||
CC=${CC:-gcc}
|
||||
AR=${AR:-ar}
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
$echo "configuring Unit $NXT_VERSION" \
|
||||
"for $NXT_SYSTEM $NXT_SYSTEM_VERSION $NXT_SYSTEM_PLATFORM"
|
||||
77
auto/pcre
77
auto/pcre
@@ -1,77 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
nxt_found=no
|
||||
NXT_HAVE_PCRE2=NO
|
||||
|
||||
if [ $NXT_TRY_PCRE2 = YES ]; then
|
||||
if /bin/sh -c "(pcre2-config --version)" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
|
||||
NXT_PCRE_CFLAGS=`pcre2-config --cflags`
|
||||
NXT_PCRE_LIB=`pcre2-config --libs8`
|
||||
|
||||
nxt_feature="PCRE2 library"
|
||||
nxt_feature_name=NXT_HAVE_PCRE2
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs="-DPCRE2_CODE_UNIT_WIDTH=8 $NXT_PCRE_CFLAGS"
|
||||
nxt_feature_libs=$NXT_PCRE_LIB
|
||||
nxt_feature_test="#include <pcre2.h>
|
||||
|
||||
int main(void) {
|
||||
pcre2_code *re;
|
||||
|
||||
re = pcre2_compile((PCRE2_SPTR)\"\",
|
||||
PCRE2_ZERO_TERMINATED, 0,
|
||||
NULL, NULL, NULL);
|
||||
return (re == NULL);
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_PCRE2=YES
|
||||
$echo " + PCRE2 version: `pcre2-config --version`"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
if /bin/sh -c "(pcre-config --version)" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
|
||||
NXT_PCRE_CFLAGS=`pcre-config --cflags`
|
||||
NXT_PCRE_LIB=`pcre-config --libs`
|
||||
|
||||
nxt_feature="PCRE library"
|
||||
nxt_feature_name=NXT_HAVE_PCRE
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=$NXT_PCRE_CFLAGS
|
||||
nxt_feature_libs=$NXT_PCRE_LIB
|
||||
nxt_feature_test="#include <pcre.h>
|
||||
|
||||
int main(void) {
|
||||
pcre *re;
|
||||
|
||||
re = pcre_compile(NULL, 0, NULL, 0, NULL);
|
||||
if (re == NULL)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
$echo " + PCRE version: `pcre-config --version`"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
nxt_have=NXT_HAVE_REGEX . auto/have
|
||||
|
||||
else
|
||||
$echo
|
||||
$echo $0: error: no PCRE library found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
34
auto/save
34
auto/save
@@ -1,34 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
cat << END > $NXT_AUTOCONF_DATA
|
||||
|
||||
NXT_SYSTEM='$NXT_SYSTEM'
|
||||
|
||||
CC='$CC'
|
||||
CFLAGS='$CFLAGS'
|
||||
|
||||
NXT_CC_NAME='$NXT_CC_NAME'
|
||||
NXT_CFLAGS='$NXT_CFLAGS'
|
||||
NXT_CC_OPT='$NXT_CC_OPT'
|
||||
NXT_LD_OPT='$NXT_LD_OPT'
|
||||
NXT_MODULE_LINK='$NXT_MODULE_LINK'
|
||||
|
||||
NXT_TEST_CFLAGS='$NXT_TEST_CFLAGS'
|
||||
NXT_TEST_LIBS='$NXT_TEST_LIBS'
|
||||
|
||||
NXT_LIBRT='$NXT_LIBRT'
|
||||
|
||||
echo=$NXT_BUILD_DIR/bin/echo
|
||||
|
||||
NXT_LIB_AUX_CFLAGS=
|
||||
NXT_LIB_AUX_LIBS=
|
||||
|
||||
NXT_LIB_UNIT_STATIC='$NXT_LIB_UNIT_STATIC'
|
||||
|
||||
NXT_MODULESDIR='$NXT_MODULESDIR'
|
||||
NXT_TMPDIR='$NXT_TMPDIR'
|
||||
|
||||
END
|
||||
164
auto/sendfile
164
auto/sendfile
@@ -1,164 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
NXT_HAVE_LINUX_SENDFILE=NO
|
||||
NXT_HAVE_FREEBSD_SENDFILE=NO
|
||||
NXT_HAVE_MACOSX_SENDFILE=NO
|
||||
NXT_HAVE_SOLARIS_SENDFILEV=NO
|
||||
NXT_HAVE_AIX_SEND_FILE=NO
|
||||
NXT_HAVE_HPUX_SENDFILE=NO
|
||||
|
||||
|
||||
# Linux sendfile().
|
||||
|
||||
nxt_feature="Linux sendfile()"
|
||||
nxt_feature_name=NXT_HAVE_LINUX_SENDFILE
|
||||
nxt_feature_test="#include <sys/sendfile.h>
|
||||
|
||||
int main(void) {
|
||||
off_t offset;
|
||||
|
||||
sendfile(-1, -1, &offset, 0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_LINUX_SENDFILE=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
# FreeBSD sendfile().
|
||||
|
||||
nxt_feature="FreeBSD sendfile()"
|
||||
nxt_feature_name=NXT_HAVE_FREEBSD_SENDFILE
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
off_t sent;
|
||||
|
||||
sendfile(-1, -1, 0, 0, NULL, &sent, 0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_FREEBSD_SENDFILE=YES
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# MacOSX sendfile().
|
||||
|
||||
nxt_feature="MacOSX sendfile()"
|
||||
nxt_feature_name=NXT_HAVE_MACOSX_SENDFILE
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
off_t sent;
|
||||
|
||||
sendfile(-1, -1, 0, &sent, NULL, 0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_MACOSX_SENDFILE=YES
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
# No supported sendfile() found. Using our replacement.
|
||||
nxt_found=yes
|
||||
fi
|
||||
|
||||
|
||||
NXT_LIBSENDFILE=
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Solaris 8 sendfilev().
|
||||
|
||||
nxt_feature="Solaris sendfilev()"
|
||||
nxt_feature_name=NXT_HAVE_SOLARIS_SENDFILEV
|
||||
nxt_feature_libs="-lsendfile"
|
||||
nxt_feature_test="#include <sys/sendfile.h>
|
||||
|
||||
int main(void) {
|
||||
size_t sent;
|
||||
struct sendfilevec vec;
|
||||
|
||||
sendfilev(-1, &vec, 0, &sent);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_SOLARIS_SENDFILEV=YES
|
||||
NXT_LIBSENDFILE=$nxt_feature_libs
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# AIX send_file().
|
||||
|
||||
nxt_feature="AIX send_file()"
|
||||
nxt_feature_name=NXT_HAVE_AIX_SEND_FILE
|
||||
nxt_feature_test="#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
int s;
|
||||
struct sf_parms sf_iobuf;
|
||||
|
||||
send_file(&s, &sf_iobuf, 0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_AIX_SEND_FILE=YES
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# HP-UX sendfile().
|
||||
|
||||
nxt_feature="HP-UX sendfile()"
|
||||
nxt_feature_name=NXT_HAVE_HPUX_SENDFILE
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/socket.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
sbsize_t sendfile(int s, int fd, off_t offset,
|
||||
bsize_t nbytes, const struct iovec *hdtrl, int flags);
|
||||
|
||||
int main(void) {
|
||||
sendfile(-1, -1, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_HAVE_HPUX_SENDFILE=YES
|
||||
fi
|
||||
fi
|
||||
139
auto/shmem
139
auto/shmem
@@ -1,139 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
NXT_SHM_PREFIX="/"
|
||||
|
||||
# FreeBSD, Solaris, MacOSX
|
||||
|
||||
nxt_feature="shm_open()"
|
||||
nxt_feature_name=NXT_HAVE_SHM_OPEN
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int main(void) {
|
||||
int ret;
|
||||
static char name[] = \"/unit.configure\";
|
||||
|
||||
shm_unlink(name);
|
||||
|
||||
int fd = shm_open(name, O_CREAT | O_EXCL | O_RDWR,
|
||||
S_IRUSR | S_IWUSR);
|
||||
if (fd == -1)
|
||||
return 1;
|
||||
|
||||
ret = (access(name, F_OK) == 0);
|
||||
shm_unlink(name);
|
||||
|
||||
return ret;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Linux and NetBSD 7.0 shm_open() are in librt.
|
||||
|
||||
nxt_feature="shm_open() in librt"
|
||||
nxt_feature_libs="-lrt"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBRT=$nxt_feature_libs
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# DragonFly has no separate namespace for shm_open().
|
||||
|
||||
nxt_feature="shm_open() in /tmp directory"
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int main(void) {
|
||||
static char name[] = \"/tmp/unit.configure\";
|
||||
|
||||
shm_unlink(name);
|
||||
|
||||
int fd = shm_open(name, O_CREAT | O_EXCL | O_RDWR,
|
||||
S_IRUSR | S_IWUSR);
|
||||
if (fd == -1)
|
||||
return 1;
|
||||
|
||||
shm_unlink(name);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_SHM_PREFIX="/tmp/"
|
||||
fi
|
||||
fi
|
||||
|
||||
nxt_shm_open_found=$nxt_found
|
||||
|
||||
|
||||
# FreeBSD 8.0
|
||||
|
||||
nxt_feature="shm_open(SHM_ANON)"
|
||||
nxt_feature_name=NXT_HAVE_SHM_OPEN_ANON
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int main(void) {
|
||||
int fd = shm_open(SHM_ANON, O_RDWR, S_IRUSR | S_IWUSR);
|
||||
if (fd == -1)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ "$nxt_shm_open_found" = no ]; then
|
||||
nxt_shm_open_found=$nxt_found
|
||||
fi
|
||||
|
||||
|
||||
# Linux
|
||||
|
||||
nxt_feature="memfd_create()"
|
||||
nxt_feature_name=NXT_HAVE_MEMFD_CREATE
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <linux/memfd.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
int main(void) {
|
||||
static char name[] = \"/unit.configure\";
|
||||
|
||||
int fd = syscall(SYS_memfd_create, name, MFD_CLOEXEC);
|
||||
if (fd == -1)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ "$nxt_shm_open_found$nxt_found" = nono ]; then
|
||||
$echo
|
||||
$echo $0: error: no shared memory implementation found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
280
auto/sockets
280
auto/sockets
@@ -1,280 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
if [ $NXT_INET6 = YES ]; then
|
||||
|
||||
nxt_feature="AF_INET6"
|
||||
nxt_feature_name=NXT_INET6
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
int main(void) {
|
||||
struct sockaddr_in6 sin6;
|
||||
|
||||
sin6.sin6_family = AF_INET6;
|
||||
printf(\"%d\", sin6.sin6_family);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# FreeBSD, MacOSX, NetBSD, OpenBSD.
|
||||
|
||||
nxt_feature="sockaddr.sa_len"
|
||||
nxt_feature_name=NXT_SOCKADDR_SA_LEN
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
struct sockaddr sa;
|
||||
|
||||
sa.sa_len = 0;
|
||||
printf(\"%d\", sa.sa_len);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="struct sockaddr size"
|
||||
nxt_feature_name=NXT_HAVE_SOCKADDR
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(struct sockaddr));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="struct sockaddr_in size"
|
||||
nxt_feature_name=NXT_HAVE_SOCKADDR_IN
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(struct sockaddr_in));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="struct sockaddr_in6 size"
|
||||
nxt_feature_name=NXT_HAVE_SOCKADDR_IN6
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(struct sockaddr_in6));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="struct sockaddr_un size"
|
||||
nxt_feature_name=NXT_HAVE_SOCKADDR_UN
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(struct sockaddr_un));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="struct sockaddr_storage size"
|
||||
nxt_feature_name=NXT_HAVE_SOCKADDR_STORAGE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(struct sockaddr_storage));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="socketpair(AF_UNIX, SOCK_SEQPACKET)"
|
||||
nxt_feature_name=NXT_HAVE_AF_UNIX_SOCK_SEQPACKET
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
int pair[2];
|
||||
|
||||
if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, pair) != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="struct msghdr.msg_control"
|
||||
nxt_feature_name=NXT_HAVE_MSGHDR_MSG_CONTROL
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
struct msghdr msg;
|
||||
|
||||
printf(\"%d\", (int) sizeof(msg.msg_control));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
$echo
|
||||
$echo $0: error: no msghdr.msg_control struct member.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_SYSTEM != DragonFly ]; then
|
||||
nxt_feature="sockopt SO_PASSCRED"
|
||||
nxt_feature_name=NXT_HAVE_SOCKOPT_SO_PASSCRED
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
return SO_PASSCRED == 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
nxt_feature="struct ucred"
|
||||
nxt_feature_name=NXT_HAVE_UCRED
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
int main(void) {
|
||||
return sizeof(struct ucred);
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="struct cmsgcred"
|
||||
nxt_feature_name=NXT_HAVE_MSGHDR_CMSGCRED
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
return sizeof(struct cmsgcred);
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="sys/filio.h"
|
||||
nxt_feature_name=NXT_HAVE_SYS_FILIO_H
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <sys/filio.h>
|
||||
|
||||
int main(void) {
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="ioctl(FIONBIO)"
|
||||
nxt_feature_name=NXT_HAVE_FIONBIO
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
int main(void) {
|
||||
int nb;
|
||||
|
||||
nb = 0;
|
||||
ioctl(-1, FIONBIO, &nb);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# socket(SOCK_NONBLOCK), Linux 2.6.27/glibc 2.10, NetBSD 6.0, FreeBSD 9.2.
|
||||
|
||||
nxt_feature="socket(SOCK_NONBLOCK)"
|
||||
nxt_feature_name=NXT_HAVE_SOCK_NONBLOCK
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# accept4(), Linux 2.6.28/glibc 2.10, NetBSD 6.0, FreeBSD 9.2.
|
||||
|
||||
nxt_feature="accept4()"
|
||||
nxt_feature_name=NXT_HAVE_ACCEPT4
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
accept4(0, NULL, NULL, SOCK_NONBLOCK);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
313
auto/sources
313
auto/sources
@@ -1,313 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
NXT_LIB_SRCS=" \
|
||||
src/nxt_lib.c \
|
||||
src/nxt_gmtime.c \
|
||||
src/nxt_errno.c \
|
||||
src/nxt_time.c \
|
||||
src/nxt_malloc.c \
|
||||
src/nxt_file.c \
|
||||
src/nxt_mem_map.c \
|
||||
src/nxt_socket.c \
|
||||
src/nxt_socketpair.c \
|
||||
src/nxt_socket_msg.c \
|
||||
src/nxt_credential.c \
|
||||
src/nxt_isolation.c \
|
||||
src/nxt_process.c \
|
||||
src/nxt_process_title.c \
|
||||
src/nxt_signal.c \
|
||||
src/nxt_port_socket.c \
|
||||
src/nxt_port_memory.c \
|
||||
src/nxt_port_rpc.c \
|
||||
src/nxt_port.c \
|
||||
src/nxt_dyld.c \
|
||||
src/nxt_random.c \
|
||||
src/nxt_queue.c \
|
||||
src/nxt_rbtree.c \
|
||||
src/nxt_mp.c \
|
||||
src/nxt_mem_zone.c \
|
||||
src/nxt_string.c \
|
||||
src/nxt_utf8.c \
|
||||
src/nxt_parse.c \
|
||||
src/nxt_sprintf.c \
|
||||
src/nxt_var.c \
|
||||
src/nxt_tstr.c \
|
||||
src/nxt_file_name.c \
|
||||
src/nxt_log.c \
|
||||
src/nxt_djb_hash.c \
|
||||
src/nxt_murmur_hash.c \
|
||||
src/nxt_lvlhsh.c \
|
||||
src/nxt_array.c \
|
||||
src/nxt_vector.c \
|
||||
src/nxt_list.c \
|
||||
src/nxt_buf.c \
|
||||
src/nxt_buf_pool.c \
|
||||
src/nxt_recvbuf.c \
|
||||
src/nxt_sendbuf.c \
|
||||
src/nxt_thread.c \
|
||||
src/nxt_thread_mutex.c \
|
||||
src/nxt_thread_cond.c \
|
||||
src/nxt_spinlock.c \
|
||||
src/nxt_semaphore.c \
|
||||
src/nxt_thread_pool.c \
|
||||
src/nxt_thread_time.c \
|
||||
src/nxt_time_parse.c \
|
||||
src/nxt_work_queue.c \
|
||||
src/nxt_service.c \
|
||||
src/nxt_log_moderation.c \
|
||||
src/nxt_event_engine.c \
|
||||
src/nxt_timer.c \
|
||||
src/nxt_fd_event.c \
|
||||
src/nxt_conn.c \
|
||||
src/nxt_conn_connect.c \
|
||||
src/nxt_conn_accept.c \
|
||||
src/nxt_conn_read.c \
|
||||
src/nxt_conn_write.c \
|
||||
src/nxt_conn_close.c \
|
||||
src/nxt_event_conn_job_sendfile.c \
|
||||
src/nxt_conn_proxy.c \
|
||||
src/nxt_job.c \
|
||||
src/nxt_sockaddr.c \
|
||||
src/nxt_listen_socket.c \
|
||||
src/nxt_upstream.c \
|
||||
src/nxt_upstream_round_robin.c \
|
||||
src/nxt_http_parse.c \
|
||||
src/nxt_app_log.c \
|
||||
src/nxt_capability.c \
|
||||
src/nxt_runtime.c \
|
||||
src/nxt_conf.c \
|
||||
src/nxt_conf_validation.c \
|
||||
src/nxt_main_process.c \
|
||||
src/nxt_signal_handlers.c \
|
||||
src/nxt_controller.c \
|
||||
src/nxt_router.c \
|
||||
src/nxt_router_access_log.c \
|
||||
src/nxt_h1proto.c \
|
||||
src/nxt_status.c \
|
||||
src/nxt_http_request.c \
|
||||
src/nxt_http_response.c \
|
||||
src/nxt_http_error.c \
|
||||
src/nxt_http_route.c \
|
||||
src/nxt_http_route_addr.c \
|
||||
src/nxt_http_rewrite.c \
|
||||
src/nxt_http_set_headers.c \
|
||||
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 \
|
||||
src/nxt_sha1.c \
|
||||
src/nxt_websocket.c \
|
||||
src/nxt_websocket_accept.c \
|
||||
src/nxt_http_websocket.c \
|
||||
src/nxt_h1proto_websocket.c \
|
||||
src/nxt_fs.c \
|
||||
"
|
||||
|
||||
|
||||
NXT_LIB_UNIT_SRCS="src/nxt_unit.c"
|
||||
|
||||
|
||||
NXT_LIB_TLS_DEPS="src/nxt_tls.h"
|
||||
NXT_LIB_TLS_SRCS="src/nxt_cert.c"
|
||||
NXT_LIB_OPENSSL_SRCS="src/nxt_openssl.c"
|
||||
NXT_LIB_GNUTLS_SRCS="src/nxt_gnutls.c"
|
||||
NXT_LIB_CYASSL_SRCS="src/nxt_cyassl.c"
|
||||
NXT_LIB_POLARSSL_SRCS="src/nxt_polarssl.c"
|
||||
|
||||
NXT_LIB_PCRE_SRCS="src/nxt_pcre.c"
|
||||
NXT_LIB_PCRE2_SRCS="src/nxt_pcre2.c"
|
||||
|
||||
if [ "$NXT_NJS" != "NO" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_js.c src/nxt_http_js.c src/nxt_script.c"
|
||||
fi
|
||||
|
||||
NXT_LIB_EPOLL_SRCS="src/nxt_epoll_engine.c"
|
||||
NXT_LIB_KQUEUE_SRCS="src/nxt_kqueue_engine.c"
|
||||
NXT_LIB_EVENTPORT_SRCS="src/nxt_eventport_engine.c"
|
||||
NXT_LIB_DEVPOLL_SRCS="src/nxt_devpoll_engine.c"
|
||||
NXT_LIB_POLLSET_SRCS="src/nxt_pollset_engine.c"
|
||||
NXT_LIB_POLL_SRCS="src/nxt_poll_engine.c"
|
||||
NXT_LIB_SELECT_SRCS="src/nxt_select_engine.c"
|
||||
|
||||
NXT_LIB_LINUX_SENDFILE_SRCS="src/nxt_linux_sendfile.c"
|
||||
NXT_LIB_FREEBSD_SENDFILE_SRCS="src/nxt_freebsd_sendfile.c"
|
||||
NXT_LIB_SOLARIS_SENDFILEV_SRCS="src/nxt_solaris_sendfilev.c"
|
||||
NXT_LIB_MACOSX_SENDFILE_SRCS="src/nxt_macosx_sendfile.c"
|
||||
NXT_LIB_AIX_SEND_FILE_SRCS="src/nxt_aix_send_file.c"
|
||||
NXT_LIB_HPUX_SENDFILE_SRCS="src/nxt_hpux_sendfile.c"
|
||||
NXT_LIB_CLONE_SRCS="src/nxt_clone.c"
|
||||
|
||||
NXT_TEST_BUILD_DEPS="src/nxt_test_build.h"
|
||||
NXT_TEST_BUILD_SRCS="src/nxt_test_build.c"
|
||||
|
||||
NXT_TEST_DEPS="src/test/nxt_tests.h \
|
||||
src/test/nxt_rbtree1.h \
|
||||
"
|
||||
|
||||
NXT_TEST_SRCS=" \
|
||||
src/test/nxt_tests.c \
|
||||
src/test/nxt_rbtree1.c \
|
||||
src/test/nxt_rbtree_test.c \
|
||||
src/test/nxt_term_parse_test.c \
|
||||
src/test/nxt_msec_diff_test.c \
|
||||
src/test/nxt_mp_test.c \
|
||||
src/test/nxt_mem_zone_test.c \
|
||||
src/test/nxt_lvlhsh_test.c \
|
||||
src/test/nxt_gmtime_test.c \
|
||||
src/test/nxt_sprintf_test.c \
|
||||
src/test/nxt_malloc_test.c \
|
||||
src/test/nxt_utf8_test.c \
|
||||
src/test/nxt_rbtree1_test.c \
|
||||
src/test/nxt_http_parse_test.c \
|
||||
src/test/nxt_strverscmp_test.c \
|
||||
src/test/nxt_base64_test.c \
|
||||
"
|
||||
|
||||
|
||||
if [ $NXT_HAVE_CLONE_NEWUSER = YES ]; then
|
||||
NXT_TEST_SRCS="$NXT_TEST_SRCS src/test/nxt_clone_test.c"
|
||||
fi
|
||||
|
||||
|
||||
NXT_LIB_UTF8_FILE_NAME_TEST_SRCS=" \
|
||||
src/test/nxt_utf8_file_name_test.c \
|
||||
"
|
||||
|
||||
|
||||
if [ $NXT_HAVE_ROOTFS = YES ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_fs_mount.c"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TLS = YES ]; then
|
||||
nxt_have=NXT_TLS . auto/have
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_TLS_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_OPENSSL = YES ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_OPENSSL_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_GNUTLS = YES ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_GNUTLS_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_CYASSL = YES ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_CYASSL_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_POLARSSL = YES ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_POLARSSL_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_REGEX" = "YES" ]; then
|
||||
if [ "$NXT_HAVE_PCRE2" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_PCRE2_SRCS"
|
||||
else
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_PCRE_SRCS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$NXT_HAVE_EPOLL" = "YES" -o "$NXT_TEST_BUILD_EPOLL" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_EPOLL_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_KQUEUE" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_KQUEUE_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_EVENTPORT" = "YES" -o "$NXT_TEST_BUILD_EVENTPORT" = "YES" ];
|
||||
then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_EVENTPORT_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_DEVPOLL" = "YES" -o "$NXT_TEST_BUILD_DEVPOLL" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_DEVPOLL_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_POLLSET" = "YES" -o "$NXT_TEST_BUILD_POLLSET" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_POLLSET_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_POLL_SRCS"
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_SELECT_SRCS"
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_LINUX_SENDFILE" = "YES" \
|
||||
-o "$NXT_TEST_BUILD_LINUX_SENDFILE" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_LINUX_SENDFILE_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_FREEBSD_SENDFILE" = "YES" \
|
||||
-o "$NXT_TEST_BUILD_FREEBSD_SENDFILE" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_FREEBSD_SENDFILE_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_SOLARIS_SENDFILEV" = "YES" \
|
||||
-o "$NXT_TEST_BUILD_SOLARIS_SENDFILEV" = "YES" ];
|
||||
then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_SOLARIS_SENDFILEV_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_MACOSX_SENDFILE" = "YES" \
|
||||
-o "$NXT_TEST_BUILD_MACOSX_SENDFILE" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_MACOSX_SENDFILE_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_AIX_SEND_FILE" = "YES" \
|
||||
-o "$NXT_TEST_BUILD_AIX_SEND_FILE" = "YES" ];
|
||||
then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_AIX_SEND_FILE_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_HPUX_SENDFILE" = "YES" \
|
||||
-o "$NXT_TEST_BUILD_HPUX_SENDFILE" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_HPUX_SENDFILE_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_LINUX_NS" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_CLONE_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_HAVE_CGROUP" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_cgroup.c"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$NXT_TEST_BUILD" = "YES" ]; then
|
||||
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_TEST_BUILD_SRCS"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TESTS = YES ]; then
|
||||
nxt_have=NXT_TESTS . auto/have
|
||||
fi
|
||||
|
||||
|
||||
NXT_SRCS=" \
|
||||
src/nxt_main.c \
|
||||
"
|
||||
215
auto/ssltls
215
auto/ssltls
@@ -1,215 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
NXT_OPENSSL_CFLAGS=
|
||||
NXT_OPENSSL_LIBS=
|
||||
NXT_GNUTLS_CFLAGS=
|
||||
NXT_GNUTLS_LIBS=
|
||||
NXT_OPENSSL_LIBS=
|
||||
NXT_CYASSL_CFLAGS=
|
||||
NXT_CYASSL_LIBS=
|
||||
NXT_POLARSSL_CFLAGS=
|
||||
NXT_POLARSSL_LIBS=
|
||||
|
||||
|
||||
if [ $NXT_OPENSSL = YES ]; then
|
||||
|
||||
nxt_feature="OpenSSL library"
|
||||
nxt_feature_name=NXT_HAVE_OPENSSL
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="-lssl -lcrypto"
|
||||
nxt_feature_test="#include <openssl/ssl.h>
|
||||
|
||||
int main(void) {
|
||||
SSL_library_init();
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_TLS=YES
|
||||
NXT_OPENSSL_LIBS="$nxt_feature_libs"
|
||||
|
||||
nxt_feature="OpenSSL version"
|
||||
nxt_feature_name=NXT_HAVE_OPENSSL_VERSION
|
||||
nxt_feature_run=value
|
||||
nxt_feature_test="#include <openssl/ssl.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"\\\"%s\\\"\",
|
||||
SSLeay_version(SSLEAY_VERSION));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
else
|
||||
$echo
|
||||
$echo $0: error: no OpenSSL library found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="OpenSSL SSL_CONF_cmd()"
|
||||
nxt_feature_name=NXT_HAVE_OPENSSL_CONF_CMD
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="$NXT_OPENSSL_LIBS"
|
||||
nxt_feature_test="#include <openssl/ssl.h>
|
||||
|
||||
int main(void) {
|
||||
SSL_CONF_cmd(NULL, NULL, NULL);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="OpenSSL tlsext support"
|
||||
nxt_feature_name=NXT_HAVE_OPENSSL_TLSEXT
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="$NXT_OPENSSL_LIBS"
|
||||
nxt_feature_test="#include <openssl/ssl.h>
|
||||
|
||||
int main(void) {
|
||||
#if (OPENSSL_NO_TLSEXT)
|
||||
#error OpenSSL: no tlsext support.
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_GNUTLS = YES ]; then
|
||||
|
||||
if /bin/sh -c "(pkg-config gnutls --exists)" >> $NXT_AUTOCONF_ERR 2>&1;
|
||||
then
|
||||
NXT_GNUTLS_CFLAGS=`pkg-config gnutls --cflags`
|
||||
NXT_GNUTLS_LIBS=`pkg-config gnutls --libs`
|
||||
|
||||
nxt_feature="GnuTLS library"
|
||||
nxt_feature_name=NXT_HAVE_GNUTLS
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=$NXT_GNUTLS_CFLAGS
|
||||
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
||||
nxt_feature_test="#include <gnutls/gnutls.h>
|
||||
|
||||
int main(void) {
|
||||
gnutls_global_init();
|
||||
gnutls_global_deinit();
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_TLS=YES
|
||||
|
||||
$echo " + GnuTLS version: `pkg-config gnutls --modversion`"
|
||||
|
||||
|
||||
nxt_feature="gnutls_transport_set_vec_push_function"
|
||||
nxt_feature_name=NXT_HAVE_GNUTLS_VEC_PUSH
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=$NXT_GNUTLS_CFLAGS
|
||||
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
||||
nxt_feature_test="#include <gnutls/gnutls.h>
|
||||
|
||||
int main(void) {
|
||||
gnutls_transport_set_vec_push_function(NULL, NULL);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="gnutls_global_set_time_function"
|
||||
nxt_feature_name=NXT_HAVE_GNUTLS_SET_TIME
|
||||
nxt_feature_run=no
|
||||
nxt_feature_incs=$NXT_GNUTLS_CFLAGS
|
||||
nxt_feature_libs=$NXT_GNUTLS_LIBS
|
||||
nxt_feature_test="#include <gnutls/gnutls.h>
|
||||
|
||||
int main(void) {
|
||||
gnutls_global_set_time_function(NULL);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
else
|
||||
$echo
|
||||
$echo $0: error: no GnuTLS library found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_CYASSL = YES ]; then
|
||||
|
||||
nxt_feature="CyaSSL library"
|
||||
nxt_feature_name=NXT_HAVE_CYASSL
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="-lcyassl"
|
||||
nxt_feature_test="#include <cyassl/ssl.h>
|
||||
|
||||
int main(void) {
|
||||
CyaSSL_Init();
|
||||
CyaSSL_Cleanup();
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_TLS=YES
|
||||
NXT_CYASSL_CFLAGS="$nxt_feature_incs"
|
||||
NXT_CYASSL_LIBS="$nxt_feature_libs"
|
||||
|
||||
else
|
||||
$echo
|
||||
$echo $0: error: no CyaSSL library found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_POLARSSL = YES ]; then
|
||||
|
||||
nxt_feature="PolarSSL library"
|
||||
nxt_feature_name=NXT_HAVE_POLARSSL
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="-lpolarssl"
|
||||
nxt_feature_test="#include <polarssl/ssl.h>
|
||||
|
||||
int main(void) {
|
||||
ssl_context ssl;
|
||||
memset(&ssl, '\0', sizeof(ssl));
|
||||
ssl_init(&ssl);
|
||||
ssl_free(&ssl);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_TLS=YES
|
||||
NXT_POLARSSL_CFLAGS="$nxt_feature_incs"
|
||||
NXT_POLARSSL_LIBS="$nxt_feature_libs"
|
||||
|
||||
else
|
||||
$echo
|
||||
$echo $0: error: no PolarSSL library found.
|
||||
$echo
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
39
auto/summary
39
auto/summary
@@ -1,39 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
cat << END
|
||||
|
||||
Unit configuration summary:
|
||||
|
||||
bin directory: ............. "$NXT_BINDIR"
|
||||
sbin directory: ............ "$NXT_SBINDIR"
|
||||
lib directory: ............. "$NXT_LIBDIR"
|
||||
include directory: ......... "$NXT_INCLUDEDIR"
|
||||
pkgconfig directory: ....... "$NXT_PKGCONFIGDIR"
|
||||
man pages directory: ....... "$NXT_MANDIR"
|
||||
modules directory: ......... "$NXT_MODULESDIR"
|
||||
state directory: ........... "$NXT_STATEDIR"
|
||||
tmp directory: ............. "$NXT_TMPDIR"
|
||||
|
||||
pid file: .................. "$NXT_PID"
|
||||
log file: .................. "$NXT_LOG"
|
||||
|
||||
control API socket: ........ "$NXT_CONTROL"
|
||||
|
||||
non-privileged user: ....... "$NXT_USER"
|
||||
non-privileged group: ...... "$NXT_GROUP"
|
||||
|
||||
IPv6 support: .............. $NXT_INET6
|
||||
Unix domain sockets support: $NXT_UNIX_DOMAIN
|
||||
TLS support: ............... $NXT_OPENSSL
|
||||
Regex support: ............. $NXT_REGEX
|
||||
NJS support: ............... $NXT_NJS
|
||||
|
||||
process isolation: ......... $NXT_ISOLATION
|
||||
cgroupv2: .................. $NXT_HAVE_CGROUP
|
||||
|
||||
debug logging: ............. $NXT_DEBUG
|
||||
|
||||
END
|
||||
@@ -1,76 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
NXT_TEST_BUILD=NO
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_EPOLL = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_EPOLL . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_EVENTPORT = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_EVENTPORT . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_DEVPOLL = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_DEVPOLL . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_POLLSET = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_POLLSET . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_LINUX_SENDFILE = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_LINUX_SENDFILE . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_FREEBSD_SENDFILE = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_FREEBSD_SENDFILE . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_SOLARIS_SENDFILEV = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_SOLARIS_SENDFILEV . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_MACOSX_SENDFILE = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_MACOSX_SENDFILE . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_AIX_SEND_FILE = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_AIX_SEND_FILE . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
|
||||
|
||||
if [ $NXT_TEST_BUILD_HPUX_SENDFILE = YES ]; then
|
||||
nxt_have=NXT_TEST_BUILD_HPUX_SENDFILE . auto/have
|
||||
nxt_have=NXT_TEST_BUILD . auto/have
|
||||
NXT_TEST_BUILD=YES
|
||||
fi
|
||||
258
auto/threads
258
auto/threads
@@ -1,258 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
case "$NXT_SYSTEM" in
|
||||
|
||||
Linux)
|
||||
NXT_PTHREAD="-lpthread"
|
||||
;;
|
||||
|
||||
FreeBSD)
|
||||
# FreeBSD libc supports only pthread stubs.
|
||||
NXT_PTHREAD="-lpthread"
|
||||
;;
|
||||
|
||||
SunOS)
|
||||
case "$NXT_SYSTEM_VERSION" in
|
||||
5.8 | 5.9)
|
||||
NXT_PTHREAD="-lpthread"
|
||||
;;
|
||||
*)
|
||||
# Solaris 10 libpthread.so.1 is a filter to libc.so.1.
|
||||
NXT_PTHREAD=
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
Darwin)
|
||||
# MacOSX libpthread.dylib is a symlink to libSystem.dylib.
|
||||
NXT_PTHREAD=
|
||||
;;
|
||||
|
||||
*)
|
||||
NXT_PTHREAD="-lpthread"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# Linux, FreeBSD.
|
||||
|
||||
nxt_feature="pthread_yield()"
|
||||
nxt_feature_name=NXT_HAVE_PTHREAD_YIELD
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=$NXT_PTHREAD
|
||||
nxt_feature_test="#define _GNU_SOURCE
|
||||
#include <pthread.h>
|
||||
|
||||
int main(void) {
|
||||
pthread_yield();
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# MacOSX.
|
||||
|
||||
nxt_feature="pthread_yield_np()"
|
||||
nxt_feature_name=NXT_HAVE_PTHREAD_YIELD_NP
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=$NXT_PTHREAD
|
||||
nxt_feature_test="#include <pthread.h>
|
||||
|
||||
int main(void) {
|
||||
pthread_yield_np();
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# FreeBSD, Solaris, AIX.
|
||||
|
||||
nxt_feature="pthread spinlock"
|
||||
nxt_feature_name=NXT_HAVE_PTHREAD_SPINLOCK
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=$NXT_PTHREAD
|
||||
nxt_feature_test="#include <pthread.h>
|
||||
|
||||
int main(void) {
|
||||
pthread_spinlock_t lock;
|
||||
|
||||
if (pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE) != 0)
|
||||
return 1;
|
||||
if (pthread_spin_lock(&lock) != 0)
|
||||
return 1;
|
||||
if (pthread_spin_unlock(&lock) != 0)
|
||||
return 1;
|
||||
if (pthread_spin_destroy(&lock) != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
|
||||
# Linux glibc uses 0 as pthread_spinlock_t initial value on the most
|
||||
# platforms. However, on i386 and x86_64 the initial value is 1.
|
||||
|
||||
nxt_feature="pthread spinlock zero initial value"
|
||||
nxt_feature_name=NXT_HAVE_PTHREAD_SPINLOCK_ZERO
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=$NXT_PTHREAD
|
||||
nxt_feature_test="#include <pthread.h>
|
||||
|
||||
pthread_spinlock_t lock = 0;
|
||||
|
||||
int main(void) {
|
||||
if (pthread_spin_trylock(&lock) != 0)
|
||||
return 1;
|
||||
if (pthread_spin_unlock(&lock) != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="sem_timedwait()"
|
||||
nxt_feature_name=NXT_HAVE_SEM_TIMEDWAIT
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <semaphore.h>
|
||||
|
||||
int main(void) {
|
||||
sem_t sem;
|
||||
struct timespec ts;
|
||||
|
||||
if (sem_init(&sem, 0, 0) != 0)
|
||||
return 1;
|
||||
if (sem_post(&sem) != 0)
|
||||
return 1;
|
||||
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 0;
|
||||
if (sem_timedwait(&sem, &ts) != 0)
|
||||
return 1;
|
||||
|
||||
if (sem_destroy(&sem) != 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
if [ -n "$NXT_PTHREAD" ]; then
|
||||
|
||||
# Linux requires libpthread.
|
||||
|
||||
nxt_feature="sem_timedwait() in libpthread"
|
||||
nxt_feature_libs=$NXT_PTHREAD
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Solaris 10 requires librt.
|
||||
|
||||
nxt_feature="sem_timedwait() in librt"
|
||||
nxt_feature_libs="-lrt"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBRT="-lrt"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Thread Local Storage / Thread Specific Data.
|
||||
#
|
||||
# Linux, FreeBSD 5.3, Solaris.
|
||||
# MacOSX 10.7 (Lion) Clang.
|
||||
|
||||
nxt_feature="__thread"
|
||||
nxt_feature_name=NXT_HAVE_THREAD_STORAGE_CLASS
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=$NXT_PTHREAD
|
||||
nxt_feature_test="#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
__thread int key;
|
||||
|
||||
void *func(void *p);
|
||||
|
||||
void *func(void *p) {
|
||||
key = 0x9abcdef0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
void *n;
|
||||
pthread_t pt;
|
||||
|
||||
key = 0x12345678;
|
||||
if (pthread_create(&pt, NULL, func, NULL))
|
||||
return 1;
|
||||
if (pthread_join(pt, &n))
|
||||
return 1;
|
||||
if (key != 0x12345678)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# MacOSX GCC lacks __thread support.
|
||||
# On NetBSD __thread causes segmentation fault.
|
||||
|
||||
nxt_feature="phtread_key_t"
|
||||
nxt_feature_name=NXT_HAVE_PTHREAD_SPECIFIC_DATA
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=$NXT_PTHREAD
|
||||
nxt_feature_test="#include <pthread.h>
|
||||
|
||||
int main(void) {
|
||||
pthread_key_t key = -1;
|
||||
|
||||
if (pthread_key_create(&key, NULL))
|
||||
return 1;
|
||||
if (pthread_setspecific(key, (void *) 0x12345678))
|
||||
return 1;
|
||||
if (pthread_getspecific(key) != (void *) 0x12345678)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="PTHREAD_KEYS_MAX"
|
||||
nxt_feature_name=
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <limits.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", PTHREAD_KEYS_MAX);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
224
auto/time
224
auto/time
@@ -1,224 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Linux 2.6.32 CLOCK_REALTIME_COARSE.
|
||||
# Linux clock_gettime() is in librt.
|
||||
|
||||
nxt_feature="Linux clock_gettime(CLOCK_REALTIME_COARSE)"
|
||||
nxt_feature_name=NXT_HAVE_CLOCK_REALTIME_COARSE
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="-lrt"
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
struct timespec ts;
|
||||
|
||||
if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) == -1)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBRT=$nxt_feature_libs
|
||||
fi
|
||||
|
||||
|
||||
# FreeBSD 7.0 CLOCK_REALTIME_FAST
|
||||
|
||||
nxt_feature="FreeBSD clock_gettime(CLOCK_REALTIME_FAST)"
|
||||
nxt_feature_name=NXT_HAVE_CLOCK_REALTIME_FAST
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
struct timespec ts;
|
||||
|
||||
if (clock_gettime(CLOCK_REALTIME_FAST, &ts) == -1)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="clock_gettime(CLOCK_REALTIME)"
|
||||
nxt_feature_name=NXT_HAVE_CLOCK_REALTIME
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
struct timespec ts;
|
||||
|
||||
if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Linux and Solaris 10 clock_gettime() are in librt.
|
||||
|
||||
nxt_feature="clock_gettime(CLOCK_REALTIME) in librt"
|
||||
nxt_feature_libs="-lrt"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBRT=$nxt_feature_libs
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Linux 2.6.32 CLOCK_MONOTONIC_COARSE.
|
||||
# Linux clock_gettime() is in librt.
|
||||
|
||||
nxt_feature="Linux clock_gettime(CLOCK_MONOTONIC_COARSE)"
|
||||
nxt_feature_name=NXT_HAVE_CLOCK_MONOTONIC_COARSE
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="-lrt"
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
struct timespec ts;
|
||||
|
||||
if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == -1)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBRT=$nxt_feature_libs
|
||||
fi
|
||||
|
||||
|
||||
# FreeBSD 7.0 CLOCK_MONOTONIC_FAST
|
||||
|
||||
nxt_feature="FreeBSD clock_gettime(CLOCK_MONOTONIC_FAST)"
|
||||
nxt_feature_name=NXT_HAVE_CLOCK_MONOTONIC_FAST
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
struct timespec ts;
|
||||
|
||||
if (clock_gettime(CLOCK_MONOTONIC_FAST, &ts) == -1)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="clock_gettime(CLOCK_MONOTONIC)"
|
||||
nxt_feature_name=NXT_HAVE_CLOCK_MONOTONIC
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
struct timespec ts;
|
||||
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
|
||||
return 1;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Linux and Solaris 10 clock_gettime() are in librt.
|
||||
|
||||
nxt_feature="clock_gettime(CLOCK_MONOTONIC) in librt"
|
||||
nxt_feature_libs="-lrt"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBRT=$nxt_feature_libs
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# HP-UX Mercury Library hg_gethrtime().
|
||||
|
||||
NXT_LIBHG=
|
||||
|
||||
nxt_feature="HP-UX hg_gethrtime()"
|
||||
nxt_feature_name=NXT_HAVE_HG_GETHRTIME
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs="-lhg"
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <sys/mercury.h>
|
||||
|
||||
int main(void) {
|
||||
hg_gethrtime();
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBHG=$nxt_feature_libs
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="struct tm.tm_gmtoff"
|
||||
nxt_feature_name=NXT_HAVE_TM_GMTOFF
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
time_t t;
|
||||
struct tm tm;
|
||||
|
||||
t = 0;
|
||||
localtime_r(&t, &tm);
|
||||
return tm.tm_gmtoff;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="altzone"
|
||||
nxt_feature_name=NXT_HAVE_ALTZONE
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
altzone = 0;
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="localtime_r()"
|
||||
nxt_feature_name=NXT_HAVE_LOCALTIME_R
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
time_t t;
|
||||
struct tm tm;
|
||||
|
||||
t = 0;
|
||||
localtime_r(&t, &tm);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
118
auto/types
118
auto/types
@@ -1,118 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Sizes of C types.
|
||||
|
||||
# "-Wall -Werror" or similar constraints in default CFLAGS may require
|
||||
# to use "%zu" format to printf() result of sizeof(). But "%zu" may
|
||||
# be unavailable, so the "(int)" cast is a simple and portable solution:
|
||||
# printf("%d", (int) sizeof(TYPE));
|
||||
|
||||
|
||||
nxt_feature="int size"
|
||||
nxt_feature_name=NXT_INT_SIZE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(int));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="long size"
|
||||
nxt_feature_name=NXT_LONG_SIZE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(long));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="long long size"
|
||||
nxt_feature_name=NXT_LONG_LONG_SIZE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(long long));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="void * size"
|
||||
nxt_feature_name=NXT_PTR_SIZE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(void *));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
case "$nxt_feature_value" in
|
||||
8) NXT_64BIT=1 ;;
|
||||
*) NXT_64BIT=0 ;;
|
||||
esac
|
||||
|
||||
|
||||
nxt_feature="size_t size"
|
||||
nxt_feature_name=NXT_SIZE_T_SIZE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(size_t));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="off_t size"
|
||||
nxt_feature_name=NXT_OFF_T_SIZE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _FILE_OFFSET_BITS 64
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(off_t));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
nxt_feature="time_t size"
|
||||
nxt_feature_name=NXT_TIME_T_SIZE
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf(\"%d\", (int) sizeof(time_t));
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
211
auto/unix
211
auto/unix
@@ -1,211 +0,0 @@
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Linux 3.17 with glibc 2.25, FreeBSD 12, Solaris 11.3.
|
||||
|
||||
nxt_feature="getrandom()"
|
||||
nxt_feature_name=NXT_HAVE_GETRANDOM
|
||||
nxt_feature_run=yes
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <unistd.h>
|
||||
#include <sys/random.h>
|
||||
|
||||
int main(void) {
|
||||
char buf[4];
|
||||
|
||||
if (getrandom(buf, 4, 0) < 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Linux 3.17 SYS_getrandom.
|
||||
|
||||
nxt_feature="SYS_getrandom in Linux"
|
||||
nxt_feature_name=NXT_HAVE_LINUX_SYS_GETRANDOM
|
||||
nxt_feature_test="#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/random.h>
|
||||
|
||||
int main(void) {
|
||||
char buf[4];
|
||||
|
||||
if (syscall(SYS_getrandom, buf, 4, 0) < 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# OpenBSD 5.6 lacks <sys/random.h>.
|
||||
|
||||
nxt_feature="getentropy()"
|
||||
nxt_feature_name=NXT_HAVE_GETENTROPY
|
||||
nxt_feature_test="#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
char buf[4];
|
||||
|
||||
if (getentropy(buf, 4) == -1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# macOS 10.12.
|
||||
|
||||
nxt_feature="getentropy() in sys/random.h"
|
||||
nxt_feature_name=NXT_HAVE_GETENTROPY_SYS_RANDOM
|
||||
nxt_feature_test="#include <unistd.h>
|
||||
#include <sys/random.h>
|
||||
|
||||
int main(void) {
|
||||
char buf[4];
|
||||
|
||||
if (getentropy(buf, 4) == -1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="ucontext"
|
||||
nxt_feature_name=NXT_HAVE_UCONTEXT
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <ucontext.h>
|
||||
|
||||
int main(void) {
|
||||
ucontext_t uc;
|
||||
|
||||
if (getcontext(&uc) == 0) {
|
||||
makecontext(&uc, NULL, 0);
|
||||
setcontext(&uc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# MacOSX 10.6 (Snow Leopard) has deprecated ucontext
|
||||
# and requires _XOPEN_SOURCE to be defined.
|
||||
|
||||
nxt_feature="_XOPEN_SOURCE ucontext"
|
||||
nxt_feature_name=NXT_HAVE_UCONTEXT
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#define _XOPEN_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <ucontext.h>
|
||||
|
||||
int main(void) {
|
||||
ucontext_t uc;
|
||||
|
||||
if (getcontext(&uc) == 0) {
|
||||
makecontext(&uc, NULL, 0);
|
||||
setcontext(&uc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
fi
|
||||
|
||||
|
||||
# FreeBSD dlopen() is in libc.
|
||||
# MacOSX libdl.dylib is a symlink to libSystem.dylib.
|
||||
# GCC5 AddressSanitizer intercepts dlopen() and dlclose() but not dlsym()
|
||||
# so all dynamic linker functions should be tested.
|
||||
|
||||
NXT_LIBDL=
|
||||
|
||||
nxt_feature="dlopen()"
|
||||
nxt_feature_name=NXT_HAVE_DLOPEN
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
int main(void) {
|
||||
void *h = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
|
||||
dlsym(h, \"\");
|
||||
dlclose(h);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = no ]; then
|
||||
|
||||
# Linux and Solaris prior to 10 require libdl.
|
||||
# Solaris 10 libdl.so.1 is a filter to /usr/lib/ld.so.1.
|
||||
|
||||
nxt_feature="dlopen() in libdl"
|
||||
nxt_feature_libs="-ldl"
|
||||
. auto/feature
|
||||
|
||||
if [ $nxt_found = yes ]; then
|
||||
NXT_LIBDL="-ldl"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# NetBSD 1.0, OpenBSD 1.0, FreeBSD 2.2 setproctitle().
|
||||
|
||||
nxt_feature="setproctitle()"
|
||||
nxt_feature_name=NXT_HAVE_SETPROCTITLE
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
setproctitle(\"%s\", \"title\");
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
|
||||
|
||||
# Linux, FreeBSD, Solaris getgrouplist()
|
||||
nxt_feature="getgrouplist()"
|
||||
nxt_feature_name=NXT_HAVE_GETGROUPLIST
|
||||
nxt_feature_run=
|
||||
nxt_feature_incs=
|
||||
nxt_feature_libs=
|
||||
nxt_feature_test="#include <unistd.h>
|
||||
#include <grp.h>
|
||||
|
||||
int main(void) {
|
||||
getgrouplist(\"root\", 0, NULL, NULL);
|
||||
return 0;
|
||||
}"
|
||||
. auto/feature
|
||||
182
configure
vendored
182
configure
vendored
@@ -1,182 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) Igor Sysoev
|
||||
# Copyright (C) NGINX, Inc.
|
||||
|
||||
|
||||
# Disable localized program messages.
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# Stop on error exit status.
|
||||
set -e
|
||||
|
||||
# Stop on uninitialized variable.
|
||||
set -u
|
||||
|
||||
# Initialize variables with null values if they are not defined.
|
||||
CFLAGS=${CFLAGS=}
|
||||
NXT_TEST_CFLAGS=${NXT_TEST_CFLAGS=}
|
||||
NXT_TEST_LIBS=${NXT_TEST_LIBS=}
|
||||
|
||||
NXT_BUILD_DIR=${NXT_BUILD_DIR:-build}
|
||||
|
||||
NXT_AUTOTEST=$NXT_BUILD_DIR/autotest
|
||||
NXT_AUTOCONF_ERR=$NXT_BUILD_DIR/autoconf.err
|
||||
NXT_AUTOCONF_DATA=$NXT_BUILD_DIR/autoconf.data
|
||||
NXT_AUTO_CONFIG_H=$NXT_BUILD_DIR/include/nxt_auto_config.h
|
||||
NXT_VERSION_H=$NXT_BUILD_DIR/include/nxt_version.h
|
||||
NXT_MAKEFILE=$NXT_BUILD_DIR/Makefile
|
||||
|
||||
CC=${CC:-cc}
|
||||
|
||||
NXT_DAEMON=unitd
|
||||
NXT_USER="nobody"
|
||||
NXT_GROUP=
|
||||
|
||||
nxt_module=${1:-""}
|
||||
|
||||
case $nxt_module in
|
||||
""|--*)
|
||||
;;
|
||||
|
||||
unit)
|
||||
shift
|
||||
;;
|
||||
|
||||
*)
|
||||
. auto/modules/conf
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
. ./version
|
||||
. auto/os/test
|
||||
. auto/options
|
||||
|
||||
mkdir -p $NXT_BUILD_DIR
|
||||
mkdir -p $NXT_BUILD_DIR/bin
|
||||
mkdir -p $NXT_BUILD_DIR/include
|
||||
mkdir -p $NXT_BUILD_DIR/lib
|
||||
mkdir -p $NXT_BUILD_DIR/lib/unit/modules
|
||||
mkdir -p $NXT_BUILD_DIR/sbin
|
||||
mkdir -p $NXT_BUILD_DIR/share/man/man8
|
||||
mkdir -p $NXT_BUILD_DIR/share/pkgconfig
|
||||
mkdir -p $NXT_BUILD_DIR/src
|
||||
mkdir -p $NXT_BUILD_DIR/src/test
|
||||
mkdir -p $NXT_BUILD_DIR/var/lib/unit
|
||||
mkdir -p $NXT_BUILD_DIR/var/log/unit
|
||||
mkdir -p $NXT_BUILD_DIR/var/run/unit
|
||||
|
||||
|
||||
> $NXT_AUTOCONF_ERR
|
||||
> $NXT_AUTO_CONFIG_H
|
||||
|
||||
. auto/cc/test
|
||||
|
||||
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#define NXT_CONFIGURE_OPTIONS "$NXT_CONFIGURE_OPTIONS"
|
||||
#define NXT_SYSTEM_VERSION "$NXT_SYSTEM $NXT_SYSTEM_VERSION $NXT_SYSTEM_PLATFORM"
|
||||
#define NXT_COMPILER_VERSION "$NXT_CC_VERSION"
|
||||
|
||||
#define NXT_PID "$NXT_PID"
|
||||
#define NXT_LOG "$NXT_LOG"
|
||||
#define NXT_MODULESDIR "$NXT_MODULESDIR"
|
||||
#define NXT_STATEDIR "$NXT_STATEDIR"
|
||||
#define NXT_TMPDIR "$NXT_TMPDIR"
|
||||
|
||||
#define NXT_CONTROL_SOCK "$NXT_CONTROL"
|
||||
|
||||
#define NXT_USER "$NXT_USER"
|
||||
#define NXT_GROUP "$NXT_GROUP"
|
||||
|
||||
END
|
||||
|
||||
|
||||
if [ $echo = echo ]; then
|
||||
# Build a portable "echo" program that supports only "-n" option.
|
||||
# This also tests C compiler ability to create executables.
|
||||
. auto/echo/build
|
||||
fi
|
||||
|
||||
|
||||
nxt_have=NXT_UNIX . auto/have
|
||||
|
||||
if [ $NXT_UNIX_DOMAIN = YES ]; then
|
||||
nxt_have=NXT_HAVE_UNIX_DOMAIN . auto/have
|
||||
fi
|
||||
|
||||
NXT_LIBRT=
|
||||
|
||||
. auto/endian
|
||||
. auto/types
|
||||
. auto/clang
|
||||
. auto/atomic
|
||||
. auto/malloc
|
||||
. auto/mmap
|
||||
. auto/shmem
|
||||
. auto/time
|
||||
. auto/threads
|
||||
. auto/events
|
||||
. auto/sockets
|
||||
. auto/sendfile
|
||||
. auto/files
|
||||
. auto/unix
|
||||
. auto/os/conf
|
||||
. auto/ssltls
|
||||
|
||||
if [ $NXT_REGEX = YES ]; then
|
||||
. auto/pcre
|
||||
fi
|
||||
|
||||
. auto/cgroup
|
||||
. auto/isolation
|
||||
. auto/capability
|
||||
|
||||
|
||||
case "$NXT_SYSTEM_PLATFORM" in
|
||||
i386 | amd64 | x86_64)
|
||||
nxt_have=NXT_HAVE_NONALIGNED . auto/have
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ $NXT_DEBUG = YES ]; then
|
||||
nxt_debug=1
|
||||
else
|
||||
nxt_debug=0
|
||||
fi
|
||||
|
||||
cat << END >> $NXT_AUTO_CONFIG_H
|
||||
|
||||
#ifndef NXT_DEBUG
|
||||
#define NXT_DEBUG $nxt_debug
|
||||
#endif
|
||||
|
||||
#define NXT_SHM_PREFIX "$NXT_SHM_PREFIX"
|
||||
|
||||
END
|
||||
|
||||
. auto/test_build
|
||||
. auto/sources
|
||||
. auto/save
|
||||
|
||||
# LOOK
|
||||
|
||||
NXT_LIB_AUX_CFLAGS="$NXT_OPENSSL_CFLAGS $NXT_GNUTLS_CFLAGS \\
|
||||
$NXT_CYASSL_CFLAGS $NXT_POLARSSL_CFLAGS \\
|
||||
$NXT_PCRE_CFLAGS"
|
||||
|
||||
NXT_LIB_AUX_LIBS="$NXT_OPENSSL_LIBS $NXT_GNUTLS_LIBS \\
|
||||
$NXT_CYASSL_LIBS $NXT_POLARSSL_LIBS \\
|
||||
$NXT_PCRE_LIB"
|
||||
|
||||
if [ $NXT_NJS != NO ]; then
|
||||
. auto/njs
|
||||
fi
|
||||
|
||||
. auto/make
|
||||
. auto/summary
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/make
|
||||
|
||||
DEST= ../build
|
||||
XSLS?= xslscript.pl
|
||||
|
||||
PACKAGES= unit \
|
||||
unit-php \
|
||||
unit-python unit-python2.7 unit-python3.4 \
|
||||
unit-python3.5 unit-python3.6 unit-python3.7 \
|
||||
unit-python3.8 unit-python3.9 unit-python3.10 \
|
||||
unit-python3.11 \
|
||||
unit-go unit-go1.7 unit-go1.8 unit-go1.9 unit-go1.10 \
|
||||
unit-go1.12 unit-go1.13 \
|
||||
unit-perl \
|
||||
unit-ruby \
|
||||
unit-jsc-common unit-jsc8 unit-jsc10 unit-jsc11 \
|
||||
unit-jsc13 unit-jsc14 unit-jsc15 unit-jsc16 unit-jsc17
|
||||
|
||||
CURDATE:=$(shell date +"%Y-%m-%d")
|
||||
CURTIME:=$(shell date +"%H:%M:%S %z")
|
||||
|
||||
|
||||
all: changes changelogs
|
||||
|
||||
changes: $(DEST)/CHANGES
|
||||
|
||||
changelogs: $(addsuffix .rpm-changelog, $(addprefix $(DEST)/, $(PACKAGES))) \
|
||||
$(addsuffix .deb-changelog, $(addprefix $(DEST)/, $(PACKAGES)))
|
||||
|
||||
$(DEST)/CHANGES: changes.dtd \
|
||||
changes.xml \
|
||||
change_log_conf.xml \
|
||||
changes.xslt
|
||||
|
||||
mkdir -p $(DEST)
|
||||
|
||||
xmllint --noout --valid changes.xml
|
||||
xsltproc --stringparam format generic \
|
||||
--stringparam curdate '$(CURDATE)' \
|
||||
--stringparam curtime '$(CURTIME)' \
|
||||
-o $@ changes.xslt changes.xml
|
||||
|
||||
$(DEST)/%.rpm-changelog: changes.dtd \
|
||||
changes.xml \
|
||||
change_log_conf.xml \
|
||||
changes.xslt
|
||||
mkdir -p $(DEST)
|
||||
xmllint --noout --valid changes.xml
|
||||
xsltproc --stringparam pkgname $* --stringparam format rpm \
|
||||
--stringparam curdate '$(CURDATE)' \
|
||||
--stringparam curtime '$(CURTIME)' \
|
||||
-o $@ changes.xslt changes.xml
|
||||
|
||||
$(DEST)/%.deb-changelog: changes.dtd \
|
||||
changes.xml \
|
||||
change_log_conf.xml \
|
||||
changes.xslt
|
||||
mkdir -p $(DEST)
|
||||
xmllint --noout --valid changes.xml
|
||||
xsltproc --stringparam pkgname $* --stringparam format deb \
|
||||
--stringparam curdate '$(CURDATE)' \
|
||||
--stringparam curtime '$(CURTIME)' \
|
||||
-o $@ changes.xslt changes.xml
|
||||
|
||||
changes.xslt: changes.xsls
|
||||
$(XSLS) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(DEST)
|
||||
@@ -1,26 +0,0 @@
|
||||
<!ELEMENT configuration (generic, rpm, deb, changes+) >
|
||||
|
||||
<!ELEMENT generic (length, start, indent?) >
|
||||
<!ELEMENT rpm (length, start, indent?) >
|
||||
<!ELEMENT deb (length, start, indent?) >
|
||||
|
||||
<!ELEMENT length (#PCDATA) >
|
||||
<!ELEMENT start (#PCDATA) >
|
||||
<!ELEMENT indent (#PCDATA) >
|
||||
|
||||
<!ELEMENT changes (title, length,
|
||||
bugfix, feature, change, security, workaround,
|
||||
(month, month, month, month, month, month,
|
||||
month, month, month, month, month, month),
|
||||
(day, day, day, day, day, day, day)?) >
|
||||
|
||||
<!ELEMENT title (#PCDATA) >
|
||||
|
||||
<!ELEMENT bugfix (#PCDATA) >
|
||||
<!ELEMENT feature (#PCDATA) >
|
||||
<!ELEMENT change (#PCDATA) >
|
||||
<!ELEMENT security (#PCDATA) >
|
||||
<!ELEMENT workaround (#PCDATA) >
|
||||
|
||||
<!ELEMENT month (#PCDATA) >
|
||||
<!ELEMENT day (#PCDATA) >
|
||||
@@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE configuration SYSTEM "change_log_conf.dtd" >
|
||||
|
||||
<configuration>
|
||||
|
||||
<generic>
|
||||
<length>76</length>
|
||||
<start> *) </start>
|
||||
<indent> </indent>
|
||||
</generic>
|
||||
|
||||
<rpm>
|
||||
<length>76</length>
|
||||
<start>- </start>
|
||||
<indent> </indent>
|
||||
</rpm>
|
||||
|
||||
<deb>
|
||||
<length>76</length>
|
||||
<start> * </start>
|
||||
<indent> </indent>
|
||||
</deb>
|
||||
|
||||
<changes>
|
||||
<title>Changes with </title>
|
||||
<length>65</length>
|
||||
|
||||
<bugfix>Bugfix</bugfix>
|
||||
<feature>Feature</feature>
|
||||
<change>Change</change>
|
||||
<security>Security</security>
|
||||
<workaround>Workaround</workaround>
|
||||
|
||||
<month> Jan </month>
|
||||
<month> Feb </month>
|
||||
<month> Mar </month>
|
||||
<month> Apr </month>
|
||||
<month> May </month>
|
||||
<month> Jun </month>
|
||||
<month> Jul </month>
|
||||
<month> Aug </month>
|
||||
<month> Sep </month>
|
||||
<month> Oct </month>
|
||||
<month> Nov </month>
|
||||
<month> Dec </month>
|
||||
|
||||
<day>Sun</day>
|
||||
<day>Mon</day>
|
||||
<day>Tue</day>
|
||||
<day>Wed</day>
|
||||
<day>Thu</day>
|
||||
<day>Fri</day>
|
||||
<day>Sat</day>
|
||||
</changes>
|
||||
|
||||
</configuration>
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
<!ENTITY nbsp " " >
|
||||
<!ENTITY mdash " - " >
|
||||
|
||||
|
||||
<!ELEMENT change_log (changes)* >
|
||||
<!ATTLIST change_log title CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT changes (change)* >
|
||||
<!ATTLIST changes ver CDATA #REQUIRED
|
||||
rev CDATA #REQUIRED
|
||||
date CDATA #REQUIRED
|
||||
time CDATA #REQUIRED
|
||||
packager CDATA #REQUIRED
|
||||
apply CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT change (para)* >
|
||||
<!ATTLIST change type (bugfix | feature | change | security | workaround) #IMPLIED >
|
||||
|
||||
<!ELEMENT para (#PCDATA | at | br | nobr)* >
|
||||
|
||||
<!ELEMENT at EMPTY >
|
||||
<!ELEMENT br EMPTY >
|
||||
<!ELEMENT nobr (#PCDATA) >
|
||||
4138
docs/changes.xml
4138
docs/changes.xml
File diff suppressed because it is too large
Load Diff
@@ -1,289 +0,0 @@
|
||||
X:stylesheet {
|
||||
|
||||
X:output method="text";
|
||||
|
||||
X:param format="'generic'";
|
||||
X:param pkgname="'unit'";
|
||||
X:param configuration="'change_log_conf.xml'";
|
||||
X:param curdate;
|
||||
X:param curtime;
|
||||
|
||||
X:var conf = "document($configuration)/configuration";
|
||||
|
||||
X:var start = {
|
||||
X:choose {
|
||||
X:when "$format='rpm'" {
|
||||
!{$conf/rpm/start}
|
||||
}
|
||||
X:when "$format='deb'" {
|
||||
!{$conf/deb/start}
|
||||
}
|
||||
X:when "$format='generic'" {
|
||||
!{$conf/generic/start}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
X:var indent = {
|
||||
X:choose {
|
||||
X:when "$format='rpm'" {
|
||||
!{$conf/rpm/indent}
|
||||
}
|
||||
X:when "$format='deb'" {
|
||||
!{$conf/deb/indent}
|
||||
}
|
||||
X:when "$format='generic'" {
|
||||
!{$conf/generic/indent}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
X:var max = {
|
||||
X:choose {
|
||||
X:when "$format='rpm'" {
|
||||
!{$conf/rpm/length}
|
||||
}
|
||||
X:when "$format='deb'" {
|
||||
!{$conf/deb/length}
|
||||
}
|
||||
X:when "$format='generic'" {
|
||||
!{$conf/generic/length}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
X:var br = {<br>}
|
||||
|
||||
|
||||
X:template = "/" { !! "change_log"; }
|
||||
X:template = "change_log" { !! "changes"; }
|
||||
|
||||
|
||||
X:template = "changes" {
|
||||
X:var date_ = { !getdate(date="@date", curdate="$curdate") }
|
||||
X:var time_ = { !gettime(time="@time", curtime="$curtime") }
|
||||
X:var pday = { !padded_day(date="$date_") }
|
||||
X:var dow = { !day_of_week(date="$date_") }
|
||||
X:var apply = { !string_in_list(list="@apply", string="$pkgname") }
|
||||
X:var pkgname_ = { !beautify(pkgname="$pkgname") }
|
||||
|
||||
X:choose {
|
||||
X:when "$pkgname='unit' and $format='generic' and @rev!=1" {}
|
||||
X:otherwise {
|
||||
X:if "$apply=$pkgname" {
|
||||
|
||||
X:if "$format='generic'" {
|
||||
X:text { }
|
||||
|
||||
!{substring(concat($conf/changes/title,
|
||||
$pkgname_,
|
||||
' ', @ver,
|
||||
' '),
|
||||
1, $conf/changes/length)}
|
||||
|
||||
!{substring($date_, 9, 2)}
|
||||
!{$conf/changes/month[number(substring($date_, 6, 2))]}
|
||||
!{substring($date_, 1, 4)}
|
||||
}
|
||||
|
||||
X:if "$format='rpm'" {
|
||||
!{concat('* ', $conf/changes/day[number($dow)],
|
||||
$conf/changes/month[number(substring($date_, 6, 2))],
|
||||
$pday, ' ',
|
||||
substring($date_, 1, 4), ' ', @packager, ' - ',
|
||||
@ver, '-', @rev, '%{?dist}.ngx')}
|
||||
}
|
||||
|
||||
X:if "$format='deb'" {
|
||||
!{concat($pkgname, ' (', @ver, '-', @rev,
|
||||
'~%%CODENAME%%) %%CODENAME%%; urgency=low')}
|
||||
|
||||
X:text { }
|
||||
}
|
||||
|
||||
X:text { }
|
||||
|
||||
!! "change";
|
||||
|
||||
X:text { }
|
||||
|
||||
X:if "$format='deb'" {
|
||||
!{concat(' -- ', @packager, ' ',
|
||||
$conf/changes/day[number($dow)], ', ',
|
||||
$pday,
|
||||
$conf/changes/month[number(substring($date_, 6, 2))],
|
||||
substring($date_, 1, 4), ' ', $time_)}
|
||||
|
||||
X:text { }
|
||||
X:text { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template = "change" {
|
||||
X:var prefix = "$conf/changes/*[local-name(.)=current()/@type]"
|
||||
|
||||
X:var postfix = { X:if "$prefix" { X:text {: } } }
|
||||
|
||||
!! "para" (prefix = "concat($start, $prefix, $postfix)");
|
||||
}
|
||||
|
||||
|
||||
X:template para(prefix) = "para" {
|
||||
X:var text = { !!; }
|
||||
|
||||
X:if "$format='generic'" {
|
||||
X:text { }
|
||||
}
|
||||
|
||||
!wrap(text = "normalize-space($text)",
|
||||
prefix = { X:if "position() = 1" { !{$prefix} } else { !{$indent} } })
|
||||
}
|
||||
|
||||
|
||||
X:template wrap(text, prefix) {
|
||||
X:if "$text" {
|
||||
X:var offset = {
|
||||
X:choose {
|
||||
X:when "starts-with($text, concat($br, ' '))" {
|
||||
!{string-length($br) + 2}
|
||||
}
|
||||
X:when "starts-with($text, $br)" {
|
||||
!{string-length($br) + 1}
|
||||
}
|
||||
X:otherwise {
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
X:var length = {
|
||||
!length(text = "substring($text, $offset)",
|
||||
prefix = "string-length($prefix)",
|
||||
length = "$max")
|
||||
}
|
||||
|
||||
!{$prefix}
|
||||
|
||||
!{normalize-space(translate(substring($text, $offset, $length),
|
||||
' ', ' '))}
|
||||
|
||||
X:text { }
|
||||
|
||||
!wrap(text = "substring($text, $length + $offset)", prefix = "$indent")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template length(text, prefix, length) {
|
||||
X:var break = "substring-before(substring($text, 1,
|
||||
$length - $prefix + string-length($br)),
|
||||
$br)"
|
||||
|
||||
X:choose {
|
||||
X:when "$break" { !{string-length($break)} }
|
||||
|
||||
X:when "$length = 0" { !{$max - $prefix} }
|
||||
|
||||
X:when "string-length($text) + $prefix <= $length" {
|
||||
!{$length - $prefix}
|
||||
}
|
||||
|
||||
X:when "substring($text, $length - $prefix + 1, 1) = ' '" {
|
||||
!{$length - $prefix + 1}
|
||||
}
|
||||
|
||||
X:otherwise {
|
||||
!length(text = "$text", prefix = "$prefix", length = "$length - 1")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template day_of_week(date) {
|
||||
X:param year = "substring-before($date, '-')";
|
||||
X:param month = "substring-before(substring-after($date, '-'), '-')";
|
||||
X:param day = "substring-after(substring-after($date, '-'), '-')";
|
||||
|
||||
X:var a = "floor((14 - $month) div 12)";
|
||||
|
||||
X:var y = "$year - $a";
|
||||
|
||||
X:var m = "$month + 12 * $a - 2";
|
||||
|
||||
!{($day + $y + floor($y div 4) - floor($y div 100)
|
||||
+ floor($y div 400) + floor((31 * $m) div 12)) mod 7 + 1}
|
||||
}
|
||||
|
||||
|
||||
X:template padded_day(date) {
|
||||
!{substring(concat(' ', format-number(substring($date, 9, 2), '##')),
|
||||
1 + string-length(format-number(substring($date, 9, 2), '##')))}
|
||||
}
|
||||
|
||||
|
||||
X:template string_in_list(list, string) {
|
||||
X:choose {
|
||||
X:when "contains($list, ' ')" {
|
||||
X:var str = "substring-before($list, ' ')";
|
||||
X:choose {
|
||||
X:when "$str=$string" {
|
||||
!{$string}
|
||||
}
|
||||
X:otherwise {
|
||||
!string_in_list(list="substring-after($list, ' ')",
|
||||
string="$string")
|
||||
}
|
||||
}
|
||||
}
|
||||
X:otherwise {
|
||||
X:if "$list=$string" { !{$string} }
|
||||
X:if "$list='*'" { !{$string} }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template beautify(pkgname) {
|
||||
X:choose {
|
||||
X:when "$pkgname='unit'" {Unit}
|
||||
X:otherwise {
|
||||
!{$pkgname}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template getdate(date, curdate) {
|
||||
X:choose {
|
||||
X:when "$date=''" {
|
||||
!{$curdate}
|
||||
}
|
||||
X:otherwise {
|
||||
!{$date}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template gettime(time, curtime) {
|
||||
X:choose {
|
||||
X:when "$time=''" {
|
||||
!{$curtime}
|
||||
}
|
||||
X:otherwise {
|
||||
!{$time}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template = "at" {@}
|
||||
X:template = "br" { !{$br} }
|
||||
X:template = "nobr" { !{translate(., ' ', ' ')} }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,281 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:output method="text"/>
|
||||
|
||||
<xsl:param select="'generic'" name="format"/>
|
||||
<xsl:param select="'unit'" name="pkgname"/>
|
||||
<xsl:param select="'change_log_conf.xml'" name="configuration"/>
|
||||
<xsl:param name="curdate"/>
|
||||
<xsl:param name="curtime"/>
|
||||
|
||||
<xsl:variable select="document($configuration)/configuration" name="conf"/>
|
||||
|
||||
<xsl:variable name="start">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$format='rpm'">
|
||||
<xsl:value-of select="$conf/rpm/start"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$format='deb'">
|
||||
<xsl:value-of select="$conf/deb/start"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$format='generic'">
|
||||
<xsl:value-of select="$conf/generic/start"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="indent">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$format='rpm'">
|
||||
<xsl:value-of select="$conf/rpm/indent"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$format='deb'">
|
||||
<xsl:value-of select="$conf/deb/indent"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$format='generic'">
|
||||
<xsl:value-of select="$conf/generic/indent"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="max">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$format='rpm'">
|
||||
<xsl:value-of select="$conf/rpm/length"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$format='deb'">
|
||||
<xsl:value-of select="$conf/deb/length"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$format='generic'">
|
||||
<xsl:value-of select="$conf/generic/length"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="br"><br></xsl:variable>
|
||||
|
||||
|
||||
<xsl:template match="/"> <xsl:apply-templates select="change_log"/> </xsl:template>
|
||||
<xsl:template match="change_log"> <xsl:apply-templates select="changes"/> </xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="changes">
|
||||
<xsl:variable name="date_"> <xsl:call-template name="getdate"><xsl:with-param select="@date" name="date"/><xsl:with-param select="$curdate" name="curdate"/></xsl:call-template></xsl:variable>
|
||||
<xsl:variable name="time_"> <xsl:call-template name="gettime"><xsl:with-param select="@time" name="time"/><xsl:with-param select="$curtime" name="curtime"/></xsl:call-template></xsl:variable>
|
||||
<xsl:variable name="pday"> <xsl:call-template name="padded_day"><xsl:with-param select="$date_" name="date"/></xsl:call-template></xsl:variable>
|
||||
<xsl:variable name="dow"> <xsl:call-template name="day_of_week"><xsl:with-param select="$date_" name="date"/></xsl:call-template></xsl:variable>
|
||||
<xsl:variable name="apply"> <xsl:call-template name="string_in_list"><xsl:with-param select="@apply" name="list"/><xsl:with-param select="$pkgname" name="string"/></xsl:call-template></xsl:variable>
|
||||
<xsl:variable name="pkgname_"> <xsl:call-template name="beautify"><xsl:with-param select="$pkgname" name="pkgname"/></xsl:call-template></xsl:variable>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$pkgname='unit' and $format='generic' and @rev!=1"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$apply=$pkgname">
|
||||
|
||||
<xsl:if test="$format='generic'">
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:value-of select="substring(concat($conf/changes/title,
|
||||
$pkgname_,
|
||||
' ', @ver,
|
||||
' '),
|
||||
1, $conf/changes/length)"/>
|
||||
|
||||
<xsl:value-of select="substring($date_, 9, 2)"/>
|
||||
<xsl:value-of select="$conf/changes/month[number(substring($date_, 6, 2))]"/>
|
||||
<xsl:value-of select="substring($date_, 1, 4)"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$format='rpm'">
|
||||
<xsl:value-of select="concat('* ', $conf/changes/day[number($dow)],
|
||||
$conf/changes/month[number(substring($date_, 6, 2))],
|
||||
$pday, ' ',
|
||||
substring($date_, 1, 4), ' ', @packager, ' - ',
|
||||
@ver, '-', @rev, '%{?dist}.ngx')"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$format='deb'">
|
||||
<xsl:value-of select="concat($pkgname, ' (', @ver, '-', @rev,
|
||||
'~%%CODENAME%%) %%CODENAME%%; urgency=low')"/>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:apply-templates select="change"/>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:if test="$format='deb'">
|
||||
<xsl:value-of select="concat(' -- ', @packager, ' ',
|
||||
$conf/changes/day[number($dow)], ', ',
|
||||
$pday,
|
||||
$conf/changes/month[number(substring($date_, 6, 2))],
|
||||
substring($date_, 1, 4), ' ', $time_)"/>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="change">
|
||||
<xsl:variable select="$conf/changes/*[local-name(.)=current()/@type]" name="prefix"/>
|
||||
|
||||
<xsl:variable name="postfix"> <xsl:if test="$prefix"> <xsl:text>: </xsl:text> </xsl:if> </xsl:variable>
|
||||
|
||||
<xsl:apply-templates select="para"><xsl:with-param select="concat($start, $prefix, $postfix)" name="prefix"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="para" match="para"><xsl:param name="prefix"/>
|
||||
<xsl:variable name="text"> <xsl:apply-templates/> </xsl:variable>
|
||||
|
||||
<xsl:if test="$format='generic'">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:call-template name="wrap"><xsl:with-param select="normalize-space($text)" name="text"/><xsl:with-param name="prefix"> <xsl:choose><xsl:when test="position() = 1"> <xsl:value-of select="$prefix"/> </xsl:when><xsl:otherwise> <xsl:value-of select="$indent"/> </xsl:otherwise></xsl:choose> </xsl:with-param></xsl:call-template></xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="wrap"><xsl:param name="text"/><xsl:param name="prefix"/>
|
||||
<xsl:if test="$text">
|
||||
<xsl:variable name="offset">
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($text, concat($br, ' '))">
|
||||
<xsl:value-of select="string-length($br) + 2"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with($text, $br)">
|
||||
<xsl:value-of select="string-length($br) + 1"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
1
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="length">
|
||||
<xsl:call-template name="length"><xsl:with-param select="substring($text, $offset)" name="text"/><xsl:with-param select="string-length($prefix)" name="prefix"/><xsl:with-param select="$max" name="length"/></xsl:call-template></xsl:variable>
|
||||
|
||||
<xsl:value-of select="$prefix"/>
|
||||
|
||||
<xsl:value-of select="normalize-space(translate(substring($text, $offset, $length),
|
||||
' ', ' '))"/>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:call-template name="wrap"><xsl:with-param select="substring($text, $length + $offset)" name="text"/><xsl:with-param select="$indent" name="prefix"/></xsl:call-template></xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="length"><xsl:param name="text"/><xsl:param name="prefix"/><xsl:param name="length"/>
|
||||
<xsl:variable select="substring-before(substring($text, 1,
|
||||
$length - $prefix + string-length($br)),
|
||||
$br)" name="break"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$break"> <xsl:value-of select="string-length($break)"/> </xsl:when>
|
||||
|
||||
<xsl:when test="$length = 0"> <xsl:value-of select="$max - $prefix"/> </xsl:when>
|
||||
|
||||
<xsl:when test="string-length($text) + $prefix <= $length">
|
||||
<xsl:value-of select="$length - $prefix"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="substring($text, $length - $prefix + 1, 1) = ' '">
|
||||
<xsl:value-of select="$length - $prefix + 1"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="length"><xsl:with-param select="$text" name="text"/><xsl:with-param select="$prefix" name="prefix"/><xsl:with-param select="$length - 1" name="length"/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="day_of_week"><xsl:param name="date"/>
|
||||
<xsl:param select="substring-before($date, '-')" name="year"/>
|
||||
<xsl:param select="substring-before(substring-after($date, '-'), '-')" name="month"/>
|
||||
<xsl:param select="substring-after(substring-after($date, '-'), '-')" name="day"/>
|
||||
|
||||
<xsl:variable select="floor((14 - $month) div 12)" name="a"/>
|
||||
|
||||
<xsl:variable select="$year - $a" name="y"/>
|
||||
|
||||
<xsl:variable select="$month + 12 * $a - 2" name="m"/>
|
||||
|
||||
<xsl:value-of select="($day + $y + floor($y div 4) - floor($y div 100)
|
||||
+ floor($y div 400) + floor((31 * $m) div 12)) mod 7 + 1"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="padded_day"><xsl:param name="date"/>
|
||||
<xsl:value-of select="substring(concat(' ', format-number(substring($date, 9, 2), '##')),
|
||||
1 + string-length(format-number(substring($date, 9, 2), '##')))"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="string_in_list"><xsl:param name="list"/><xsl:param name="string"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($list, ' ')">
|
||||
<xsl:variable select="substring-before($list, ' ')" name="str"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$str=$string">
|
||||
<xsl:value-of select="$string"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="string_in_list"><xsl:with-param select="substring-after($list, ' ')" name="list"/><xsl:with-param select="$string" name="string"/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$list=$string"> <xsl:value-of select="$string"/> </xsl:if>
|
||||
<xsl:if test="$list='*'"> <xsl:value-of select="$string"/> </xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="beautify"><xsl:param name="pkgname"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$pkgname='unit'">Unit</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$pkgname"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="getdate"><xsl:param name="date"/><xsl:param name="curdate"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$date=''">
|
||||
<xsl:value-of select="$curdate"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$date"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="gettime"><xsl:param name="time"/><xsl:param name="curtime"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$time=''">
|
||||
<xsl:value-of select="$curtime"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$time"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="at">@</xsl:template>
|
||||
<xsl:template match="br"> <xsl:value-of select="$br"/> </xsl:template>
|
||||
<xsl:template match="nobr"> <xsl:value-of select="translate(., ' ', ' ')"/> </xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -1,129 +0,0 @@
|
||||
.\" (C) 2017-2024 NGINX, Inc.
|
||||
.\" (C) 2017-2024 Andrei Zeliankou
|
||||
.\" (C) 2018-2024 Konstantin Pavlov
|
||||
.\" (C) 2021-2024 Zhidao Hong
|
||||
.\" (C) 2022-2024 Andrew Clayton
|
||||
.\" (C) 2022-2024 Liam Crilly
|
||||
.\" (C) 2023-2024 Dan Callahan
|
||||
.\" (C) 2023-2024 Danielle De Leo
|
||||
.\" (C) 2023-2024 Dylan Arbour
|
||||
.\" (C) 2023-2024 Gabor Javorszky
|
||||
.\" (C) 2023-2024 Igor Ippolitov
|
||||
.\" (C) 2023-2024 Taryn Musgrave
|
||||
.\" (C) 2021-2023 Alejandro Colomar
|
||||
.\" (C) 2017-2022 Valentin V. Bartenev
|
||||
.\" (C) 2017-2022 Max Romanov
|
||||
.\" (C) 2021-2022 Oisín Canty
|
||||
.\" (C) 2017-2021 Igor Sysoev
|
||||
.\" (C) 2017-2021 Andrei Belov
|
||||
.\" (C) 2019-2021 Tiago Natel de Moura
|
||||
.\" (C) 2019-2020 Axel Duch
|
||||
.\" (C) 2018-2019 Alexander Borisov
|
||||
.\"
|
||||
.Dd 2023-04-26
|
||||
.Dt unitd 8
|
||||
.Os NGINX Unit
|
||||
.Sh Name
|
||||
.Nm unitd
|
||||
.Nd "runs the NGINX Unit daemon"
|
||||
.Sh Synopsis
|
||||
.Nm
|
||||
.Op Fl Fl no-daemon
|
||||
.Op Fl Fl control Ar socket
|
||||
.Op Fl Fl control-mode Ar mode
|
||||
.Op Fl Fl control-user Ar user
|
||||
.Op Fl Fl control-group Ar group
|
||||
.Op Fl Fl group Ar name
|
||||
.Op Fl Fl user Ar name
|
||||
.Op Fl Fl log Ar file
|
||||
.Op Fl Fl modulesdir Ar directory
|
||||
.Op Fl Fl pid Ar file
|
||||
.Op Fl Fl statedir Ar directory
|
||||
.Nm
|
||||
.Op Fl h | Fl Fl help | Fl Fl version
|
||||
.Sh Description
|
||||
NGINX Unit is a polyglot app server, a reverse proxy, and a static file server
|
||||
for UNIX-like systems.
|
||||
It was built by
|
||||
.Xr nginx 8
|
||||
team members from
|
||||
scratch to be highly efficient and fully configurable at runtime.
|
||||
.Sh Options
|
||||
.Bl -tag -width indent
|
||||
.It Fl h , Fl Fl help
|
||||
Displays a summary of Unit's command-line options and their
|
||||
compile-time defaults.
|
||||
.It Fl Fl version
|
||||
Displays Unit's version and the
|
||||
.Pa ./configure
|
||||
settings it was built with.
|
||||
.It Fl Fl no-daemon
|
||||
Runs Unit in non-daemon mode.
|
||||
.It Fl Fl control Ar socket
|
||||
Overrides the control API's socket address in IPv4, IPv6,
|
||||
or UNIX-domain format.
|
||||
.It Fl Fl control-mode Ar mode
|
||||
Sets the permission of the UNIX-domain control socket.
|
||||
.It Fl Fl control-user Ar user
|
||||
Sets the owner of the UNIX-domain control socket.
|
||||
.It Fl Fl control-group Ar group
|
||||
Sets the group of the UNIX-domain control socket.
|
||||
.It Fl Fl group Ar name , Fl Fl user Ar name
|
||||
Override group name and user name used to run Unit's non-privileged processes.
|
||||
.It Fl Fl log Ar file
|
||||
Overrides the pathname for Unit's log.
|
||||
.It Fl Fl modulesdir Ar directory
|
||||
Overrides the directory path for Unit's language modules
|
||||
.Po Pa *.unit.so
|
||||
.Pc files .
|
||||
.It Fl Fl pid Ar file
|
||||
Overrides the pathname for the PID file of Unit's main process.
|
||||
.It Fl Fl statedir Ar directory
|
||||
Overrides the directory path for Unit's state storage.
|
||||
.El
|
||||
.Sh Exit status
|
||||
Exit status is 0 on success, or 1 if the daemon encounters an error.
|
||||
.Sh Files
|
||||
.Bl -tag -width indent
|
||||
.It Pa %%PID_PATH%%
|
||||
The PID file of Unit's main process.
|
||||
.It Pa %%ERROR_LOG_PATH%%
|
||||
A general-purpose log for diagnostics and troubleshooting.
|
||||
.El
|
||||
.Sh Sockets
|
||||
.Bl -tag -width indent
|
||||
.It Pa %%SOCKET_PATH%%
|
||||
The socket address of Unit's control API.
|
||||
.El
|
||||
.Sh Copyright
|
||||
.nf
|
||||
(C) 2017-2024 NGINX, Inc.
|
||||
(C) 2017-2024 Andrei Zeliankou
|
||||
(C) 2018-2024 Konstantin Pavlov
|
||||
(C) 2021-2024 Zhidao Hong
|
||||
(C) 2022-2024 Andrew Clayton
|
||||
(C) 2022-2024 Liam Crilly
|
||||
(C) 2023-2024 Dan Callahan
|
||||
(C) 2023-2024 Danielle De Leo
|
||||
(C) 2023-2024 Dylan Arbour
|
||||
(C) 2023-2024 Gabor Javorszky
|
||||
(C) 2023-2024 Igor Ippolitov
|
||||
(C) 2023-2024 Taryn Musgrave
|
||||
(C) 2021-2023 Alejandro Colomar
|
||||
(C) 2017-2022 Valentin V. Bartenev
|
||||
(C) 2017-2022 Max Romanov
|
||||
(C) 2021-2022 Oisín Canty
|
||||
(C) 2017-2021 Igor Sysoev
|
||||
(C) 2017-2021 Andrei Belov
|
||||
(C) 2019-2021 Tiago Natel de Moura
|
||||
(C) 2019-2020 Axel Duch
|
||||
(C) 2018-2019 Alexander Borisov
|
||||
.fi
|
||||
.Pp
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
.Sh See also
|
||||
.Lk https://unit.nginx.org Website
|
||||
.Pp
|
||||
.Lk https://mailman.nginx.org/mailman/listinfo/unit "User mailing list"
|
||||
.Pp
|
||||
.Lk https://github.com/nginx/unit GitHub
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,305 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1660 332" style="enable-background:new 0 0 1660 332;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#222222;}
|
||||
.st1{fill:#999999;}
|
||||
.st2{fill:#009639;}
|
||||
.st3{fill:#FFFFFF;}
|
||||
.st4{fill:none;stroke:#62C026;stroke-width:6.3479633;stroke-linejoin:round;stroke-miterlimit:10;}
|
||||
.st5{fill:#267423;}
|
||||
.st6{fill:#62C026;}
|
||||
.st7{fill:#E6E6E6;}
|
||||
</style>
|
||||
<g id="Layer_1">
|
||||
<rect class="st0" width="1660" height="332"/>
|
||||
</g>
|
||||
<g id="Art">
|
||||
<g>
|
||||
<g>
|
||||
<path class="st1" d="M311.9880066,232.1229248h-9.3733826l-1.7800903,5.5219574h-4.396637l7.7028503-25.7251434h6.3584595
|
||||
l7.6655273,25.7251434h-4.4327698L311.9880066,232.1229248z M303.8868103,227.9802094h6.8302307L307.3013,216.607666
|
||||
L303.8868103,227.9802094z"/>
|
||||
<path class="st1" d="M336.5467834,226.9271088v10.7177734h-4.3232117v-10.7551117
|
||||
c0-2.8331909-1.4900513-4.1775665-3.6696777-4.1775665c-1.9979248,0-3.7431335,1.1974945-3.8514404,3.6323395v11.3003387
|
||||
h-4.2871094v-18.4579773h2.7970581l0.7991943,1.5983276c1.3817139-1.4165802,3.3796387-2.1062012,5.5592957-2.1062012
|
||||
C333.8218994,218.6790314,336.5467834,221.1138611,336.5467834,226.9271088z"/>
|
||||
<path class="st1" d="M364.9918518,211.9197388v25.7251434h-4.2149353l-10.1003418-17.4048615v17.4048615h-4.1775818v-25.7251434
|
||||
h4.1775818l10.1003418,17.5144043v-17.5144043H364.9918518z"/>
|
||||
<path class="st1" d="M384.2813416,221.0765228v-1.1999969c0-2.6887665-2.0339966-4.3219604-5.5953979-4.3219604
|
||||
c-3.5962219,0-5.6315002,1.633194-5.6315002,4.3219604v9.811554c0,2.6887817,2.0352783,4.3219757,5.5953979,4.3219757
|
||||
c3.5975037,0,5.6315002-1.633194,5.6315002-4.3219757v-1.6356659h-5.7771301v-4.1427155h10.2460022v6.0323334
|
||||
c0,4.9767303-3.6696777,8.2107239-10.06427,8.2107239c-6.3945618,0-10.1003418-3.2339935-10.1003418-8.2107239v-10.3194427
|
||||
c0-4.9767303,3.6696777-8.2107391,10.0642395-8.2107391c6.4306946,0,10.1003723,3.2340088,10.1003723,8.2107391v1.4539337
|
||||
H384.2813416z"/>
|
||||
<path class="st1" d="M392.8530884,211.9197388h4.4688416v25.7251434h-4.4688416V211.9197388z"/>
|
||||
<path class="st1" d="M420.0657959,211.9197388v25.7251434h-4.2149048l-10.1016235-17.4048615v17.4048615h-4.1775513v-25.7251434
|
||||
h4.1775513l10.1016235,17.5144043v-17.5144043H420.0657959z"/>
|
||||
<path class="st1" d="M436.3403931,224.8906097l7.8111572,12.7542725h-5.1958313l-5.3763123-8.8306427l-5.4870911,8.8306427
|
||||
h-4.9406433l7.8111572-13.0804138l-7.7389526-12.6447296h5.1958008l5.3775635,8.7559509l5.5219727-8.7559509h5.0140686
|
||||
L436.3403931,224.8906097z"/>
|
||||
<path class="st1" d="M471.3978577,219.1147156v2.5792389c0,4.396637-3.1244507,7.1949615-8.1746521,7.1949615h-5.9949646
|
||||
v8.7559662h-4.4688721v-25.7251434h10.4265137C468.2360535,211.9197388,471.3978577,214.7180634,471.3978577,219.1147156z
|
||||
M466.9290161,219.0051727c0-1.8896179-1.198761-2.9427185-3.4157715-2.9427185h-6.2850037v8.6837616h6.2489319
|
||||
c2.2157288,0,3.4518433-1.0531158,3.4518433-2.9427185V219.0051727z"/>
|
||||
<path class="st1" d="M484.3649902,218.8956299v3.8165741c-0.5439758-0.1468964-1.1265259-0.253952-1.706604-0.253952
|
||||
c-2.2170105,0-4.178833,1.2696991-4.178833,4.0680237v11.1186066h-4.2871094v-18.4579773h2.9066162l0.8352661,1.6705322
|
||||
c1.453949-1.3443909,3.4879456-2.0340118,5.5232239-2.0340118
|
||||
C483.7836914,218.8234253,484.0749512,218.8607635,484.3649902,218.8956299z"/>
|
||||
<path class="st1" d="M485.9994202,230.3055115v-3.7792358c0-4.8323212,2.9066467-7.8472443,8.1385498-7.8472443
|
||||
c5.2680359,0,8.1746521,3.0149231,8.1746521,7.8472443v3.7792358c0,4.8323364-2.9066162,7.8472443-8.1385498,7.8472443
|
||||
C488.9421692,238.1527557,485.9994202,235.1378479,485.9994202,230.3055115z M497.9894104,230.1586151v-3.4879303
|
||||
c0-2.6141052-1.1626587-3.9958344-3.8153381-3.9958344c-2.6514282,0-3.8501892,1.3817291-3.8501892,3.9958344v3.4879303
|
||||
c0,2.6165924,1.198761,3.9983215,3.8140869,3.9983215C496.7906494,234.1569366,497.9894104,232.7752075,497.9894104,230.1586151z
|
||||
"/>
|
||||
<path class="st1" d="M501.3653259,242.0041809h0.7991638c2.7983093,0,3.2340088-1.5634766,3.2340088-3.9236145v-18.8936615
|
||||
h4.3232117v20.0563049c0,5.0140686-2.9788208,6.7568054-6.3572388,6.7568054h-1.9991455V242.0041809z M505.3623962,212.2110291
|
||||
h4.3954163v4.6157227h-4.3954163V212.2110291z"/>
|
||||
<path class="st1" d="M529.0498047,225.6549225v4.0680237h-11.6264648v0.5452118
|
||||
c0,2.9427185,1.3804932,4.2871094,3.8501587,4.2871094c1.8535156,0,3.4157715-0.9435577,3.4157715-2.5070343v-0.2887878
|
||||
h4.3231812c0,3.9958191-3.0883789,6.3933105-7.7389526,6.3933105c-5.2680054,0-8.1746216-3.1966553-8.1746216-8.0289917
|
||||
v-3.5252838c0-4.8323364,2.9066162-7.9194489,8.0663452-7.9194489
|
||||
C525.8880005,218.6790314,529.0498047,221.6217499,529.0498047,225.6549225z M524.6531372,226.4167328v-0.7269592
|
||||
c0-2.2879486-1.1265259-3.4132538-3.4157104-3.4132538c-2.5792847,0-3.7780151,1.4514313-3.8140869,4.140213H524.6531372z"/>
|
||||
<path class="st1" d="M531.9539185,230.3055115v-3.7792358c0-4.8323212,2.9066162-7.8472443,8.0314941-7.8472443
|
||||
c4.7949829,0,7.84729,2.9427185,7.84729,7.5211029v0.4356842h-4.359314v-0.5452271
|
||||
c0-2.215744-1.3082886-3.415741-3.4879761-3.415741c-2.5082397,0-3.7070312,1.3817291-3.7070312,3.9958344v3.4879303
|
||||
c0,2.6165924,1.1987915,3.9983215,3.7070312,3.9983215c2.1435547,0,3.4879761-1.234848,3.4879761-3.415741v-0.5452271h4.359314
|
||||
v0.4356842c0,4.5783844-3.0523071,7.5211029-7.84729,7.5211029
|
||||
C534.8966675,238.1527557,531.9539185,235.1378479,531.9539185,230.3055115z"/>
|
||||
<path class="st1" d="M562.0359497,233.6465607v3.9983215h-2.6153564c-4.3605957,0-6.5762939-2.2530975-6.5762939-6.94104
|
||||
v-7.5211029h-2.4709473v-3.9958344h2.4709473v-5.2680054h4.3231812v5.2680054h4.614502v3.9958344h-4.614502v6.687088
|
||||
c0,2.61409,1.0531006,3.7767334,3.1605835,3.7767334H562.0359497z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st2" d="M121.0398254,200.2646637c0.716362,1.2425537,1.7262878,2.211853,2.8912964,2.8691254
|
||||
l59.147934,34.1488647l0.0018463-0.0018463c1.1539459,0.6794434,2.4962006,1.0690002,3.9307709,1.0690002
|
||||
s2.7786713-0.3895569,3.9307556-1.0690002l59.1497955-34.1488495
|
||||
c1.1650085-0.6572876,2.1712341-1.6247406,2.8894348-2.8672943c0.7182159-1.2425385,1.0523987-2.5995636,1.0394745-3.9381104
|
||||
v-68.2977295l-0.0018463-0.0018463c0.0110779-1.3367157-0.3231049-2.6955795-1.0394745-3.9381256
|
||||
c-0.7182007-1.2425537-1.7281189-2.2100067-2.8912811-2.869133L190.938736,87.0708618v-0.0018463
|
||||
c-1.1520844-0.6794434-2.494339-1.0690079-3.9289093-1.0690079c-1.432724,0-2.7749786,0.3895645-3.9270782,1.0690079
|
||||
v0.0018463l-59.147934,34.1488571c-1.1650085,0.6591263-2.1749344,1.6265793-2.8931427,2.869133
|
||||
c-0.716362,1.2425461-1.0505447,2.6014099-1.0394669,3.9381256l-0.0018463,0.0018463v68.2977295
|
||||
c-0.0129242,1.3385468,0.3212585,2.6955719,1.0376205,3.9381104"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st3" d="M168.0723724,188.1761322c0,4.2002869-3.4047394,7.6066895-7.6071014,7.6066895
|
||||
c-4.200531,0-7.6071014-3.4064026-7.6071014-7.6066895l0.0018463,0.0018463l0.0073853-52.2166138
|
||||
c0-4.0451965,3.5746002-7.3906708,8.6373901-7.3906708c3.6244507,0,7.8083496,1.462265,10.3692932,4.6360168
|
||||
l2.2987518,2.7509766l31.7799683,38.0297394v-37.813736h-0.0036774c0-4.2002869,3.4065704-7.6066895,7.6089478-7.6066895
|
||||
c4.200531,0,7.6052551,3.4064026,7.6052551,7.6066895h-0.0018463l-0.0073853,52.2129059
|
||||
c0,4.0452118-3.5764465,7.390686-8.6373901,7.390686c-3.626297,0-7.8083649-1.4604187-10.3692932-4.6360321
|
||||
l-34.0787354-40.7807159v37.8174438L168.0723724,188.1761322z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M427.3791809,185.5565643h0.9719543v-2.1648254h0.7688599
|
||||
c0.5082397,0,0.8728333,0.0495453,1.0799255,0.1803284c0.3398132,0.1991425,0.5132141,0.6261597,0.5132141,1.2592621v0.4438629
|
||||
l0.0217896,0.165451c0.0119019,0.0366669,0.0119019,0.0515289,0.0148621,0.0693665
|
||||
c0.0049438,0.0267487,0.0069275,0.034668,0.0217896,0.0465546h0.9006042l-0.0326843-0.0614319
|
||||
c-0.0267639-0.0416107-0.041626-0.1357269-0.0435791-0.2813721c-0.0128784-0.1555481-0.0128784-0.2883148-0.0128784-0.4111633
|
||||
v-0.4101868c0-0.2754211-0.1030579-0.5568085-0.3012085-0.8580017c-0.2041016-0.2902985-0.525116-0.462677-0.9590759-0.5389709
|
||||
c0.3428345-0.0574646,0.6123047-0.1486206,0.7995605-0.2595825c0.3675842-0.231842,0.5369873-0.6083374,0.5369873-1.0898438
|
||||
c0-0.6925507-0.2734375-1.1661224-0.8500671-1.3979645c-0.3180237-0.1307831-0.8164062-0.1971741-1.506958-0.1971741h-1.9230957
|
||||
V185.5565643z M430.1434326,182.5882263c-0.1951599,0.0842133-0.5053101,0.1228638-0.924408,0.1228638h-0.8678894v-2.0043182
|
||||
h0.8283081c0.5369873,0,0.9263611,0.0762787,1.1680908,0.2149963c0.2466736,0.1377106,0.3656006,0.4042358,0.3656006,0.8035126
|
||||
C430.7131348,182.1513062,430.5278625,182.4306946,430.1434326,182.5882263 M432.9661255,179.279068
|
||||
c-0.9887695-0.9759064-2.1717529-1.4593964-3.5697327-1.4593964c-1.3682556,0-2.5621033,0.48349-3.5281067,1.4593964
|
||||
c-0.9887695,0.9788818-1.4673157,2.1628418-1.4673157,3.552887c0,1.3880615,0.4735718,2.5769806,1.4494629,3.5509033
|
||||
c0.9689636,0.9887848,2.1648254,1.4792175,3.5459595,1.4792175c1.3979797,0,2.5809631-0.4904327,3.5697327-1.4792175
|
||||
c0.9689636-0.9788666,1.4692993-2.1727448,1.4692993-3.5509033
|
||||
C434.4354248,181.4320068,433.9350891,180.2579498,432.9661255,179.279068 M432.4559021,179.77742
|
||||
c0.8460999,0.8263092,1.2602234,1.8567047,1.2602234,3.0545349c0,1.1859589-0.4141235,2.2242737-1.2602234,3.069397
|
||||
c-0.833252,0.841156-1.85672,1.2731323-3.0595093,1.2731323c-1.1938782,0-2.2113647-0.4319763-3.055542-1.2731323
|
||||
c-0.8282776-0.8451233-1.254303-1.8834381-1.254303-3.069397c0-1.1978302,0.4260254-2.2282257,1.254303-3.0545349
|
||||
c0.8560486-0.8599701,1.8695984-1.2820435,3.055542-1.2820435
|
||||
C430.5942078,178.4953766,431.6127319,178.91745,432.4559021,179.77742"/>
|
||||
<g>
|
||||
<path class="st3" d="M296.4403381,172.4392395v-36.1351318h8.9604187v35.6251984
|
||||
c0,5.3908844,3.5699158,8.6692505,10.7825317,8.6692505s10.7825317-3.2783661,10.7825317-8.6692505v-35.6251984h8.9604492
|
||||
v36.1351318c0,10.0534668-7.2126465,16.4645996-19.6701965,16.4645996
|
||||
C303.7257385,188.9038391,296.4403381,182.4927063,296.4403381,172.4392395z"/>
|
||||
<path class="st3" d="M375.7033691,166.3924561v21.4915314l-8.6700134-0.0000153v-21.5643158
|
||||
c0-5.6824341-2.9868164-8.378067-7.3582153-8.378067c-4.0066528,0-7.5037842,2.404068-7.722168,7.2850342v22.6573486
|
||||
h-8.5964661v-37.0090485h5.6096497l1.6029663,3.2052002c2.7684326-2.8412323,6.775116-4.2254333,11.1465149-4.2254333
|
||||
C370.2393188,149.8546906,375.7033691,154.7360229,375.7033691,166.3924561z"/>
|
||||
<path class="st3" d="M383.7144775,136.887207h8.8876343v9.2519836h-8.8876343V136.887207z M383.8600464,150.8749237h8.669281
|
||||
v37.0090485h-8.669281V150.8749237z"/>
|
||||
<path class="st3" d="M420.5768127,179.8702393v8.0137329h-5.2456665c-8.7420654,0-13.1862488-4.516983-13.1862488-13.9149323
|
||||
v-15.0803833h-4.9537659v-8.0137329h4.9537659v-10.5637665h8.6692505v10.5637665h9.2523499v8.0137329h-9.2523499v13.4049988
|
||||
c0,5.2453003,2.1132812,7.5765839,6.3383484,7.5765839H420.5768127z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="artwork">
|
||||
<g>
|
||||
<g>
|
||||
<ellipse class="st3" cx="1438.1523438" cy="40.3328018" rx="4.3671799" ry="4.6571636"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st4" d="M1449.3671875,185.17453c0,0,42.8554688,17.7458191,55.9665527-38.7562561"/>
|
||||
<g>
|
||||
<path class="st2" d="M1515.2062988,150.6308441c-0.2004395,0.6022034-0.7965088,1.0005188-1.4407959,0.8917542
|
||||
l-18.2456055-3.0800781c-0.6442871-0.1087646-1.0772705-0.6807861-1.0688477-1.3153992l-0.0385742-0.0065002
|
||||
c0,0,0.0134277-0.078949,0.0321045-0.1901245c0.0522461-0.3088837-0.0175781,0.1047668,0.1364746-0.8079987
|
||||
c0.4699707-2.7843781,1.265625-7.4972229,1.4852295-8.7984619c0.8564453-5.0735321,4.4857178-8.9770355,9.0693359-10.4446106
|
||||
l-1.2091064,7.1621399c-1.1503906,1.0960236-1.9852295,2.5393066-2.2700195,4.2261658
|
||||
c-0.041748,0.2472992-0.8549805,5.2803802-0.8549805,5.2803802l9.5836182,1.6178284
|
||||
c0,0,0.8430176-4.7857513,0.9511719-5.4262543c0.25-1.4815674,0.0388184-2.928299-0.5042725-4.2173157l1.258667-7.4558563
|
||||
c3.6591797,2.9155731,5.6691895,7.6758728,4.8352051,12.6167603c-0.2275391,1.3476562-1.0369873,6.1426239-1.5119629,8.9560699
|
||||
c-0.1540527,0.9130707-0.0842285,0.4994202-0.1363525,0.8079834c-0.0187988,0.111496-0.0321045,0.1901398-0.0321045,0.1901398
|
||||
L1515.2062988,150.6308441z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st4" d="M1454.5784912,196.9434509c0,0,3.9665527,46.2144318,60.1638184,31.8529053"/>
|
||||
<g>
|
||||
<path class="st2" d="M1515.5456543,239.5000458c-0.6268311,0.0991974-1.2548828-0.2467041-1.4547119-0.8687744
|
||||
l-5.6619873-17.616272c-0.1999512-0.6220703,0.1086426-1.2696533,0.6759033-1.5542603l-0.0119629-0.0372009
|
||||
c0,0,0.0762939-0.0245056,0.1835938-0.0590057c0.2982178-0.0958405-0.1010742,0.0325165,0.7801514-0.2507324
|
||||
c2.6883545-0.8640442,7.2386475-2.3265228,8.4949951-2.7303162c4.8984375-1.5744019,10.0341797-0.1486511,13.4465332,3.2453918
|
||||
l-6.9150391,2.2225342c-1.5025635-0.516983-3.1680908-0.5939789-4.7967529-0.0705261
|
||||
c-0.2387695,0.0767517-5.081543,1.6708984-5.081543,1.6708984l2.973999,9.2530365c0,0,4.6368408-1.453949,5.255249-1.65271
|
||||
c1.4304199-0.4597626,2.6176758-1.3130341,3.512085-2.3884583l7.1987305-2.3136749
|
||||
c-0.904541,4.5904236-4.2058105,8.5656891-8.9763184,10.0989227c-1.3011475,0.4181976-5.9306641,1.9061737-8.6470947,2.7792206
|
||||
c-0.8815918,0.2833405-0.4821777,0.1549835-0.7801514,0.2507324c-0.107666,0.0346069-0.1835938,0.0590057-0.1835938,0.0590057
|
||||
L1515.5456543,239.5000458z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st4" d="M1315.6970215,243.2423553c0,0-21.9627686-40.8551483,32.9356689-59.5780487"/>
|
||||
<g>
|
||||
<path class="st2" d="M1306.9082031,248.4536285c-0.2102051-0.5988464,0.017334-1.278717,0.5932617-1.5871277
|
||||
l16.3127441-8.7341766c0.5760498-0.3084259,1.2685547-0.1211395,1.6503906,0.385788l0.0345459-0.0184479
|
||||
c0,0,0.0377197,0.0706024,0.0909424,0.1699982c0.1478271,0.2761536-0.0501709-0.0936737,0.3868408,0.7223969
|
||||
c1.3328857,2.4893951,3.5888672,6.7029724,4.211792,7.8663483c2.4287109,4.5360565,1.9486084,9.8443756-0.7773438,13.8108063
|
||||
l-3.4284668-6.4033813c0.2387695-1.5709229,0.0152588-3.2232208-0.7922363-4.7313843
|
||||
c-0.1184082-0.2210999-2.5563965-4.6987-2.5563965-4.6987l-8.5683594,4.5876617c0,0,2.2631836,4.3002167,2.5697021,4.872879
|
||||
c0.7092285,1.3246155,1.7619629,2.3392639,2.9805908,3.0260315l3.5690918,6.6659851
|
||||
c-4.6782227-0.0653381-9.1818848-2.5988159-11.5471191-7.0162964c-0.6450195-1.2048645-2.9404297-5.4918671-4.2872314-8.0072479
|
||||
c-0.4370117-0.8163452-0.2390137-0.4465179-0.3867188-0.7223969c-0.0534668-0.0996704-0.0910645-0.1699829-0.0910645-0.1699829
|
||||
L1306.9082031,248.4536285z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<ellipse class="st5" cx="1464.5943604" cy="188.810318" rx="7.7738867" ry="9.5948353"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<ellipse class="st5" cx="1462.7558594" cy="218.225769" rx="7.7738867" ry="9.5948353"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<ellipse class="st5" cx="1339.057251" cy="188.810318" rx="7.7738867" ry="9.5948353"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st6" d="M1456.8769531,228.1189728c0-24.7052765-24.6368408-44.7328644-55.027832-44.7328644
|
||||
c-30.3911133,0-55.0279541,20.0275879-55.0279541,44.7328644s24.6368408,44.7328339,55.0279541,44.7328339
|
||||
c0.0229492,0,0.0457764-0.0006714,0.0687256-0.0007019c0.0229492,0.0000305,0.0457764,0.0007019,0.0687256,0.0007019
|
||||
c0,0-0.0037842-0.0012512-0.0040283-0.0013428C1432.3120117,272.7917786,1456.8769531,252.7880096,1456.8769531,228.1189728z"/>
|
||||
<g>
|
||||
<path class="st5" d="M1401.848999,257.1278992c30.8840332,0,56.3187256-7.3460541,59.763916-20.650116
|
||||
c0.1726074-0.4505463,0.2983398-0.9141541,0.3278809-1.3972931l5.4649658-86.9454346
|
||||
c0.197998-3.2748413-4.7550049-8.4608002-9.0810547-8.6103821l-48.4742432,2.5349731
|
||||
c-4.3260498-0.1495819-11.4047852-0.1500549-15.730835-0.0010834l-48.7462158-2.5328064
|
||||
c-4.3260498,0.1490479-9.2781982,5.3344574-9.0810547,8.6092987l5.4658203,86.9454346
|
||||
c0.0286865,0.4833679,0.1552734,0.9471436,0.3277588,1.3978424"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st2" d="M1401.848877,141.9467468c-2.8059082,0.000946-5.6011963,0.0380554-7.7299805,0.1113739
|
||||
l-48.7453613-2.5328827c-4.3260498,0.1490021-9.2788086,5.334549-9.0811768,8.609436l5.4648438,86.9454651
|
||||
c0.0291748,0.4832611,0.1561279,0.9470215,0.3283691,1.3975525
|
||||
c3.4455566,13.3038635,28.8806152,20.6496277,59.7635498,20.6496277"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st6" d="M1461.5471191,118.1488495c-3.6014404-24.8404541-28.9459229-44.0927124-59.6981201-44.0927124
|
||||
c-30.7520752,0-56.0966797,19.2522583-59.697998,44.0927124l-0.4554443,22.3807983
|
||||
c0,0,22.9992676,10.3432465,60.1534424,10.3432465c37.1542969,0,60.1535645-10.3432465,60.1535645-10.3432465
|
||||
L1461.5471191,118.1488495z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st3" d="M1365.4659424,124.1972198c0.1817627,0.3151855,0.4379883,0.561058,0.7335205,0.7277908l15.00354,8.6623001
|
||||
l0.0003662-0.000473c0.2927246,0.172348,0.6333008,0.2711639,0.9971924,0.2711639s0.704834-0.0988159,0.9970703-0.2711639
|
||||
l15.0040283-8.6623001c0.2954102-0.1667252,0.5506592-0.4121323,0.7329102-0.7273178
|
||||
c0.1821289-0.3151932,0.2669678-0.6594162,0.2636719-0.9989624v-17.3245926l-0.0004883-0.000473
|
||||
c0.0028076-0.3390732-0.0819092-0.6837616-0.2636719-0.9989548c-0.1821289-0.3151855-0.4383545-0.5605927-0.7333984-0.7277908
|
||||
l-15.0040283-8.6623001v-0.0004654c-0.2922363-0.172348-0.6326904-0.2711639-0.996582-0.2711639
|
||||
c-0.3634033,0-0.7039795,0.0988159-0.9962158,0.2711639v0.0004654l-15.00354,8.6623001
|
||||
c-0.2955322,0.1671982-0.5516357,0.4126053-0.7338867,0.7277908c-0.1816406,0.3151932-0.2664795,0.6598816-0.2636719,0.9989548
|
||||
l-0.0004883,0.000473v17.3245926c-0.0031738,0.3395462,0.081543,0.6837692,0.2633057,0.9989624"/>
|
||||
</g>
|
||||
</g>
|
||||
<circle cx="1382.2003174" cy="114.5352554" r="7.8991222"/>
|
||||
<circle class="st3" cx="1384.4804688" cy="112.5474625" r="2.2802224"/>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st3" d="M1405.2994385,124.1972198c0.1816406,0.3151855,0.4378662,0.561058,0.7333984,0.7277908l15.00354,8.6623001
|
||||
l0.0004883-0.000473c0.2927246,0.172348,0.6331787,0.2711639,0.9970703,0.2711639s0.704834-0.0988159,0.9970703-0.2711639
|
||||
l15.0040283-8.6623001c0.2955322-0.1667252,0.5507812-0.4121323,0.7329102-0.7273178
|
||||
c0.182251-0.3151932,0.2669678-0.6594162,0.2636719-0.9989624v-17.3245926l-0.0004883-0.000473
|
||||
c0.0028076-0.3390732-0.0819092-0.6837616-0.2636719-0.9989548c-0.1821289-0.3151855-0.4383545-0.5605927-0.7333984-0.7277908
|
||||
l-15.0040283-8.6623001v-0.0004654c-0.2922363-0.172348-0.6326904-0.2711639-0.996582-0.2711639
|
||||
c-0.3634033,0-0.7038574,0.0988159-0.9960938,0.2711639v0.0004654l-15.00354,8.6623001
|
||||
c-0.2955322,0.1671982-0.5517578,0.4126053-0.7338867,0.7277908c-0.1817627,0.3151932-0.2664795,0.6598816-0.2636719,0.9989548
|
||||
l-0.0004883,0.000473v17.3245926c-0.0032959,0.3395462,0.0814209,0.6837692,0.2631836,0.9989624"/>
|
||||
</g>
|
||||
</g>
|
||||
<circle cx="1422.0336914" cy="114.5352554" r="7.8991222"/>
|
||||
<circle class="st3" cx="1423.0882568" cy="112.5474625" r="2.2802224"/>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st2" d="M1391.7996826,123.6621552C1391.7996826,123.6621552,1391.7996826,123.90728,1391.7996826,123.6621552
|
||||
L1391.7996826,123.6621552z M1378.9281006,123.6621552L1378.9281006,123.6621552L1378.9281006,123.6621552z
|
||||
M1391.3400879,122.4365921L1391.3400879,122.4365921L1391.3400879,122.4365921z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st2" d="M1420.9908447,134.6922913L1420.9908447,134.6922913L1420.9908447,134.6922913z M1427.1968994,123.6621552
|
||||
C1427.1968994,123.6621552,1427.1968994,123.90728,1427.1968994,123.6621552L1427.1968994,123.6621552z
|
||||
M1414.3251953,123.6621552L1414.3251953,123.6621552L1414.3251953,123.6621552z M1426.5073242,122.4365921
|
||||
L1426.5073242,122.4365921L1426.5073242,122.4365921z M1420.9908447,119.7403412L1420.9908447,119.7403412
|
||||
L1420.9908447,119.7403412z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st7" d="M1330.199585,137.1434174c0,35.296402,32.4090576,63.9747467,72.1733398,63.9747467
|
||||
s72.1733398-28.6783142,72.1733398-63.9747314c0,0-10.5732422,50.0032501-72.1733398,51.4739227
|
||||
c0,0-51.2568359,2.6962585-70.7943115-46.3265381L1330.199585,137.1434174z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st3" d="M1402.1430664,190.0880432c-40.9135742,0-74.4719238-29.1685638-74.4719238-64.9551926
|
||||
s33.3284912-64.9552002,74.4719238-64.9552002s74.2419434,29.16856,74.2419434,64.9552002
|
||||
C1476.6148682,160.9194794,1443.286499,190.0880432,1402.1430664,190.0880432z M1402.1430664,62.6287918
|
||||
c-39.7642822,0-72.1733398,27.9429855-72.1733398,62.5040588s32.4090576,62.5040512,72.1733398,62.5040512
|
||||
s71.9434814-27.9429932,71.9434814-62.5040512S1441.9073486,62.6287918,1402.1430664,62.6287918z"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="1437.0030518" y="39.955864" class="st3" width="2.2985139" height="29.4136715"/>
|
||||
</g>
|
||||
</g>
|
||||
<path d="M1421.5812988,147.3400879c2.2796631,0,3.9838867,2.0716553,3.5738525,4.3141785
|
||||
c-2.0300293,11.1029358-11.7537842,19.5184631-23.4431152,19.5184631s-21.4130859-8.4155273-23.4431152-19.5184631
|
||||
c-0.4100342-2.2425232,1.2941895-4.3141785,3.5738525-4.3141785H1421.5812988z"/>
|
||||
<g>
|
||||
<path class="st6" d="M1391.913208,233.8167572c0.0942383,0.1883545,0.2825928,0.2825317,0.4709473,0.4708862l8.8527832,5.0856323
|
||||
l0,0c0.376709,0.1883545,0.8475342,0.1883545,1.2242432,0l8.8527832-5.0856323
|
||||
c0.1883545-0.0941772,0.2825928-0.2825317,0.4709473-0.4708862c0.0941162-0.1883545,0.1883545-0.3767242,0.1883545-0.5650787
|
||||
v-10.2654419l0,0c0-0.1883545-0.0942383-0.376709-0.1883545-0.5650635
|
||||
c-0.0942383-0.1883545-0.2825928-0.282547-0.4709473-0.4709015l-8.8527832-5.0856323l0,0
|
||||
c-0.376709-0.1883545-0.8475342-0.1883545-1.2242432,0l0,0l-8.8527832,5.0856323
|
||||
c-0.1883545,0.0941772-0.376709,0.282547-0.4709473,0.4709015c-0.0941162,0.1883545-0.1883545,0.376709-0.1883545,0.5650635l0,0
|
||||
v10.2654419C1391.7248535,233.440033,1391.8190918,233.6283875,1391.913208,233.8167572"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 22 KiB |
@@ -1,15 +0,0 @@
|
||||
//go:build darwin
|
||||
// +build darwin
|
||||
|
||||
/*
|
||||
* Copyright (C) Danielle De Leo
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -L/opt/homebrew/lib
|
||||
#cgo CFLAGS: -I/opt/homebrew/include
|
||||
*/
|
||||
import "C"
|
||||
@@ -1,14 +0,0 @@
|
||||
//go:build linux || netbsd
|
||||
// +build linux netbsd
|
||||
|
||||
/*
|
||||
* Copyright (C) Max Romanov
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -lrt
|
||||
*/
|
||||
import "C"
|
||||
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -lunit
|
||||
*/
|
||||
import "C"
|
||||
@@ -1,95 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) Max Romanov
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
#include "_cgo_export.h"
|
||||
|
||||
#include <nxt_unit.h>
|
||||
#include <nxt_unit_request.h>
|
||||
|
||||
|
||||
static ssize_t nxt_cgo_port_send(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port,
|
||||
const void *buf, size_t buf_size, const void *oob, size_t oob_size);
|
||||
static ssize_t nxt_cgo_port_recv(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port,
|
||||
void *buf, size_t buf_size, void *oob, size_t *oob_size);
|
||||
|
||||
int
|
||||
nxt_cgo_run(uintptr_t handler)
|
||||
{
|
||||
int rc;
|
||||
nxt_unit_ctx_t *ctx;
|
||||
nxt_unit_init_t init;
|
||||
|
||||
memset(&init, 0, sizeof(init));
|
||||
|
||||
init.callbacks.request_handler = nxt_go_request_handler;
|
||||
init.callbacks.add_port = nxt_go_add_port;
|
||||
init.callbacks.remove_port = nxt_go_remove_port;
|
||||
init.callbacks.port_send = nxt_cgo_port_send;
|
||||
init.callbacks.port_recv = nxt_cgo_port_recv;
|
||||
init.callbacks.shm_ack_handler = nxt_go_shm_ack_handler;
|
||||
init.callbacks.ready_handler = nxt_go_ready;
|
||||
|
||||
init.data = (void *) handler;
|
||||
|
||||
ctx = nxt_unit_init(&init);
|
||||
if (ctx == NULL) {
|
||||
return NXT_UNIT_ERROR;
|
||||
}
|
||||
|
||||
rc = nxt_unit_run_ctx(ctx);
|
||||
|
||||
nxt_unit_done(ctx);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t
|
||||
nxt_cgo_port_send(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port,
|
||||
const void *buf, size_t buf_size, const void *oob, size_t oob_size)
|
||||
{
|
||||
return nxt_go_port_send(port->id.pid, port->id.id,
|
||||
(void *) buf, buf_size, (void *) oob, oob_size);
|
||||
}
|
||||
|
||||
|
||||
static ssize_t
|
||||
nxt_cgo_port_recv(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port,
|
||||
void *buf, size_t buf_size, void *oob, size_t *oob_size)
|
||||
{
|
||||
return nxt_go_port_recv(port->id.pid, port->id.id,
|
||||
buf, buf_size, oob, oob_size);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
nxt_cgo_response_write(nxt_unit_request_info_t *req, uintptr_t start,
|
||||
uint32_t len)
|
||||
{
|
||||
return nxt_unit_response_write_nb(req, (void *) start, len, 0);
|
||||
}
|
||||
|
||||
|
||||
ssize_t
|
||||
nxt_cgo_request_read(nxt_unit_request_info_t *req, uintptr_t dst,
|
||||
uint32_t dst_len)
|
||||
{
|
||||
return nxt_unit_request_read(req, (void *) dst, dst_len);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nxt_cgo_warn(const char *msg, uint32_t msg_len)
|
||||
{
|
||||
nxt_unit_warn(NULL, "%.*s", (int) msg_len, (char *) msg);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nxt_cgo_alert(const char *msg, uint32_t msg_len)
|
||||
{
|
||||
nxt_unit_alert(NULL, "%.*s", (int) msg_len, (char *) msg);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) Max Romanov
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _NXT_CGO_LIB_H_INCLUDED_
|
||||
#define _NXT_CGO_LIB_H_INCLUDED_
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <nxt_unit.h>
|
||||
#include <nxt_unit_request.h>
|
||||
|
||||
enum {
|
||||
NXT_FIELDS_OFFSET = offsetof(nxt_unit_request_t, fields)
|
||||
};
|
||||
|
||||
int nxt_cgo_run(uintptr_t handler);
|
||||
|
||||
ssize_t nxt_cgo_response_write(nxt_unit_request_info_t *req,
|
||||
uintptr_t src, uint32_t len);
|
||||
|
||||
ssize_t nxt_cgo_request_read(nxt_unit_request_info_t *req,
|
||||
uintptr_t dst, uint32_t dst_len);
|
||||
|
||||
void nxt_cgo_warn(const char *msg, uint32_t msg_len);
|
||||
void nxt_cgo_alert(const char *msg, uint32_t msg_len);
|
||||
|
||||
#endif /* _NXT_CGO_LIB_H_INCLUDED_ */
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
type observable struct {
|
||||
sync.Mutex
|
||||
observers []chan int
|
||||
}
|
||||
|
||||
func (o *observable) attach(c chan int) {
|
||||
o.Lock()
|
||||
defer o.Unlock()
|
||||
|
||||
o.observers = append(o.observers, c)
|
||||
}
|
||||
|
||||
func (o *observable) notify(e int) {
|
||||
o.Lock()
|
||||
defer o.Unlock()
|
||||
|
||||
for _, v := range o.observers {
|
||||
v <- e
|
||||
}
|
||||
|
||||
o.observers = nil
|
||||
}
|
||||
205
go/port.go
205
go/port.go
@@ -1,205 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Max Romanov
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
/*
|
||||
#include "nxt_cgo_lib.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"sync"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type port_key struct {
|
||||
pid int
|
||||
id int
|
||||
}
|
||||
|
||||
type port struct {
|
||||
key port_key
|
||||
rcv *net.UnixConn
|
||||
snd *net.UnixConn
|
||||
}
|
||||
|
||||
type port_registry struct {
|
||||
sync.RWMutex
|
||||
m map[port_key]*port
|
||||
}
|
||||
|
||||
var port_registry_ port_registry
|
||||
|
||||
func find_port(key port_key) *port {
|
||||
port_registry_.RLock()
|
||||
res := port_registry_.m[key]
|
||||
port_registry_.RUnlock()
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func add_port(p *port) {
|
||||
|
||||
port_registry_.Lock()
|
||||
if port_registry_.m == nil {
|
||||
port_registry_.m = make(map[port_key]*port)
|
||||
}
|
||||
|
||||
old := port_registry_.m[p.key]
|
||||
|
||||
if old == nil {
|
||||
port_registry_.m[p.key] = p
|
||||
}
|
||||
|
||||
port_registry_.Unlock()
|
||||
}
|
||||
|
||||
func (p *port) Close() {
|
||||
if p.rcv != nil {
|
||||
p.rcv.Close()
|
||||
}
|
||||
|
||||
if p.snd != nil {
|
||||
p.snd.Close()
|
||||
}
|
||||
}
|
||||
|
||||
func getUnixConn(fd int) *net.UnixConn {
|
||||
if fd < 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
f := os.NewFile(uintptr(fd), "sock")
|
||||
defer f.Close()
|
||||
|
||||
c, err := net.FileConn(f)
|
||||
if err != nil {
|
||||
nxt_go_alert("FileConn error %s", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
uc, ok := c.(*net.UnixConn)
|
||||
if !ok {
|
||||
nxt_go_alert("Not a Unix-domain socket %d", fd)
|
||||
return nil
|
||||
}
|
||||
|
||||
return uc
|
||||
}
|
||||
|
||||
//export nxt_go_add_port
|
||||
func nxt_go_add_port(ctx *C.nxt_unit_ctx_t, p *C.nxt_unit_port_t) C.int {
|
||||
|
||||
new_port := &port{
|
||||
key: port_key{
|
||||
pid: int(p.id.pid),
|
||||
id: int(p.id.id),
|
||||
},
|
||||
rcv: getUnixConn(int(p.in_fd)),
|
||||
snd: getUnixConn(int(p.out_fd)),
|
||||
}
|
||||
|
||||
add_port(new_port)
|
||||
|
||||
p.in_fd = -1
|
||||
p.out_fd = -1
|
||||
|
||||
return C.NXT_UNIT_OK
|
||||
}
|
||||
|
||||
//export nxt_go_ready
|
||||
func nxt_go_ready(ctx *C.nxt_unit_ctx_t) C.int {
|
||||
go func(ctx *C.nxt_unit_ctx_t) {
|
||||
C.nxt_unit_run_shared(ctx)
|
||||
}(ctx)
|
||||
|
||||
return C.NXT_UNIT_OK
|
||||
}
|
||||
|
||||
//export nxt_go_remove_port
|
||||
func nxt_go_remove_port(unit *C.nxt_unit_t, ctx *C.nxt_unit_ctx_t,
|
||||
p *C.nxt_unit_port_t) {
|
||||
|
||||
key := port_key{
|
||||
pid: int(p.id.pid),
|
||||
id: int(p.id.id),
|
||||
}
|
||||
|
||||
port_registry_.Lock()
|
||||
if port_registry_.m != nil {
|
||||
delete(port_registry_.m, key)
|
||||
}
|
||||
|
||||
port_registry_.Unlock()
|
||||
}
|
||||
|
||||
//export nxt_go_port_send
|
||||
func nxt_go_port_send(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int,
|
||||
oob unsafe.Pointer, oob_size C.int) C.ssize_t {
|
||||
|
||||
key := port_key{
|
||||
pid: int(pid),
|
||||
id: int(id),
|
||||
}
|
||||
|
||||
p := find_port(key)
|
||||
|
||||
if p == nil {
|
||||
nxt_go_alert("port %d:%d not found", pid, id)
|
||||
return 0
|
||||
}
|
||||
|
||||
n, oobn, err := p.snd.WriteMsgUnix(GoBytes(buf, buf_size),
|
||||
GoBytes(oob, oob_size), nil)
|
||||
|
||||
if err != nil {
|
||||
nxt_go_warn("write result %d (%d), %s", n, oobn, err)
|
||||
|
||||
n = -1
|
||||
}
|
||||
|
||||
return C.ssize_t(n)
|
||||
}
|
||||
|
||||
//export nxt_go_port_recv
|
||||
func nxt_go_port_recv(pid C.int, id C.int, buf unsafe.Pointer, buf_size C.int,
|
||||
oob unsafe.Pointer, oob_size *C.size_t) C.ssize_t {
|
||||
|
||||
key := port_key{
|
||||
pid: int(pid),
|
||||
id: int(id),
|
||||
}
|
||||
|
||||
p := find_port(key)
|
||||
|
||||
if p == nil {
|
||||
nxt_go_alert("port %d:%d not found", pid, id)
|
||||
return 0
|
||||
}
|
||||
|
||||
n, oobn, _, _, err := p.rcv.ReadMsgUnix(GoBytes(buf, buf_size),
|
||||
GoBytes(oob, C.int(*oob_size)))
|
||||
|
||||
if err != nil {
|
||||
if nerr, ok := err.(*net.OpError); ok {
|
||||
if nerr.Err == io.EOF {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
nxt_go_warn("read result %d (%d), %s", n, oobn, err)
|
||||
|
||||
n = -1
|
||||
|
||||
} else {
|
||||
*oob_size = C.size_t(oobn)
|
||||
}
|
||||
|
||||
return C.ssize_t(n)
|
||||
}
|
||||
136
go/request.go
136
go/request.go
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Max Romanov
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
/*
|
||||
#include "nxt_cgo_lib.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"crypto/tls"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type request struct {
|
||||
req http.Request
|
||||
resp response
|
||||
c_req *C.nxt_unit_request_info_t
|
||||
}
|
||||
|
||||
func (r *request) Read(p []byte) (n int, err error) {
|
||||
res := C.nxt_cgo_request_read(r.c_req, buf_ref(p), C.uint32_t(len(p)))
|
||||
|
||||
if res == 0 && len(p) > 0 {
|
||||
return 0, io.EOF
|
||||
}
|
||||
|
||||
return int(res), nil
|
||||
}
|
||||
|
||||
func (r *request) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func new_request(c_req *C.nxt_unit_request_info_t) (r *request, err error) {
|
||||
req := c_req.request
|
||||
|
||||
uri := GoStringN(&req.target, C.int(req.target_length))
|
||||
|
||||
URL, err := url.ParseRequestURI(uri)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
proto := GoStringN(&req.version, C.int(req.version_length))
|
||||
|
||||
r = &request{
|
||||
req: http.Request {
|
||||
URL: URL,
|
||||
Header: http.Header{},
|
||||
RequestURI: uri,
|
||||
Method: GoStringN(&req.method, C.int(req.method_length)),
|
||||
Proto: proto,
|
||||
ProtoMajor: 1,
|
||||
ProtoMinor: int(proto[7] - '0'),
|
||||
ContentLength: int64(req.content_length),
|
||||
Host: GoStringN(&req.server_name, C.int(req.server_name_length)),
|
||||
RemoteAddr: GoStringN(&req.remote, C.int(req.remote_length)),
|
||||
},
|
||||
resp: response{header: http.Header{}, c_req: c_req},
|
||||
c_req: c_req,
|
||||
}
|
||||
|
||||
r.req.Body = r
|
||||
|
||||
if req.tls != 0 {
|
||||
r.req.TLS = &tls.ConnectionState{ }
|
||||
r.req.URL.Scheme = "https"
|
||||
|
||||
} else {
|
||||
r.req.URL.Scheme = "http"
|
||||
}
|
||||
|
||||
fields := get_fields(req)
|
||||
|
||||
for i := 0; i < len(fields); i++ {
|
||||
f := &fields[i]
|
||||
|
||||
n := GoStringN(&f.name, C.int(f.name_length))
|
||||
v := GoStringN(&f.value, C.int(f.value_length))
|
||||
|
||||
r.req.Header.Add(n, v)
|
||||
}
|
||||
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func get_fields(req *C.nxt_unit_request_t) []C.nxt_unit_field_t {
|
||||
f := uintptr(unsafe.Pointer(req)) + uintptr(C.NXT_FIELDS_OFFSET)
|
||||
|
||||
h := &slice_header{
|
||||
Data: unsafe.Pointer(f),
|
||||
Len: int(req.fields_count),
|
||||
Cap: int(req.fields_count),
|
||||
}
|
||||
|
||||
return *(*[]C.nxt_unit_field_t)(unsafe.Pointer(h))
|
||||
}
|
||||
|
||||
//export nxt_go_request_handler
|
||||
func nxt_go_request_handler(c_req *C.nxt_unit_request_info_t) {
|
||||
|
||||
go func(c_req *C.nxt_unit_request_info_t, handler http.Handler) {
|
||||
|
||||
ctx := c_req.ctx
|
||||
|
||||
for {
|
||||
r, err := new_request(c_req)
|
||||
|
||||
if err == nil {
|
||||
handler.ServeHTTP(&r.resp, &r.req)
|
||||
|
||||
if !r.resp.header_sent {
|
||||
r.resp.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
C.nxt_unit_request_done(c_req, C.NXT_UNIT_OK)
|
||||
|
||||
} else {
|
||||
C.nxt_unit_request_done(c_req, C.NXT_UNIT_ERROR)
|
||||
}
|
||||
|
||||
c_req = C.nxt_unit_dequeue_request(ctx)
|
||||
if c_req == nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}(c_req, get_handler(uintptr(c_req.unit.data)))
|
||||
}
|
||||
107
go/response.go
107
go/response.go
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Max Romanov
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
/*
|
||||
#include "nxt_cgo_lib.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type response struct {
|
||||
header http.Header
|
||||
header_sent bool
|
||||
c_req *C.nxt_unit_request_info_t
|
||||
ch chan int
|
||||
}
|
||||
|
||||
func (r *response) Header() http.Header {
|
||||
return r.header
|
||||
}
|
||||
|
||||
func (r *response) Write(p []byte) (n int, err error) {
|
||||
if !r.header_sent {
|
||||
r.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
l := len(p)
|
||||
written := int(0)
|
||||
br := buf_ref(p)
|
||||
|
||||
for written < l {
|
||||
res := C.nxt_cgo_response_write(r.c_req, br, C.uint32_t(l - written))
|
||||
|
||||
written += int(res)
|
||||
br += C.uintptr_t(res)
|
||||
|
||||
if (written < l) {
|
||||
if r.ch == nil {
|
||||
r.ch = make(chan int, 2)
|
||||
}
|
||||
|
||||
wait_shm_ack(r.ch)
|
||||
}
|
||||
}
|
||||
|
||||
return written, nil
|
||||
}
|
||||
|
||||
func (r *response) WriteHeader(code int) {
|
||||
if r.header_sent {
|
||||
nxt_go_warn("multiple response.WriteHeader calls")
|
||||
return
|
||||
}
|
||||
r.header_sent = true
|
||||
|
||||
// Set a default Content-Type
|
||||
if _, hasType := r.header["Content-Type"]; !hasType {
|
||||
r.header.Add("Content-Type", "text/html; charset=utf-8")
|
||||
}
|
||||
|
||||
fields := 0
|
||||
fields_size := 0
|
||||
|
||||
for k, vv := range r.header {
|
||||
for _, v := range vv {
|
||||
fields++
|
||||
fields_size += len(k) + len(v)
|
||||
}
|
||||
}
|
||||
|
||||
C.nxt_unit_response_init(r.c_req, C.uint16_t(code), C.uint32_t(fields),
|
||||
C.uint32_t(fields_size))
|
||||
|
||||
for k, vv := range r.header {
|
||||
for _, v := range vv {
|
||||
C.nxt_unit_response_add_field(r.c_req, str_ref(k), C.uint8_t(len(k)),
|
||||
str_ref(v), C.uint32_t(len(v)))
|
||||
}
|
||||
}
|
||||
|
||||
C.nxt_unit_response_send(r.c_req)
|
||||
}
|
||||
|
||||
func (r *response) Flush() {
|
||||
if !r.header_sent {
|
||||
r.WriteHeader(http.StatusOK)
|
||||
}
|
||||
}
|
||||
|
||||
var observer_registry_ observable
|
||||
|
||||
func wait_shm_ack(c chan int) {
|
||||
observer_registry_.attach(c)
|
||||
|
||||
_ = <-c
|
||||
}
|
||||
|
||||
//export nxt_go_shm_ack_handler
|
||||
func nxt_go_shm_ack_handler(ctx *C.nxt_unit_ctx_t) {
|
||||
observer_registry_.notify(1)
|
||||
}
|
||||
157
go/unit.go
157
go/unit.go
@@ -1,157 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Max Romanov
|
||||
* Copyright (C) NGINX, Inc.
|
||||
*/
|
||||
|
||||
package unit
|
||||
|
||||
/*
|
||||
#include "nxt_cgo_lib.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sync"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type cbuf struct {
|
||||
b C.uintptr_t
|
||||
s C.size_t
|
||||
}
|
||||
|
||||
func buf_ref(buf []byte) C.uintptr_t {
|
||||
if len(buf) == 0 {
|
||||
return 0
|
||||
}
|
||||
|
||||
return C.uintptr_t(uintptr(unsafe.Pointer(&buf[0])))
|
||||
}
|
||||
|
||||
type string_header struct {
|
||||
Data unsafe.Pointer
|
||||
Len int
|
||||
}
|
||||
|
||||
func str_ref(s string) *C.char {
|
||||
header := (*string_header)(unsafe.Pointer(&s))
|
||||
|
||||
return (*C.char)(header.Data)
|
||||
}
|
||||
|
||||
func (buf *cbuf) init_bytes(b []byte) {
|
||||
buf.b = buf_ref(b)
|
||||
buf.s = C.size_t(len(b))
|
||||
}
|
||||
|
||||
type slice_header struct {
|
||||
Data unsafe.Pointer
|
||||
Len int
|
||||
Cap int
|
||||
}
|
||||
|
||||
func (buf *cbuf) GoBytes() []byte {
|
||||
if buf == nil {
|
||||
var b [0]byte
|
||||
return b[:0]
|
||||
}
|
||||
|
||||
header := &slice_header{
|
||||
Data: unsafe.Pointer(uintptr(buf.b)),
|
||||
Len: int(buf.s),
|
||||
Cap: int(buf.s),
|
||||
}
|
||||
|
||||
return *(*[]byte)(unsafe.Pointer(header))
|
||||
}
|
||||
|
||||
func GoBytes(buf unsafe.Pointer, size C.int) []byte {
|
||||
bytesHeader := &slice_header{
|
||||
Data: buf,
|
||||
Len: int(size),
|
||||
Cap: int(size),
|
||||
}
|
||||
|
||||
return *(*[]byte)(unsafe.Pointer(bytesHeader))
|
||||
}
|
||||
|
||||
func GoStringN(sptr *C.nxt_unit_sptr_t, l C.int) string {
|
||||
p := unsafe.Pointer(sptr)
|
||||
b := uintptr(p) + uintptr(*(*C.uint32_t)(p))
|
||||
|
||||
return C.GoStringN((*C.char)(unsafe.Pointer(b)), l)
|
||||
}
|
||||
|
||||
func nxt_go_warn(format string, args ...interface{}) {
|
||||
str := fmt.Sprintf("[go] " + format, args...)
|
||||
|
||||
C.nxt_cgo_warn(str_ref(str), C.uint32_t(len(str)))
|
||||
}
|
||||
|
||||
func nxt_go_alert(format string, args ...interface{}) {
|
||||
str := fmt.Sprintf("[go] " + format, args...)
|
||||
|
||||
C.nxt_cgo_alert(str_ref(str), C.uint32_t(len(str)))
|
||||
}
|
||||
|
||||
type handler_registry struct {
|
||||
sync.RWMutex
|
||||
next uintptr
|
||||
m map[uintptr]*http.Handler
|
||||
}
|
||||
|
||||
var handler_registry_ handler_registry
|
||||
|
||||
func set_handler(handler *http.Handler) uintptr {
|
||||
|
||||
handler_registry_.Lock()
|
||||
if handler_registry_.m == nil {
|
||||
handler_registry_.m = make(map[uintptr]*http.Handler)
|
||||
handler_registry_.next = 1
|
||||
}
|
||||
|
||||
h := handler_registry_.next
|
||||
handler_registry_.next += 1
|
||||
handler_registry_.m[h] = handler
|
||||
|
||||
handler_registry_.Unlock()
|
||||
|
||||
return h
|
||||
}
|
||||
|
||||
func get_handler(h uintptr) http.Handler {
|
||||
handler_registry_.RLock()
|
||||
defer handler_registry_.RUnlock()
|
||||
|
||||
return *handler_registry_.m[h]
|
||||
}
|
||||
|
||||
func reset_handler(h uintptr) {
|
||||
|
||||
handler_registry_.Lock()
|
||||
if handler_registry_.m != nil {
|
||||
delete(handler_registry_.m, h)
|
||||
}
|
||||
|
||||
handler_registry_.Unlock()
|
||||
}
|
||||
|
||||
func ListenAndServe(addr string, handler http.Handler) error {
|
||||
if handler == nil {
|
||||
handler = http.DefaultServeMux
|
||||
}
|
||||
|
||||
h := set_handler(&handler)
|
||||
|
||||
rc := C.nxt_cgo_run(C.uintptr_t(h))
|
||||
|
||||
reset_handler(h)
|
||||
|
||||
if rc != 0 {
|
||||
return http.ListenAndServe(addr, handler)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
45
pkg/Makefile
45
pkg/Makefile
@@ -1,45 +0,0 @@
|
||||
#!/usr/bin/make
|
||||
|
||||
include ../version
|
||||
include shasum.mak
|
||||
|
||||
VERSION ?= $(NXT_VERSION)
|
||||
RELEASE ?= 1
|
||||
|
||||
default:
|
||||
@echo "available targets: dist rpm deb docker npm"
|
||||
|
||||
dist:
|
||||
rm -f unit-$(VERSION).tar.gz
|
||||
cd .. && git archive \
|
||||
--output pkg/unit-$(VERSION).tar.gz \
|
||||
--prefix unit-$(VERSION)/ \
|
||||
--worktree-attributes \
|
||||
$(VERSION) ./
|
||||
$(SHA512SUM) unit-$(VERSION).tar.gz > unit-$(VERSION).tar.gz.sha512
|
||||
|
||||
rpm:
|
||||
@cd rpm && VERSION=$(VERSION) RELEASE=$(RELEASE) make all
|
||||
|
||||
deb:
|
||||
@cd deb && VERSION=$(VERSION) RELEASE=$(RELEASE) make all
|
||||
|
||||
docker:
|
||||
@cd docker && VERSION=$(VERSION) RELEASE=$(RELEASE) make all
|
||||
|
||||
npm:
|
||||
@cd npm && VERSION=$(VERSION) RELEASE=$(RELEASE) make all
|
||||
|
||||
njs:
|
||||
@cd contrib && make .njs
|
||||
|
||||
clean:
|
||||
@cd rpm && make clean
|
||||
@cd deb && make clean
|
||||
@cd docker && make clean
|
||||
@cd npm && make clean
|
||||
@cd contrib && make clean
|
||||
rm -f unit-$(VERSION).tar.gz
|
||||
rm -f unit-$(VERSION).tar.gz.sha512
|
||||
|
||||
.PHONY: default rpm deb docker npm clean
|
||||
@@ -1,140 +0,0 @@
|
||||
all: install
|
||||
|
||||
TOPSRC := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
SRC := $(TOPSRC)/src
|
||||
TARBALLS := $(TOPSRC)/tarballs
|
||||
VPATH := $(TARBALLS)
|
||||
PREFIX = $(TOPSRC)/local
|
||||
PREFIX := $(abspath $(PREFIX))
|
||||
|
||||
PKGS_ALL := $(patsubst $(SRC)/%/Makefile,%,$(wildcard $(SRC)/*/Makefile))
|
||||
|
||||
# Common download locations
|
||||
CONTRIB_NGINX := https://packages.nginx.org/contrib
|
||||
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
NPROC := $(shell getconf _NPROCESSORS_ONLN)
|
||||
_SMP_MFLAGS := -j$(NPROC)
|
||||
|
||||
ifndef GIT
|
||||
ifeq ($(shell git --version >/dev/null 2>&1 || echo FAIL),)
|
||||
GIT = git
|
||||
endif
|
||||
endif
|
||||
GIT ?= $(error git not found)
|
||||
|
||||
ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
|
||||
download = curl -f -L -- "$(1)" > "$@"
|
||||
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
|
||||
download = (rm -f $@.tmp && \
|
||||
wget --passive -c -p -O $@.tmp "$(1)" && \
|
||||
touch $@.tmp && \
|
||||
mv $@.tmp $@ )
|
||||
else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
|
||||
download = (rm -f $@.tmp && \
|
||||
fetch -p -o $@.tmp "$(1)" && \
|
||||
touch $@.tmp && \
|
||||
mv $@.tmp $@)
|
||||
else
|
||||
download = $(error Neither curl nor wget found)
|
||||
endif
|
||||
|
||||
download_pkg = $(call download,$(CONTRIB_NGINX)/$(2)/$(lastword $(subst /, ,$(@)))) || \
|
||||
( $(call download,$(1)) && echo "Please upload $(lastword $(subst /, ,$(@))) to $(CONTRIB_NGINX)" )
|
||||
|
||||
ifeq ($(shell which xz >/dev/null 2>&1 || echo FAIL),)
|
||||
XZ = xz
|
||||
else
|
||||
XZ ?= $(error XZ (LZMA) compressor not found)
|
||||
endif
|
||||
|
||||
ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
|
||||
SHA512SUM = sha512sum --check
|
||||
else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
|
||||
SHA512SUM = shasum -a 512 --check
|
||||
else ifeq ($(shell openssl version >/dev/null 2>&1 || echo FAIL),)
|
||||
SHA512SUM = openssl dgst -sha512
|
||||
else
|
||||
SHA512SUM = $(error SHA-512 checksumming not found)
|
||||
endif
|
||||
|
||||
#
|
||||
# Common helpers
|
||||
#
|
||||
download_git = \
|
||||
rm -Rf -- "$(@:.tar.xz=)" && \
|
||||
$(GIT) init --bare "$(@:.tar.xz=)" && \
|
||||
(cd "$(@:.tar.xz=)" && \
|
||||
$(GIT) remote add origin "$(1)" && \
|
||||
$(GIT) fetch origin "$(2)") && \
|
||||
(cd "$(@:.tar.xz=)" && \
|
||||
$(GIT) archive --prefix="$(notdir $(@:.tar.xz=))/" \
|
||||
--format=tar "$(3)") > "$(@:.xz=)" && \
|
||||
echo "$(3) $(@)" > "$(@:.tar.xz=.githash)" && \
|
||||
rm -Rf -- "$(@:.tar.xz=)" && \
|
||||
$(XZ) --stdout "$(@:.xz=)" > "$@.tmp" && \
|
||||
rm -f "$(@:.xz=)" && \
|
||||
mv -f -- "$@.tmp" "$@"
|
||||
check_githash = \
|
||||
h=`sed -e "s,^\([0-9a-fA-F]\{40\}\) .*/$(notdir $<),\1,g" \
|
||||
< "$(<:.tar.xz=.githash)"` && \
|
||||
test "$$h" = "$1"
|
||||
|
||||
checksum = \
|
||||
$(foreach f,$(filter $(TARBALLS)/%,$^), \
|
||||
grep -- " $(f:$(TARBALLS)/%=%)$$" \
|
||||
"$(SRC)/$(patsubst $(3)%,%,$@)/$(2)SUMS" |) \
|
||||
(cd $(TARBALLS) && $(1))
|
||||
CHECK_SHA512 = $(call checksum,$(SHA512SUM),SHA512,.sum-)
|
||||
UNPACK = $(RM) -R $@ \
|
||||
$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzfo $(f)) \
|
||||
$(foreach f,$(filter %.tar.bz2,$^), && tar xvjfo $(f)) \
|
||||
$(foreach f,$(filter %.tar.xz,$^), && tar xvJfo $(f)) \
|
||||
$(foreach f,$(filter %.zip,$^), && unzip $(f))
|
||||
UNPACK_DIR = $(patsubst %.tar,%,$(basename $(notdir $<)))
|
||||
APPLY = (cd $(UNPACK_DIR) && patch -fp1) <
|
||||
MOVE = mv $(UNPACK_DIR) $@ && touch $@
|
||||
|
||||
# Per-package build rules
|
||||
include $(SRC)/*/Makefile
|
||||
|
||||
# Targets
|
||||
PKGS_DEPS := $(sort $(foreach p,$(PKGS),$(DEPS_$(p))))
|
||||
|
||||
fetch: $(PKGS:%=.sum-%)
|
||||
install: $(PKGS:%=.%)
|
||||
|
||||
clean:
|
||||
-$(RM) $(foreach p,$(PKGS),.$(p) .sum-$(p) .dep-$(p))
|
||||
-$(RM) -R $(foreach p,$(PKGS),$(p))
|
||||
-$(RM) -R "$(PREFIX)"
|
||||
-$(RM) $(TARBALLS)/*.*
|
||||
|
||||
list:
|
||||
@echo Packages:
|
||||
@echo ' $(PKGS)' | tr " " "\n" | sort | tr "\n" " " |fmt
|
||||
@echo Depended-on packages:
|
||||
@echo ' $(PKGS_DEPS)' | tr " " "\n" | sort | tr "\n" " " |fmt
|
||||
|
||||
.PHONY: all fetch install clean list
|
||||
|
||||
# Default pattern rules
|
||||
.sum-%: $(SRC)/%/SHA512SUMS
|
||||
$(CHECK_SHA512)
|
||||
touch $@
|
||||
|
||||
.sum-%:
|
||||
$(error Download and check target not defined for $*)
|
||||
|
||||
# Real dependency on missing packages
|
||||
$(patsubst %,.dep-%,$(PKGS)): .dep-%: .%
|
||||
touch -r $< $@
|
||||
|
||||
.SECONDEXPANSION:
|
||||
|
||||
# Dependency propagation (convert 'DEPS_foo = bar' to '.foo: .bar')
|
||||
$(foreach p,$(PKGS),.$(p)): .%: $$(foreach d,$$(DEPS_$$*),.dep-$$(d))
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
@@ -1,23 +0,0 @@
|
||||
# libunit-wasm
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
|
||||
LIBUNIT_WASM_URL := https://github.com/nginx/unit-wasm.git
|
||||
|
||||
PKGS += libunit-wasm
|
||||
|
||||
DEPS_libunit-wasm = wasi-sysroot $(DEPS_wasi-sysroot)
|
||||
|
||||
$(TARBALLS)/libunit-wasm-$(LIBUNIT_WASM_GITHASH).tar.xz:
|
||||
$(call download_git,$(LIBUNIT_WASM_URL),,$(LIBUNIT_WASM_GITHASH))
|
||||
|
||||
.sum-libunit-wasm: libunit-wasm-$(LIBUNIT_WASM_GITHASH).tar.xz
|
||||
$(call check_githash,$(LIBUNIT_WASM_GITHASH))
|
||||
touch $@
|
||||
|
||||
libunit-wasm: libunit-wasm-$(LIBUNIT_WASM_GITHASH).tar.xz
|
||||
$(UNPACK)
|
||||
$(MOVE)
|
||||
|
||||
.libunit-wasm: libunit-wasm
|
||||
cd $< && CFLAGS= make WASI_SYSROOT=$(TOPSRC)wasi-sysroot V=1 libunit-wasm
|
||||
touch $@
|
||||
@@ -1,2 +0,0 @@
|
||||
LIBUNIT_WASM_VERSION := 0.3.0
|
||||
LIBUNIT_WASM_GITHASH := 01c43784ec53aa1ff22aca7e7ae6f18b4591b514
|
||||
@@ -1,22 +0,0 @@
|
||||
# njs
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
|
||||
NJS_URL := https://hg.nginx.org/njs/archive/$(NJS_VERSION).tar.gz
|
||||
|
||||
PKGS += njs
|
||||
|
||||
$(TARBALLS)/njs-$(NJS_VERSION).tar.gz:
|
||||
$(call download_pkg,$(NJS_URL),njs)
|
||||
|
||||
.sum-njs: njs-$(NJS_VERSION).tar.gz
|
||||
|
||||
njs: njs-$(NJS_VERSION).tar.gz .sum-njs
|
||||
$(UNPACK)
|
||||
$(MOVE)
|
||||
|
||||
.njs: njs
|
||||
cd $< && ./configure \
|
||||
--no-libxml2 \
|
||||
--no-zlib \
|
||||
&& $(MAKE) libnjs
|
||||
touch $@
|
||||
@@ -1 +0,0 @@
|
||||
cc3110a0c6866dfc03d19c58745e5b75aa9792999db45bc55a752f7b04db8ae51322bfe0156b873109c8477c6c1a030c851c770697cf6791c6e89fb2fed0a2c5 njs-0.8.2.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
NJS_VERSION := 0.8.2
|
||||
@@ -1,17 +0,0 @@
|
||||
# wasi-sysroot
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
|
||||
WASI_SYSROOT_URL := https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WASI_SYSROOT_VERSION_MAJOR)/wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz
|
||||
|
||||
PKGS += wasi-sysroot
|
||||
|
||||
$(TARBALLS)/wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz:
|
||||
$(call download_pkg,$(WASI_SYSROOT_URL),wasi-sysroot)
|
||||
|
||||
.sum-wasi-sysroot: wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz
|
||||
|
||||
wasi-sysroot: wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz .sum-wasi-sysroot
|
||||
$(UNPACK)
|
||||
|
||||
.wasi-sysroot: wasi-sysroot
|
||||
touch $@
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user