Auto merge of #33824 - alexcrichton:rustbuild-fix-local-rust, r=nikomatsakis
rustbuild: Add support for --enable-local-rust This commit adds support for the `--enable-local-rust` `./configure` switch which uses the locally installed `rustc` to bootstrap the compiler.
This commit is contained in:
commit
90d9a515af
1 changed files with 8 additions and 4 deletions
|
@ -65,8 +65,8 @@ pub struct Config {
|
||||||
pub build: String,
|
pub build: String,
|
||||||
pub host: Vec<String>,
|
pub host: Vec<String>,
|
||||||
pub target: Vec<String>,
|
pub target: Vec<String>,
|
||||||
pub rustc: Option<String>,
|
pub rustc: Option<PathBuf>,
|
||||||
pub cargo: Option<String>,
|
pub cargo: Option<PathBuf>,
|
||||||
pub local_rebuild: bool,
|
pub local_rebuild: bool,
|
||||||
|
|
||||||
// libstd features
|
// libstd features
|
||||||
|
@ -208,8 +208,8 @@ impl Config {
|
||||||
config.target.push(target.clone());
|
config.target.push(target.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
config.rustc = build.rustc;
|
config.rustc = build.rustc.map(PathBuf::from);
|
||||||
config.cargo = build.cargo;
|
config.cargo = build.cargo.map(PathBuf::from);
|
||||||
set(&mut config.compiler_docs, build.compiler_docs);
|
set(&mut config.compiler_docs, build.compiler_docs);
|
||||||
set(&mut config.docs, build.docs);
|
set(&mut config.docs, build.docs);
|
||||||
|
|
||||||
|
@ -379,6 +379,10 @@ impl Config {
|
||||||
.or_insert(Target::default());
|
.or_insert(Target::default());
|
||||||
target.ndk = Some(PathBuf::from(value));
|
target.ndk = Some(PathBuf::from(value));
|
||||||
}
|
}
|
||||||
|
"CFG_LOCAL_RUST_ROOT" if value.len() > 0 => {
|
||||||
|
self.rustc = Some(PathBuf::from(value).join("bin/rustc"));
|
||||||
|
self.cargo = Some(PathBuf::from(value).join("bin/cargo"));
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue