From 5df9c33d704997db64224b043547ee68c7c1ae6e Mon Sep 17 00:00:00 2001 From: emma Date: Wed, 27 Dec 2023 23:20:31 -0700 Subject: [PATCH] GNUmakefile: bandaid solution to fallback sysexits.h not working with Rust --- GNUmakefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index e53ec6f..da8a673 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -40,7 +40,9 @@ endif build: build_dir false intcmp scrut str strcmp true build_dir: - mkdir -p build/bin build/lib build/o + # keep build/include until bindgen(1) has stdin support + # https://github.com/rust-lang/rust-bindgen/issues/2703 + mkdir -p build/bin build/include build/lib build/o clean: rm -rf build/ @@ -58,8 +60,12 @@ test: build tests/posix-compat.sh sysexits: build_dir + # bandage solution until bindgen(1) gets stdin support + printf '#define EXIT_FAILURE 1\n' | cat - include/sysexits.h \ + > build/include/sysexits.h bindgen --default-macro-constant-type signed --use-core \ - "$$(printf '#include \n' | cpp -M -idirafter include - \ + "$$(printf '#include \n' \ + | cpp -M -idirafter "$$PWD/build/include" - \ | sed 's/ /\n/g' | grep sysexits.h)" \ | $(RUSTC) $(RUSTCFLAGS) --crate-type lib -o build/o/libsysexits.rlib -