diff options
| author | Jan Niklas Hasse <jhasse@gmail.com> | 2014-01-05 01:55:20 +0000 |
|---|---|---|
| committer | Jan Niklas Hasse <jhasse@gmail.com> | 2014-01-05 12:06:20 +0100 |
| commit | 6abe0ef32eb88965a7263f8e37a275a408fce5c8 (patch) | |
| tree | a122f6bb32e83d53bfb07783068c01b7a2262b18 /src/librustpkg | |
| parent | ea4219f6e59bb0a6cd915cf71c934079767944b0 (diff) | |
Make rustc's own lib directory configurable and change the default to rustlib. Fixes #3319
Diffstat (limited to 'src/librustpkg')
| -rw-r--r-- | src/librustpkg/context.rs | 5 | ||||
| -rw-r--r-- | src/librustpkg/tests.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/librustpkg/context.rs b/src/librustpkg/context.rs index 31515f0cb72..a1b8a48108c 100644 --- a/src/librustpkg/context.rs +++ b/src/librustpkg/context.rs @@ -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() } diff --git a/src/librustpkg/tests.rs b/src/librustpkg/tests.rs index 2ceed4f3df7..ffa5f1e9d5b 100644 --- a/src/librustpkg/tests.rs +++ b/src/librustpkg/tests.rs @@ -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 } |
