]> git.ipfire.org Git - people/ms/suricata.git/commit - configure.ac
rust: only run cbindgen if needed
authorJason Ish <jason.ish@oisf.net>
Wed, 17 Jun 2020 22:44:28 +0000 (16:44 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 5 Aug 2020 11:51:18 +0000 (13:51 +0200)
commite6668560e0740888b6d8a4128f092a455918ce7f
treed69cab607b25da52ee30b1a0838068dc4c4edb81
parentfd5d8b78d02a9584cbea10ce4b102856611e6f63
rust: only run cbindgen if needed

Only run cbindgen when necessary. This is a bit tricky. When
building a dist we want to unconditionally build the headers.

When going through a "make; sudo make install" type process,
cbindgen should not be run as the headers already exist, are
valid, and the environment under sudo is more often than
not suitable to pick up the Rust toolchains when installed
with rustup.

For the normal "make" case we have the gen/rust-bindings.h file
depend on library file, this will cause it to only be rebuilt
if the code was modified.

For "make dist" we unconditionally create "dist/rust-bindings.h".
This means the generated file could be in 2 locations, so update
configure.ac, and the library search find to find it.

The "gen/rust-bindings.h" should be picked up first if it exists,
for those who develop from a dist archive where "dist/rust-bindings.h"
also exists.

Not completely happy having the same file in 2 locations, but not
sure how else to get the dependency tracking correct.
configure.ac
rust/Makefile.am