about summary refs log tree commit diff
path: root/src/librustpkg
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-01-06 02:01:49 -0800
committerbors <bors@rust-lang.org>2014-01-06 02:01:49 -0800
commit4e622becdc5fb4e07f95550c3a59fd909b97e5bb (patch)
treebabf157da0344fec32e29830dd61cf0500e2df5e /src/librustpkg
parentc58bb2352157732a1b525b0ed20ad7588b975b08 (diff)
parent6abe0ef32eb88965a7263f8e37a275a408fce5c8 (diff)
auto merge of #11118 : jhasse/rust/patch-rustlibdir, r=alexcrichton
...stlib. Fixes #3319
Diffstat (limited to 'src/librustpkg')
-rw-r--r--src/librustpkg/context.rs5
-rw-r--r--src/librustpkg/tests.rs4
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
     }