]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: don't fail distcheck if cargo-vendor not found
authorJason Ish <ish@unx.ca>
Wed, 7 Jun 2017 19:25:16 +0000 (13:25 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 12 Jun 2017 17:27:36 +0000 (19:27 +0200)
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

index d4bbd15a68770f9b3aabdc4831cb04f4856ed71c..09cfc2554fe50b7f55f956096aab21fb1d335327 100644 (file)
@@ -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