[librsvg: 1/4] configure: Fix rustc version check




commit 3dfd07023f19e465070dd42faef3480abc064819
Author: Ismael Luceno <ismael iodev co uk>
Date:   Sat Aug 28 18:05:43 2021 +0200

    configure: Fix rustc version check
    
    The requirement is for rustc >= 1.52, yet the test would fail for any x.y
    with y < 52.
    
    Use AX_COMPARE_VERSION instead (from autoconf-archive).
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/581>

 configure.ac | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8bef7398..6ec8b72a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,17 +104,11 @@ AS_IF(test x$RUSTC = xno,
 
 dnl MSRV - Minimum Supported Rust Version
 dnl If you change this, please update COMPILING.md
-MINIMUM_RUST_MAJOR=1
-MINIMUM_RUST_MINOR=52
-
-rust_version=`$RUSTC --version`
-version=`echo "$rust_version" | sed -e 's/^rustc //g'`
-major=`echo "$version" | cut -d. -f1`
-minor=`echo "$version" | cut -d. -f2`
-
-AS_IF(test "$major" -lt "$MINIMUM_RUST_MAJOR" -o "$minor" -lt "$MINIMUM_RUST_MINOR",
-    AC_MSG_ERROR([librsvg needs at rustc version at least $MINIMUM_RUST_MAJOR.$MINIMUM_RUST_MINOR])
-)
+MINIMUM_RUST_VER=1.52
+rust_version=`$RUSTC --version | sed -e 's/^rustc //g'`
+AX_COMPARE_VERSION([$rust_version],[lt],[$MINIMUM_RUST_VER], [
+    AC_MSG_ERROR([librsvg needs at least rustc version $MINIMUM_RUST_VER])
+])
 
 dnl ===========================================================================
 
@@ -371,7 +365,7 @@ librsvg-$VERSION
 
        prefix:                         ${prefix}
        C compiler:                     ${CC}
-       rustc:                          ${rust_version}
+       rustc:                          rustc ${rust_version}
 
        Cairo version:                  ${CAIRO_VERSION}
        Pango version:                  ${PANGO_VERSION}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]