Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Jan 8, 2024
1 parent 78d106d commit 1589cea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 47 deletions.
40 changes: 0 additions & 40 deletions configure
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
#!/bin/sh

usage()
{
cat - <<EOF
Options:
--help show help
--build specify target
EOF
exit 0
}

tweak_for_arm64_macos()
{
while [ 0 -lt $# ]; do
OPT="$1"
shift 1
case "${OPT}" in
--help|-h)
usage
;;
--build=*)
case $(echo "${OPT}" | cut -c 9-) in
aarch64-apple-darwin*)
TARGET="aarch64-apple-darwin"
TARGET_ARG="--target ${TARGET}"
;;
esac
;;
# ignore unknown options silently
esac
done
}

# The envvar used in libR-sys crate
LIBRSYS_R_VERSION=$("${R_HOME}/bin/Rscript" "./tools/print_r_version.R")

Expand Down Expand Up @@ -68,15 +34,9 @@ else
echo "*** Detected NOT_CRAN=true, do not override CARGO_HOME"
fi

# define $TARGET and $TARGET_ARG if provided via --build arg
# c.f. https://www.gnu.org/prep/standards/html_node/Configuration.html
tweak_for_arm64_macos $*

sed \
-e "s|@BEFORE_CARGO_BUILD@|${BEFORE_CARGO_BUILD}|" \
-e "s|@AFTER_CARGO_BUILD@|${AFTER_CARGO_BUILD}|" \
-e "s|@TARGET@|${TARGET}|" \
-e "s|@TARGET_ARG@|${TARGET_ARG}|" \
src/Makevars.in > src/Makevars

# Uncomment this to debug
Expand Down
7 changes: 2 additions & 5 deletions src/Makevars.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
TARGET = @TARGET@
TARGET_ARG = @TARGET_ARG@

# TODO
VENDORING = yes
OFFLINE_OPTION = --offline

LIBDIR = ./rust/target/$(TARGET)/release
LIBDIR = ./rust/target/release
PKG_LIBS = -L$(LIBDIR) -lstring2path
STATLIB = $(LIBDIR)/libstring2path.a

Expand All @@ -22,7 +19,7 @@ $(STATLIB):
cp ./cargo_vendor_config.toml ./rust/.cargo/config.toml; \
fi

@BEFORE_CARGO_BUILD@ cd ./rust && cargo build --jobs 1 $(TARGET_ARG) --lib --release $(OFFLINE_OPTION)
@BEFORE_CARGO_BUILD@ cd ./rust && cargo build --jobs 1 --lib --release $(OFFLINE_OPTION)
@AFTER_CARGO_BUILD@

C_clean:
Expand Down
3 changes: 1 addition & 2 deletions src/Makevars.win.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
TARGET = x86_64-pc-windows-gnu
TARGET_ARG = --target $(TARGET)

# Rtools42 doesn't have the linker in the location that cargo expects, so we
# need to overwrite it via configuration.
Expand Down Expand Up @@ -28,7 +27,7 @@ $(STATLIB):
cp ./cargo_vendor_config.toml ./rust/.cargo/config.toml; \
fi

@BEFORE_CARGO_BUILD@ cd ./rust && cargo build --jobs 1 $(TARGET_ARG) --lib --release $(OFFLINE_OPTION)
@BEFORE_CARGO_BUILD@ cd ./rust && cargo build --jobs 1 --target $(TARGET) --lib --release $(OFFLINE_OPTION)
@AFTER_CARGO_BUILD@

C_clean:
Expand Down

0 comments on commit 1589cea

Please sign in to comment.