Skip to content

Commit 91a042b

Browse files
committed
doc: document integration with the NGINX buildsystem
1 parent 3aebcdb commit 91a042b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ Example modules are available in [examples](examples) folder. You can use `cargo
7575
For example (all examples plus linux specific):
7676
`cargo build --package=examples --examples --features=linux`
7777

78+
### Build with external NGINX source tree
79+
80+
If you require a customized NGINX configuration, you can build a module against an existing pre-configured source tree.
81+
To do that, you need to set the `NGX_OBJS` variable to an _absolute_ path of the NGINX build directory (`--builddir`, defaults to the `objs` in the source directory).
82+
Only the `./configure` step of the NGINX build is mandatory because bindings don't depend on any of the artifacts generated by `make`.
83+
84+
85+
```
86+
NGX_OBJS=$PWD/../nginx/objs cargo build --package=examples --examples
87+
88+
```
89+
90+
Furthermore, this approach can be leveraged to build a module as a part of the NGINX build process by adding the `--add-module`/`--add-dynamic-module` options to the configure script.
91+
See the following example integration scripts: [`examples/config`](examples/config) and [`examples/config.make`](examples/config.make).
92+
7893
### Docker
7994

8095
We provide a multistage [Dockerfile](Dockerfile):

0 commit comments

Comments
 (0)