Fix rustbuild to work with --libdir.

Similar to the makefiles, pass CFG_LIBDIR_RELATIVE to cargo when building
rustc in stages > 0.  This tells rustc to check the different directory.
上级 b7ca2b9e
......@@ -185,8 +185,14 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) {
cargo.env("CFG_RELEASE", &build.release)
.env("CFG_RELEASE_CHANNEL", &build.config.channel)
.env("CFG_VERSION", &build.version)
.env("CFG_PREFIX", build.config.prefix.clone().unwrap_or(PathBuf::new()))
.env("CFG_LIBDIR_RELATIVE", "lib");
.env("CFG_PREFIX", build.config.prefix.clone().unwrap_or(PathBuf::new()));
if compiler.stage == 0 {
cargo.env("CFG_LIBDIR_RELATIVE", "lib");
} else {
let libdir_relative = build.config.libdir_relative.clone().unwrap_or(PathBuf::from("lib"));
cargo.env("CFG_LIBDIR_RELATIVE", libdir_relative);
}
// If we're not building a compiler with debugging information then remove
// these two env vars which would be set otherwise.
......
......@@ -90,6 +90,7 @@ pub struct Config {
pub prefix: Option<PathBuf>,
pub docdir: Option<PathBuf>,
pub libdir: Option<PathBuf>,
pub libdir_relative: Option<PathBuf>,
pub mandir: Option<PathBuf>,
pub codegen_tests: bool,
pub nodejs: Option<PathBuf>,
......@@ -477,6 +478,9 @@ pub fn update_with_config_mk(&mut self) {
"CFG_LIBDIR" => {
self.libdir = Some(PathBuf::from(value));
}
"CFG_LIBDIR_RELATIVE" => {
self.libdir_relative = Some(PathBuf::from(value));
}
"CFG_MANDIR" => {
self.mandir = Some(PathBuf::from(value));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册