diff --git a/changeforest-r/configure b/changeforest-r/configure new file mode 100755 index 0000000..5df740a --- /dev/null +++ b/changeforest-r/configure @@ -0,0 +1 @@ +sed -e "s|@RUST_TARGET@|$(rustc -vV | grep host | cut -d' ' -f2)|" src/Makevars.in > src/Makevars \ No newline at end of file diff --git a/changeforest-r/src/Makevars b/changeforest-r/src/Makevars.in similarity index 80% rename from changeforest-r/src/Makevars rename to changeforest-r/src/Makevars.in index b830542..0ed0ed5 100644 --- a/changeforest-r/src/Makevars +++ b/changeforest-r/src/Makevars.in @@ -1,5 +1,6 @@ +TARGET ?= @RUST_TARGET@ TARGET_DIR = ./rust/target -LIBDIR = $(TARGET_DIR)/release +LIBDIR = $(TARGET_DIR)/$(TARGET)/release STATLIB = $(LIBDIR)/libchangeforestr.a PKG_LIBS = -L$(LIBDIR) -lchangeforestr @@ -17,7 +18,7 @@ $(STATLIB): export CARGO_HOME=$(CARGOTMP); \ fi && \ export PATH="$(PATH):$(HOME)/.cargo/bin" && \ - cargo build --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) + cargo build --target=$(TARGET) --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) if [ "$(NOT_CRAN)" != "true" ]; then \ rm -Rf $(CARGOTMP) && \ rm -Rf $(LIBDIR)/build; \