From ce7cee8f34052b4715081aae632dad09174a674d Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Fri, 19 Aug 2016 11:12:22 -0700 Subject: [PATCH] Allow a custom path to bindgen in etc/bindings.sh --- etc/bindings.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 etc/bindings.sh diff --git a/etc/bindings.sh b/etc/bindings.sh old mode 100644 new mode 100755 index baf270647..ba1c59b79 --- a/etc/bindings.sh +++ b/etc/bindings.sh @@ -10,7 +10,15 @@ if [[ "$1" == "msvc14" ]] ; then EXTRA_FLAGS="$EXTRA_FLAGS -fvisibility=hidden" fi -../../rust-bindgen/target/debug/bindgen \ +: ${BINDGEN:=../../rust-bindgen/target/debug/bindgen} + +if [[ ! -x "$BINDGEN" ]]; then + echo "error: BINDGEN does not exist or isn't executable!" + echo "error: with BINDGEN=$BINDGEN" + exit 1 +fi + +$BINDGEN \ ${EXTRA_FLAGS} \ -no-class-constants \ -no-type-renaming \