From 846f3d13c6d72b6e7946f0c0c7232c51bdcb0eea Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Thu, 26 Jan 2023 14:59:52 +0000 Subject: [PATCH] rust: Make it work on FreeBSD Signed-off-by: Christine Caulfield Reviewed-by: Jan Friesse --- bindings/rust/Makefile.am | 6 +++--- bindings/rust/tests/build.rs.in | 1 + build-aux/rust-regen.sh | 1 - build-aux/rust.mk | 1 + include/corosync/cpg.h | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bindings/rust/Makefile.am b/bindings/rust/Makefile.am index b152ba7e..2fd46a21 100644 --- a/bindings/rust/Makefile.am +++ b/bindings/rust/Makefile.am @@ -37,10 +37,10 @@ RUST_BUILT_SRCS = \ src/sys/cmap.rs src/sys/cpg.rs: ../../include/corosync/cpg.h - $(top_srcdir)/build-aux/rust-regen.sh $^ $@ CPG -- -I$(top_srcdir)/include + $(top_srcdir)/build-aux/rust-regen.sh $^ $@ CPG --blocklist-function=inet6.* --blocklist-function==.*etsourcefilter -- -I$(top_srcdir)/include src/sys/cfg.rs: ../../include/corosync/cfg.h - $(top_srcdir)/build-aux/rust-regen.sh $^ $@ CFG -- -I$(top_srcdir)/include + $(top_srcdir)/build-aux/rust-regen.sh $^ $@ CFG --blocklist-function=inet6.* --blocklist-function=.*etsourcefilter -- -I$(top_srcdir)/include src/sys/quorum.rs: ../../include/corosync/quorum.h $(top_srcdir)/build-aux/rust-regen.sh $^ $@ QUORUM -- -I$(top_srcdir)/include @@ -49,7 +49,7 @@ src/sys/votequorum.rs: ../../include/corosync/votequorum.h $(top_srcdir)/build-aux/rust-regen.sh $^ $@ VOTEQUORUM -- -I$(top_srcdir)/include src/sys/cmap.rs: ../../include/corosync/cmap.h - $(top_srcdir)/build-aux/rust-regen.sh $^ $@ CMAP -- -I$(top_srcdir)/include + $(top_srcdir)/build-aux/rust-regen.sh $^ $@ CMAP -- -I$(top_srcdir)/include $(LIBQB_CFLAGS) all-local: cargo-tree-prep target/$(RUST_TARGET_DIR)/cpg.rlib \ target/$(RUST_TARGET_DIR)/cfg.rlib \ diff --git a/bindings/rust/tests/build.rs.in b/bindings/rust/tests/build.rs.in index b187d1a5..39a97ba4 100644 --- a/bindings/rust/tests/build.rs.in +++ b/bindings/rust/tests/build.rs.in @@ -11,6 +11,7 @@ fn main() { // Tell the compiler to use the build-tree libs & headers for compiling println!("cargo:rustc-link-search=native=../../../lib/.libs/"); println!("cargo:rustc-link-search=native=../../../common_lib/.libs/"); + println!("cargo:rustc-flags=@LIBQBLIBS@"); println!("cargo:rustc-link-lib=cpg"); println!("cargo:rustc-link-lib=cfg"); println!("cargo:rustc-link-lib=cmap"); diff --git a/build-aux/rust-regen.sh b/build-aux/rust-regen.sh index 15a3790d..bfb17494 100755 --- a/build-aux/rust-regen.sh +++ b/build-aux/rust-regen.sh @@ -18,7 +18,6 @@ shift; shift; shift bindgen \ --size_t-is-usize \ - --no-recursive-allowlist \ --no-prepend-enum-name \ --no-layout-tests \ --no-doc-comments \ diff --git a/build-aux/rust.mk b/build-aux/rust.mk index a1fee17f..00beb1f4 100644 --- a/build-aux/rust.mk +++ b/build-aux/rust.mk @@ -22,6 +22,7 @@ build.rs: build.rs.in cat $^ | sed \ -e 's#@ABSTOPLEVELSRC@#$(abs_top_srcdir)#g' \ -e 's#@ABSTOPLEVELBUILD@#$(abs_top_builddir)#g' \ + -e 's#@LIBQBLIBS@#$(LIBQB_LIBS)#g' \ > $@-t chmod a-w $@-t mv $@-t $@ diff --git a/include/corosync/cpg.h b/include/corosync/cpg.h index 600bbf70..39200fd5 100644 --- a/include/corosync/cpg.h +++ b/include/corosync/cpg.h @@ -36,6 +36,7 @@ #define COROSYNC_CPG_H_DEFINED #include +#include #include #ifdef __cplusplus