aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in12
-rwxr-xr-xconfigure18
2 files changed, 20 insertions, 10 deletions
diff --git a/Makefile.in b/Makefile.in
index 4d713ce8945..cd174129f93 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -48,6 +48,7 @@ endif
export CFG_RUSTC
export CFG_RUSTC_FLAGS
+export CFG_LOCAL_RUSTC
export RUSTC=$(CFG_RUSTC)
export RUSTFLAGS=$(CFG_RUSTC_FLAGS)
@@ -75,13 +76,20 @@ $(S)config.stamp : $(S)configure $(S)Makefile.in
$(Q)$(S)configure $(CFG_CONFIGURE_ARGS)
# Build the compiler
+ifneq ($(CFG_LOCAL_RUSTC),1)
$(CFG_RUSTC):
$(MAKE) -C "$(CFG_BUILD_DIR)src/rust" CFG_RUSTC_FLAGS="" RUSTFLAGS=""
-rust: $(CFG_RUSTC)
-
clean-rust:
$(MAKE) -C "$(CFG_BUILD_DIR)src/rust" CFG_RUSTC_FLAGS="" RUSTFLAGS="" clean
+else
+$(CFG_RUSTC):
+
+clean-rust:
+
+endif
+
+rust: $(CFG_RUSTC)
define DEF_SUBMODULE_VARS
DEPS_$(1) =
diff --git a/configure b/configure
index c325bf5e731..0103ae80fa3 100755
--- a/configure
+++ b/configure
@@ -285,7 +285,7 @@ opt optimize 1 "build optimized rust code"
opt optimize-cxx 1 "build optimized C++ code"
opt manage-submodules 1 "let the build manage the git submodules"
opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
-valopt local-rust-root "/usr/local" "set prefix for local rust binary"
+valopt local-rust-root "" "set prefix for local rust binary"
if [ $HELP -eq 1 ]
then
@@ -306,18 +306,19 @@ probe_need CFG_AUTOCONF213 autoconf213 \
if [ ! -z "$CFG_LOCAL_RUST_ROOT" ]
then
- if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc ]
+ if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc ]
then
- msg "using in-tree rust compiler"
- # The Rust compiler we're going to build
- CFG_RUSTC="${CFG_BUILD_DIR}src/rust/${DEFAULT_HOST_TRIPLE}/stage2/bin/rustc"
- else
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc --version`
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: " $LRV
- CFG_RUSTC=${CFG_LOCAL_RUST_ROOT}/bin/rustc
+ CFG_RUSTC=${CFG_LOCAL_RUST_ROOT}/bin/rustc
+ CFG_LOCAL_RUSTC=1
+ else
+ err "No rustc found at ${CFG_LOCAL_RUST_ROOT}/bin/rustc"
fi
else
- probe_need CFG_RUSTC rustc
+ step_msg "using in-tree rust compiler"
+ # The Rust compiler we're going to build
+ CFG_RUSTC="${CFG_BUILD_DIR}src/rust/${DEFAULT_HOST_TRIPLE}/stage2/bin/rustc"
fi
if [ ! -z "$CFG_ENABLE_CLANG" ]
@@ -524,6 +525,7 @@ putvar CFG_C_COMPILER
putvar CFG_SUBMODULES
putvar CFG_DISABLE_MANAGE_SUBMODULES
putvar CFG_RUSTC
+putvar CFG_LOCAL_RUSTC
msg
copy_if_changed ${CFG_SRC_DIR}Makefile.in ${CFG_BUILD_DIR}Makefile