diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-01-10 17:45:03 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-01-11 13:57:11 -0800 |
| commit | c00ec5f9c936639ec2fd9291cd484afa56aa24c8 (patch) | |
| tree | 46a26977efd78c2d44a7352e3651bdd4181b2402 /src | |
| parent | 79d489cedf5821636857ca342a9809b27dd4ccf6 (diff) | |
| download | rust-c00ec5f9c936639ec2fd9291cd484afa56aa24c8.tar.gz rust-c00ec5f9c936639ec2fd9291cd484afa56aa24c8.zip | |
build: Build libraries in the bin directory on win32
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/back/rpath.rs | 1 | ||||
| -rw-r--r-- | src/comp/util/filesearch.rs | 17 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/comp/back/rpath.rs b/src/comp/back/rpath.rs index 91f025308e0..a382b8f9d9f 100644 --- a/src/comp/back/rpath.rs +++ b/src/comp/back/rpath.rs @@ -191,7 +191,6 @@ fn minimize_rpaths(rpaths: [str]) -> [str] { #[cfg(target_os = "linux")] #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] -#[cfg(test)] mod test { #[test] fn test_rpaths_to_flags() { diff --git a/src/comp/util/filesearch.rs b/src/comp/util/filesearch.rs index e030ddeed40..d2dd2fc502c 100644 --- a/src/comp/util/filesearch.rs +++ b/src/comp/util/filesearch.rs @@ -16,6 +16,7 @@ export pick_file; export search; export relative_target_lib_path; export get_cargo_root; +export libdir; type pick<T> = block(path: fs::path) -> option::t<T>; @@ -80,7 +81,7 @@ fn search<T: copy>(filesearch: filesearch, pick: pick<T>) -> option::t<T> { } fn relative_target_lib_path(target_triple: str) -> [fs::path] { - ["lib", "rustc", target_triple, "lib"] + [libdir(), "rustc", target_triple, libdir()] } fn make_target_lib_path(sysroot: fs::path, @@ -121,6 +122,16 @@ fn get_cargo_root() -> result::t<fs::path, str> { fn get_cargo_lib_path() -> result::t<fs::path, str> { result::chain(get_cargo_root()) { |p| - result::ok(fs::connect(p, "lib")) + result::ok(fs::connect(p, libdir())) } -} \ No newline at end of file +} + +// The name of the directory rustc expects libraries to be located. +// On Unix should be "lib", on windows "bin" +fn libdir() -> str { + let libdir = #env("CFG_LIBDIR"); + if str::is_empty(libdir) { + fail "rustc compiled without CFG_LIBDIR environment variable"; + } + libdir +} |
