Skip to content

Fix rustbuild to work with --libdir. #39206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -477,6 +478,9 @@ impl Config {
"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));
}
Expand Down