Skip to content

Commit

Permalink
doc: document integration with the NGINX buildsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
bavshin-f5 committed Apr 25, 2024
1 parent 13f46d3 commit 8875fb8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ Example modules are available in [examples](examples) folder. You can use `cargo
For example (all examples plus linux specific):
`cargo build --package=examples --examples --features=linux`

### Build with external NGINX source tree

If you require a customized NGINX configuration, you can build a module against an existing pre-configured source tree.
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).
Only the `./configure` step of the NGINX build is mandatory because bindings don't depend on any of the artifacts generated by `make`.


```
NGX_OBJS=$PWD/../nginx/objs cargo build --package=examples --examples
```

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.
See the following example integration scripts: [`examples/config`](examples/config) and [`examples/config.make`](examples/config.make).

### Docker

We provide a multistage [Dockerfile](Dockerfile):
Expand Down

0 comments on commit 8875fb8

Please sign in to comment.