]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: check for minimum Rust version of 1.33.0.
authorJason Ish <jason.ish@oisf.net>
Tue, 27 Aug 2019 16:15:14 +0000 (10:15 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 30 Aug 2019 15:17:14 +0000 (09:17 -0600)
Related Redmine ticket:
https://redmine.openinfosecfoundation.org/issues/2629

configure.ac

index b087c4e04206c17916d28f00b69673326cb250fc..61253e2e108d57ef8f1050b8b3ba9def8fd6fa47 100644 (file)
@@ -2379,12 +2379,26 @@ fi
 
     enable_rust="yes"
     rust_compiler_version=$($RUSTC --version)
+    rustc_version=$(echo "$rust_compiler_version" | sed 's/^.*[[^0-9]]\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\).*$/\1/')
     rust_cargo_version=$($CARGO --version)
 
+    MIN_RUSTC_VERSION="1.33.0"
+    AC_MSG_CHECKING(for Rust version $MIN_RUSTC_VERSION or newer)
+    AS_VERSION_COMPARE([$rustc_version], [$MIN_RUSTC_VERSION],
+        [
+            echo ""
+            echo "ERROR: Rust $MIN_RUSTC_VERSION or newer required."
+            echo ""
+            echo "Rust version ${rustc_version} was found."
+            echo ""
+            exit 1
+       ],
+       [],
+       [])
+    AC_MSG_RESULT(yes)
+
     rust_vendor_comment="# "
     have_rust_vendor="no"
-    rust_compiler_version="not set"
-    rust_cargo_version="not set"
 
     # We may require Python if the Rust header stubs are not already
     # generated.
@@ -2416,9 +2430,6 @@ fi
       rust_vendor_comment=""
     fi
 
-    rust_compiler_version=$(rustc --version)
-    rust_cargo_version=$(cargo --version)
-
     AC_SUBST(rust_vendor_comment)
     AM_CONDITIONAL([HAVE_RUST_VENDOR], [test "x$have_rust_vendor" = "xyes"])
 
@@ -2600,8 +2611,10 @@ SURICATA_BUILD_CONF="Suricata Configuration:
 
   Rust support:                            ${enable_rust}
   Rust strict mode:                        ${enable_rust_strict}
-  Rust compiler:                           ${rust_compiler_version}
-  Rust cargo:                              ${rust_cargo_version}
+  Rust compiler path:                      ${RUSTC}
+  Rust compiler version:                   ${rust_compiler_version}
+  Cargo path:                              ${CARGO}
+  Cargo version:                           ${rust_cargo_version}
 
   Python support:                          ${enable_python}
   Python path:                             ${python_path}