mk: Get "make check" passing with --disable-rpath
This involves passing through LD_LIBRARY_PATH through more places, specifically in the compiletest, run-make, and doctest runners.
This commit is contained in:
parent
78d4bf851c
commit
e26ba3605a
8 changed files with 35 additions and 14 deletions
|
|
@ -36,8 +36,26 @@ fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
|
|||
#[cfg(target_os = "linux")]
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg(target_os = "freebsd")]
|
||||
fn target_env(_lib_path: &str, _prog: &str) -> ~[(~str,~str)] {
|
||||
os::env()
|
||||
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
|
||||
// Make sure we include the aux directory in the path
|
||||
let aux_path = prog + ".libaux";
|
||||
|
||||
let mut env = os::env();
|
||||
let var = if cfg!(target_os = "macos") {
|
||||
"DYLD_LIBRARY_PATH"
|
||||
} else {
|
||||
"LD_LIBRARY_PATH"
|
||||
};
|
||||
let prev = match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
|
||||
Some(i) => env.remove(i).unwrap().val1(),
|
||||
None => ~"",
|
||||
};
|
||||
env.push((var.to_owned(), if prev.is_empty() {
|
||||
lib_path + ":" + aux_path
|
||||
} else {
|
||||
lib_path + ":" + aux_path + ":" + prev
|
||||
}));
|
||||
return env;
|
||||
}
|
||||
|
||||
pub struct Result {status: ProcessExit, out: ~str, err: ~str}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ os.putenv('TMPDIR', os.path.abspath(sys.argv[3]))
|
|||
os.putenv('CC', sys.argv[4])
|
||||
os.putenv('RUSTDOC', os.path.abspath(sys.argv[5]))
|
||||
filt = sys.argv[6]
|
||||
ldpath = sys.argv[7]
|
||||
if ldpath != '':
|
||||
os.putenv(ldpath.split('=')[0], ldpath.split('=')[1])
|
||||
|
||||
if not filt in sys.argv[1]:
|
||||
sys.exit(0)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
all:
|
||||
$(RUSTC) lib.rs -C gen-crate-map
|
||||
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
|
||||
$(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
|
||||
$(CC) main.c -o $(call RUN,main) -lboot
|
||||
$(call RUN,main)
|
||||
rm $(call DYLIB,boot)
|
||||
$(call FAIL,main)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
all:
|
||||
$(RUSTC) lib.rs -C gen-crate-map
|
||||
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
|
||||
$(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
|
||||
$(CC) main.c -o $(call RUN,main) -lboot
|
||||
$(call RUN,main)
|
||||
rm $(call DYLIB,boot)
|
||||
$(call FAIL,main)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
-include ../tools.mk
|
||||
|
||||
# needed so that libfoo can find libcfoo
|
||||
ifeq ($(shell uname),Linux)
|
||||
export LD_LIBRARY_PATH := $(TMPDIR)
|
||||
endif
|
||||
|
||||
# This hits an assertion in the linker on older versions of osx apparently
|
||||
ifeq ($(shell uname),Darwin)
|
||||
all:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
export LD_LIBRARY_PATH:=$(TMPDIR):$(LD_LIBRARY_PATH)
|
||||
export DYLD_LIBRARY_PATH:=$(TMPDIR):$(DYLD_LIBRARY_PATH)
|
||||
|
||||
RUSTC := $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
||||
CC := $(CC) -L $(TMPDIR)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue