Make rustc's own lib directory configurable and change the default to rustlib. Fixes #3319

This commit is contained in:
Jan Niklas Hasse 2014-01-05 01:55:20 +00:00
parent ea4219f6e5
commit 6abe0ef32e
11 changed files with 53 additions and 14 deletions

View file

@ -12,6 +12,7 @@
use extra::workcache;
use rustc::driver::session;
use rustc::metadata::filesearch::rustlibdir;
use std::hashmap::HashSet;
@ -168,13 +169,13 @@ impl Context {
}
}
/// We assume that if ../../rustc exists, then we're running
/// We assume that if ../../rustlib exists, then we're running
/// rustpkg from a Rust target directory. This is part of a
/// kludgy hack used to adjust the sysroot.
pub fn in_target(sysroot: &Path) -> bool {
debug!("Checking whether {} is in target", sysroot.display());
let mut p = sysroot.dir_path();
p.set_filename("rustc");
p.set_filename(rustlibdir());
p.is_dir()
}

View file

@ -33,7 +33,7 @@ use path_util::{target_executable_in_workspace, target_test_in_workspace,
built_library_in_workspace, built_executable_in_workspace, target_build_dir,
chmod_read_only, platform_library_name};
use rustc::back::link::get_cc_prog;
use rustc::metadata::filesearch::rust_path;
use rustc::metadata::filesearch::{rust_path, libdir, rustlibdir};
use rustc::driver::session;
use rustc::driver::driver::{build_session, build_session_options, host_triple, optgroups};
use syntax::diagnostic;
@ -220,7 +220,7 @@ fn test_sysroot() -> Path {
fn rustpkg_exec() -> Path {
// Ugh
let first_try = test_sysroot().join_many(
[~"lib", ~"rustc", host_triple(), ~"bin", ~"rustpkg"]);
[libdir(), rustlibdir(), host_triple(), ~"bin", ~"rustpkg"]);
if is_executable(&first_try) {
first_try
}