From 822c845ca9b60374651a0577dffb97bf25d77923 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Sun, 7 Jan 2024 19:44:34 +0100 Subject: [PATCH 1/4] Add configure, configure Makevars.in -> Makevars --- changeforest-r/configure | 1 + changeforest-r/src/{Makevars => Makevars.in} | 3 ++- src/Makevars | 0 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changeforest-r/configure rename changeforest-r/src/{Makevars => Makevars.in} (85%) create mode 100644 src/Makevars diff --git a/changeforest-r/configure b/changeforest-r/configure new file mode 100644 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 85% rename from changeforest-r/src/Makevars rename to changeforest-r/src/Makevars.in index b830542..44b3aec 100644 --- a/changeforest-r/src/Makevars +++ b/changeforest-r/src/Makevars.in @@ -1,3 +1,4 @@ +TARGET ?= @RUST_TARGET@ TARGET_DIR = ./rust/target LIBDIR = $(TARGET_DIR)/release STATLIB = $(LIBDIR)/libchangeforestr.a @@ -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; \ diff --git a/src/Makevars b/src/Makevars new file mode 100644 index 0000000..e69de29 From 52c61fd170bd24c0cc1c04cab5f13f6b565337ef Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Sun, 7 Jan 2024 19:45:23 +0100 Subject: [PATCH 2/4] Empty Makevars. --- src/Makevars | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/Makevars diff --git a/src/Makevars b/src/Makevars deleted file mode 100644 index e69de29..0000000 From 9272bc7d47ca1021f39ddcacca5a4184c85aa1d8 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Mon, 8 Jan 2024 12:29:58 +0100 Subject: [PATCH 3/4] Different permissions for configure. --- changeforest-r/configure | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 changeforest-r/configure diff --git a/changeforest-r/configure b/changeforest-r/configure old mode 100644 new mode 100755 From d9314942197ee4d36497179a2764694a35c96441 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Mon, 8 Jan 2024 12:33:38 +0100 Subject: [PATCH 4/4] Implement suggestion by @yutannihilation --- changeforest-r/src/Makevars.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changeforest-r/src/Makevars.in b/changeforest-r/src/Makevars.in index 44b3aec..0ed0ed5 100644 --- a/changeforest-r/src/Makevars.in +++ b/changeforest-r/src/Makevars.in @@ -1,6 +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