mirror of
https://github.com/rust-lang/rust
synced 2024-10-06 08:40:35 +00:00
Use system rustc if configured with --enable-local-rust
This commit makes the configuration system autodetect a rustc that is already installed and use that instead of downloading a snapshot.
This commit is contained in:
parent
8a02304a44
commit
ddeb3db872
16
configure
vendored
16
configure
vendored
|
@ -557,13 +557,21 @@ fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
|
if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
|
||||||
then
|
then
|
||||||
if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
|
system_rustc=$(which rustc)
|
||||||
|
if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
|
||||||
then
|
then
|
||||||
err "no local rust to use"
|
: # everything already configured
|
||||||
|
elif [ -n "$system_rustc" ]
|
||||||
|
then
|
||||||
|
# we assume that rustc is in a /bin directory
|
||||||
|
CFG_LOCAL_RUST_ROOT=${system_rustc%/bin/rustc}
|
||||||
else
|
else
|
||||||
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
|
err "no local rust to use"
|
||||||
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
|
||||||
|
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
|
||||||
|
putvar CFG_LOCAL_RUST_ROOT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Force freebsd to build with clang; gcc doesn't like us there
|
# Force freebsd to build with clang; gcc doesn't like us there
|
||||||
|
|
Loading…
Reference in a new issue