From fafa75035f213b9a1d946f9d4a3b101639c9d7d3 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 7 Jun 2017 13:25:16 -0600 Subject: [PATCH] rust: don't fail distcheck if cargo-vendor not found Allow distcheck to pass if cargo vendor is not found by not failing out. It is not required to successfully build a dist tarball, the Rust sources will just not be vendored in. Also don't fail out make dist if Python is not installed. A build will still be successful is Python is available on the end build system. --- rust/Makefile.am | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/rust/Makefile.am b/rust/Makefile.am index d4bbd15a68..09cfc2554f 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -1,12 +1,14 @@ EXTRA_DIST = Cargo.toml \ src \ .cargo/config.in \ - gen-c-headers.py \ - gen/c-headers + gen-c-headers.py if HAVE_RUST -EXTRA_DIST += Cargo.lock \ - vendor + +EXTRA_DIST += Cargo.lock + +if HAVE_CARGO_VENDOR +EXTRA_DIST += vendor endif if HAVE_RUST_VENDOR @@ -17,15 +19,6 @@ if !DEBUG RELEASE = --release endif -gen/c-headers: -if HAVE_PYTHON - cd $(top_srcdir)/rust && python ./gen-c-headers.py -else - @echo "python not available, will not generate headers" -endif - -if HAVE_RUST - FEATURES = if HAVE_LUA @@ -56,15 +49,25 @@ check: Cargo.lock: Cargo.toml cargo update -else -all-local clean-local check: -endif if HAVE_CARGO_VENDOR vendor: cargo vendor > /dev/null else vendor: - @echo "error: cargo vendor not installed" - exit 1 +endif + +else # HAVE_RUST + +all-local clean-local check vendor: + +endif # HAVE_RUST + +# Can only include the headers if we have Python to generate them. +if HAVE_PYTHON +EXTRA_DIST += gen/c-headers +gen/c-headers: + cd $(top_srcdir)/rust && python ./gen-c-headers.py +else +gen/c-headers: endif