diff --git a/configure.ac b/configure.ac index afe93bd8fa..fb19c26922 100644 --- a/configure.ac +++ b/configure.ac @@ -2178,6 +2178,9 @@ fi AC_SUBST(rust_vendor_comment) AM_CONDITIONAL([HAVE_RUST_VENDOR], [test "x$have_rust_vendor" = "xyes"]) +# Bindgen requires rustfmt. + AC_PATH_PROG([RUSTFMT], [rustfmt], [no]) + # Check for bindgen AC_PATH_PROG([BINDGEN], [bindgen], [no]) if test "x$BINDGEN" != "xno"; then @@ -2194,7 +2197,7 @@ fi BINDGEN="no" fi fi - AM_CONDITIONAL([HAVE_BINDGEN], [test "x$BINDGEN" != "xno"]) + AM_CONDITIONAL([HAVE_BINDGEN], [test "x$BINDGEN" != "xno" -a "x$RUSTFMT" != "xno"]) have_rust_headers="no" AC_MSG_CHECKING(for $srcdir/rust/dist/rust-bindings.h) diff --git a/rust/Makefile.am b/rust/Makefile.am index 49104786ae..b4c33d74bc 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -119,7 +119,7 @@ if HAVE_BINDGEN echo "Not checking bindings for out of tree build"; \ fi else - @echo "Unable to check bindgen bindings: bindgen not found" + @echo "Unable to check bindgen bindings: bindgen or rustfmt not found" endif check: @@ -165,7 +165,7 @@ if HAVE_BINDGEN cat sys/src/jsonbuilder.rs.tmp >> sys/src/jsonbuilder.rs rm -f sys/src/jsonbuilder.rs.tmp else - @echo "error: bindgen not installed, can't update bindings" + @echo "error: bindgen or rustfmt not installed, can't update bindings" exit 1 endif