Skip to content

Commit 32ae86e

Browse files
committed
doc(sys): document NGINX_SOURCE_DIR and NGINX_BUILD_DIR
1 parent 0a43b67 commit 32ae86e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

nginx-sys/README.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,33 @@ Add `nginx-sys` as a dependency in your `Cargo.toml`:
1212
nginx-sys = "0.5.0"
1313
```
1414

15+
Set the path to your nginx sources and build directory using the
16+
[environment variables](#input-variables), or enable the `nginx-sys/vendored`
17+
feature to use a downloaded copy of the nginx sources.
18+
19+
Note that it is recommended to use the exact source and `configure` arguments
20+
of the nginx build you are planning to use in production.
21+
`configure` arguments alter the APIs and the symbols visible to the Rust code,
22+
and some OS distributions are known to ship nginx packages with API-breaking
23+
patches applied.
24+
1525
## Features
1626

1727
- `vendored`: Enables the build scripts to download and build a copy of nginx
1828
source and link against it.
19-
This feature is enabled by default.
29+
30+
## Input variables
31+
32+
`NGINX_SOURCE_DIR`, `NGINX_BUILD_DIR` control paths to an external nginx source
33+
tree and a configured build directory. Normally, specifying either of these is
34+
sufficient, as the build directory defaults to `objs` under the source dir.
35+
36+
However, it's possible to set the latter to any valid path with
37+
`configure --builddir=<...>`, and we need _both_ paths to support such
38+
configuration.
39+
40+
The variables above are optional, but take preference when the `vendored` crate
41+
feature is enabled.
2042

2143
## Output variables
2244

0 commit comments

Comments
 (0)