提交 4b58071f 编写于 作者: B Brian Anderson

Stop using (DY)LD_LIBRARY_PATH on Unix

上级 a1e4ab3e
......@@ -105,10 +105,9 @@ ifdef CFG_UNIXY
CFG_PATH_MUNGE := true
CFG_EXE_SUFFIX :=
CFG_LDPATH :=
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_RUN=$(2)
CFG_RUN_TARG=$(call CFG_RUN,,$(2))
CFG_RUN_TEST=$(call CFG_RUN,,$(CFG_VALGRIND) $(1))
CFG_LIBUV_LINK_FLAGS=-lpthread
ifdef CFG_ENABLE_MINGW_CROSS
......
......@@ -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 = with_lib_path(execparms.lib_path, spawnproc);
let pid = maybe_with_lib_path(execparms.lib_path, spawnproc);
os::libc::close(pipe_in.in);
os::libc::close(pipe_out.out);
......@@ -151,6 +151,18 @@ 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);
......
......@@ -310,6 +310,14 @@ 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, " ")]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册