about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-10-09 15:05:12 -0700
committerBrian Anderson <banderson@mozilla.com>2011-10-09 15:05:12 -0700
commit941d5e737cf459a8748a509850e9cfa4a573e78d (patch)
tree2e347f7cdf288a9f761d9ea5b574c9a65507f9b8
parentaff536ec0e2f12336c86810f1558d50416d25394 (diff)
downloadrust-941d5e737cf459a8748a509850e9cfa4a573e78d.tar.gz
rust-941d5e737cf459a8748a509850e9cfa4a573e78d.zip
Revert "Stop using (DY)LD_LIBRARY_PATH on Unix"
This reverts commit 4b58071f96821f43e5124d46b65f4e777992415f.
-rw-r--r--mk/platform.mk7
-rw-r--r--src/compiletest/procsrv.rs14
-rw-r--r--src/compiletest/runtest.rs8
3 files changed, 5 insertions, 24 deletions
diff --git a/mk/platform.mk b/mk/platform.mk
index 0dbefc3518c..9bfae5e9691 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -105,9 +105,10 @@ ifdef CFG_UNIXY
   CFG_PATH_MUNGE := true
   CFG_EXE_SUFFIX :=
   CFG_LDPATH :=
-  CFG_RUN=$(2)
-  CFG_RUN_TARG=$(call CFG_RUN,,$(2))
-  CFG_RUN_TEST=$(call CFG_RUN,,$(CFG_VALGRIND) $(1))
+  CFG_RUN=$(CFG_LDENV)=$(1) $(2)
+  CFG_RUN_TARG=$(call CFG_RUN,$(CFG_BUILD_DIR)/$(HOST_LIB$(1)),$(2))
+  CFG_RUN_TEST=$(call CFG_RUN,$(call CFG_TESTLIB,$(1)),\
+      $(CFG_VALGRIND) $(1))
   CFG_LIBUV_LINK_FLAGS=-lpthread
 
   ifdef CFG_ENABLE_MINGW_CROSS
diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs
index 1563e3112ca..6a40aaccaf4 100644
--- a/src/compiletest/procsrv.rs
+++ b/src/compiletest/procsrv.rs
@@ -131,7 +131,7 @@ fn worker(p: port<request>) {
         let spawnproc =
             bind run::spawn_process(execparms.prog, execparms.args,
                                     pipe_in.in, pipe_out.out, pipe_err.out);
-        let pid = maybe_with_lib_path(execparms.lib_path, spawnproc);
+        let pid = with_lib_path(execparms.lib_path, spawnproc);
 
         os::libc::close(pipe_in.in);
         os::libc::close(pipe_out.out);
@@ -151,18 +151,6 @@ fn worker(p: port<request>) {
     }
 }
 
-// Only windows needs to set the library path
-#[cfg(target_os = "win32")]
-fn maybe_with_lib_path<@T>(path: str, f: fn() -> T) -> T {
-    with_lib_path(path, f)
-}
-
-#[cfg(target_os = "linux")]
-#[cfg(target_os = "macos")]
-fn maybe_with_lib_path<@T>(_path: str, f: fn() -> T) -> T {
-    f()
-}
-
 fn with_lib_path<@T>(path: str, f: fn() -> T) -> T {
     let maybe_oldpath = getenv(util::lib_path_env_var());
     append_lib_path(path);
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index ebedb4f0685..de188f3927e 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -310,14 +310,6 @@ fn program_output(cx: cx, testfile: str, lib_path: str, prog: str,
          cmdline: cmdline};
 }
 
-// Linux and mac don't require adjusting the library search path
-#[cfg(target_os = "linux")]
-#[cfg(target_os = "macos")]
-fn make_cmdline(_libpath: str, prog: str, args: [str]) -> str {
-    #fmt["%s %s", prog, str::connect(args, " ")]
-}
-
-#[cfg(target_os = "win32")]
 fn make_cmdline(libpath: str, prog: str, args: [str]) -> str {
     #fmt["%s %s %s", lib_path_cmd_prefix(libpath), prog,
          str::connect(args, " ")]