[librsvg/librsvg-2.44] Support selecting a different Rust toolchain



commit 15d4ca7c9a39510a8329935395a3120d86c630c9
Author: Tobias Kortkamp <tobik FreeBSD org>
Date:   Wed Jan 16 21:36:53 2019 +0100

    Support selecting a different Rust toolchain
    
    At the moment the values passed through the RUSTC and CARGO environment
    variables when running configure are ignored and just `rustc`/`cargo`
    as found on the PATH are used.
    
    This is problematic during package builds where we might have to
    select a specific Rust toolchain, i.e., make sure to always use the
    system Rust toolchain vs a rustup toolchain.
    
    Signed-off-by: Tobias Kortkamp <tobik FreeBSD org>

 Makefile.am  | 8 ++++----
 configure.ac | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 1963570f..acf51182 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -147,11 +147,11 @@ CARGO_TARGET_DIR=@abs_top_builddir@/target
 
 check-local:
        cd $(srcdir) && \
-       CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) cargo test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) 
$(CARGO_RELEASE_ARGS)
+       CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) $(CARGO) test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) 
$(CARGO_RELEASE_ARGS)
 
 clean-local:
        cd $(top_srcdir) && \
-       CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) cargo clean
+       CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) $(CARGO) clean
 
 distcheck-hook:
        if test -z "${DESTDIR}";                                                \
@@ -162,7 +162,7 @@ distcheck-hook:
 
 dist-hook:
        (cd $(distdir) &&                                                       \
-       cargo vendor -q &&                                                      \
+       $(CARGO) vendor -q &&                                                   \
        mkdir .cargo &&                                                         \
        cp cargo-vendor-config .cargo/config)
 
@@ -171,7 +171,7 @@ $(RUST_LIB): $(RUST_SRC)
        PKG_CONFIG_ALLOW_CROSS=1                                                \
        PKG_CONFIG='$(PKG_CONFIG)'                                              \
        CARGO_TARGET_DIR=$(CARGO_TARGET_DIR)                                    \
-       cargo build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS)
+       $(CARGO) build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS)
 
 librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
        -I$(top_srcdir)                         \
diff --git a/configure.ac b/configure.ac
index cfd0a663..d566ab49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,11 +73,11 @@ AC_SUBST(DLOPEN_LIBS)
 
 dnl ===========================================================================
 
-AC_CHECK_PROG(CARGO, [cargo], [yes], [no])
+AC_CHECK_PROGS(CARGO, [cargo], [no])
 AS_IF(test x$CARGO = xno,
     AC_MSG_ERROR([cargo is required.  Please install the Rust toolchain from https://www.rust-lang.org/])
 )
-AC_CHECK_PROG(RUSTC, [rustc], [yes], [no])
+AC_CHECK_PROGS(RUSTC, [rustc], [no])
 AS_IF(test x$RUSTC = xno,
     AC_MSG_ERROR([rustc is required.  Please install the Rust toolchain from https://www.rust-lang.org/])
 )
@@ -87,7 +87,7 @@ dnl If you change this, please update COMPILING.md
 MINIMUM_RUST_MAJOR=1
 MINIMUM_RUST_MINOR=27
 
-rust_version=`rustc --version`
+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`


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