aboutsummaryrefslogtreecommitdiff
path: root/nix-rust/local.mk
diff options
context:
space:
mode:
Diffstat (limited to 'nix-rust/local.mk')
-rw-r--r--nix-rust/local.mk8
1 files changed, 4 insertions, 4 deletions
diff --git a/nix-rust/local.mk b/nix-rust/local.mk
index 9650cdf93..538244594 100644
--- a/nix-rust/local.mk
+++ b/nix-rust/local.mk
@@ -11,12 +11,12 @@ libnixrust_INSTALL_PATH := $(libdir)/libnixrust.$(SO_EXT)
libnixrust_LDFLAGS_USE := -L$(d)/target/$(RUST_DIR) -lnixrust
libnixrust_LDFLAGS_USE_INSTALLED := -L$(libdir) -lnixrust
-ifeq ($(OS), Linux)
+ifdef HOST_LINUX
libnixrust_LDFLAGS_USE += -ldl
libnixrust_LDFLAGS_USE_INSTALLED += -ldl
endif
-ifeq ($(OS), Darwin)
+ifdef HOST_DARWIN
libnixrust_BUILD_FLAGS = NIX_LDFLAGS="-undefined dynamic_lookup"
else
libnixrust_LDFLAGS_USE += -Wl,-rpath,$(abspath $(d)/target/$(RUST_DIR))
@@ -31,7 +31,7 @@ $(libnixrust_PATH): $(call rwildcard, $(d)/src, *.rs) $(d)/Cargo.toml
$(libnixrust_INSTALL_PATH): $(libnixrust_PATH)
$(target-gen) cp $^ $@
-ifeq ($(OS), Darwin)
+ifdef HOST_DARWIN
install_name_tool -id $@ $@
endif
@@ -40,7 +40,7 @@ clean: clean-rust
clean-rust:
$(suppress) rm -rfv nix-rust/target
-ifneq ($(OS), Darwin)
+ifndef HOST_DARWIN
check: rust-tests
rust-tests: