about summary refs log tree commit diff
path: root/src
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
parentc58bb2352157732a1b525b0ed20ad7588b975b08 (diff)
parent6abe0ef32eb88965a7263f8e37a275a408fce5c8 (diff)
downloadrust-4e622becdc5fb4e07f95550c3a59fd909b97e5bb.tar.gz
rust-4e622becdc5fb4e07f95550c3a59fd909b97e5bb.zip
auto merge of #11118 : jhasse/rust/patch-rustlibdir, r=alexcrichton
...stlib. Fixes #3319
Diffstat (limited to 'src')
-rwxr-xr-xsrc/etc/local_stage0.sh3
-rw-r--r--src/librustc/back/rpath.rs5
-rw-r--r--src/librustc/metadata/filesearch.rs8
-rw-r--r--src/librustpkg/context.rs5
-rw-r--r--src/librustpkg/tests.rs4
5 files changed, 18 insertions, 7 deletions
diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
index af9f570a8b0..a0785cbad2b 100755
--- a/src/etc/local_stage0.sh
+++ b/src/etc/local_stage0.sh
@@ -2,6 +2,7 @@
 
 TARG_DIR=$1
 PREFIX=$2
+RUSTLIBDIR=$3
 
 LIB_DIR=lib
 LIB_PREFIX=lib
@@ -43,7 +44,7 @@ if [ -z $TARG_DIR ]; then
 fi
 
 cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
-cp ${PREFIX}/${LIB_DIR}/rustc/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
+cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
 cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
 cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
 cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs
index 43267a08a14..ecf4dd95cec 100644
--- a/src/librustc/back/rpath.rs
+++ b/src/librustc/back/rpath.rs
@@ -185,6 +185,7 @@ mod test {
     use back::rpath::{get_absolute_rpath, get_install_prefix_rpath};
     use back::rpath::{minimize_rpaths, rpaths_to_flags, get_rpath_relative_to_output};
     use syntax::abi;
+    use metadata::filesearch;
 
     #[test]
     fn test_rpaths_to_flags() {
@@ -196,7 +197,9 @@ mod test {
     fn test_prefix_rpath() {
         let res = get_install_prefix_rpath("triple");
         let mut d = Path::new(env!("CFG_PREFIX"));
-        d.push("lib/rustc/triple/lib");
+        d.push("lib");
+        d.push(filesearch::rustlibdir());
+        d.push("triple/lib");
         debug!("test_prefix_path: {} vs. {}",
                res,
                d.display());
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 692cc12ec6f..3e99cbeb727 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -157,7 +157,7 @@ pub fn relative_target_lib_path(target_triple: &str) -> Path {
     let dir = libdir();
     let mut p = Path::new(dir.as_slice());
     assert!(p.is_relative());
-    p.push("rustc");
+    p.push(rustlibdir());
     p.push(target_triple);
     p.push(dir);
     p
@@ -247,3 +247,9 @@ pub fn rust_path() -> ~[Path] {
 pub fn libdir() -> ~str {
     (env!("CFG_LIBDIR")).to_owned()
 }
+
+// The name of rustc's own place to organize libraries.
+// Used to be "rustc", now the default is "rustlib"
+pub fn rustlibdir() -> ~str {
+    (env!("CFG_RUSTLIBDIR")).to_owned()
+}
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
     }