about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorRichard Diamond <wichard@vitalitystudios.com>2015-08-21 23:43:56 -0500
committerRichard Diamond <wichard@vitalitystudios.com>2015-12-13 15:05:43 -0600
commit7bd69f2248ce2635f3fc05f08d8a7944eed0016a (patch)
treeec6802421b3754c37226742c734fe365dc25076a /src/test
parent83eda080373285d3cbe4ca0ee280e4844c6422a3 (diff)
downloadrust-7bd69f2248ce2635f3fc05f08d8a7944eed0016a.tar.gz
rust-7bd69f2248ce2635f3fc05f08d8a7944eed0016a.zip
Better support for `--llvm-root`.
This handles cases when the LLVM used isn't configured will the 'usual'
targets. Also, cases where LLVM is shared are also handled (ie with
`LD_LIBRARY_PATH` etc).
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make/execution-engine/Makefile7
-rw-r--r--src/test/run-make/simd-ffi/Makefile21
-rw-r--r--src/test/run-make/tools.mk2
3 files changed, 25 insertions, 5 deletions
diff --git a/src/test/run-make/execution-engine/Makefile b/src/test/run-make/execution-engine/Makefile
index ef646c5bf5d..4c818cd99e2 100644
--- a/src/test/run-make/execution-engine/Makefile
+++ b/src/test/run-make/execution-engine/Makefile
@@ -4,6 +4,8 @@
 # This is a basic test of LLVM ExecutionEngine functionality using compiled
 # Rust code built using the `rustc` crate.
 
+ifeq ($(filter executionengine,$(LLVM_COMPONENTS)),executionengine)
+
 ifneq ($(shell uname),FreeBSD)
 all:
 	$(RUSTC) test.rs
@@ -12,3 +14,8 @@ else
 all:
 
 endif
+
+else
+all:
+
+endif
diff --git a/src/test/run-make/simd-ffi/Makefile b/src/test/run-make/simd-ffi/Makefile
index dc0fcec1980..e9c974a0137 100644
--- a/src/test/run-make/simd-ffi/Makefile
+++ b/src/test/run-make/simd-ffi/Makefile
@@ -1,15 +1,28 @@
 -include ../tools.mk
 
+TARGETS =
+ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm)
 # construct a fairly exhaustive list of platforms that we
 # support. These ones don't follow a pattern
-TARGETS=arm-linux-androideabi arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabi
+TARGETS += arm-linux-androideabi arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabi
+endif
+
+ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86)
+X86_ARCHS = i686 x86_64
+else
+X86_ARCHS =
+endif
 
 # these ones do, each OS lists the architectures it supports
-LINUX=aarch64 i686 x86_64 mips mipsel
-WINDOWS=i686 x86_64
+LINUX=$(filter aarch64 mips,$(LLVM_COMPONENTS)) $(X86_ARCHS)
+ifeq ($(filter mips,$(LLVM_COMPONENTS)),mips)
+LINUX += mipsel
+endif
+
+WINDOWS=$(X86_ARCHS)
 # fails with: failed to get iphonesimulator SDK path: no such file or directory
 #IOS=i386 aarch64 armv7
-DARWIN=i686 x86_64
+DARWIN=$(X86_ARCHS)
 
 $(foreach arch,$(LINUX),$(eval TARGETS += $(arch)-unknown-linux-gnu))
 $(foreach arch,$(WINDOWS),$(eval TARGETS += $(arch)-pc-windows-gnu))
diff --git a/src/test/run-make/tools.mk b/src/test/run-make/tools.mk
index 23af568697f..88cf2a2b031 100644
--- a/src/test/run-make/tools.mk
+++ b/src/test/run-make/tools.mk
@@ -6,7 +6,7 @@ TARGET_RPATH_ENV = \
     $(LD_LIB_PATH_ENVVAR)="$(TMPDIR):$(TARGET_RPATH_DIR):$($(LD_LIB_PATH_ENVVAR))"
 
 BARE_RUSTC := $(HOST_RPATH_ENV) $(RUSTC)
-RUSTC := $(BARE_RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
+RUSTC := $(BARE_RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR) $(RUSTFLAGS)
 #CC := $(CC) -L $(TMPDIR)
 HTMLDOCCK := $(PYTHON) $(S)/src/etc/htmldocck.py