aboutsummaryrefslogtreecommitdiff
path: root/rsync/build.sh
diff options
context:
space:
mode:
authorjsvk <850037+jsvk@users.noreply.github.com>2026-07-01 00:00:00 +0000
committerLena <lena@omega>2026-07-01 00:00:00 +0000
commit977629ec3effeaeab698fcc4f42c7827c2b181ed (patch)
tree38648f74328796a2caea0cca7e87cd0134e86bc2 /rsync/build.sh
parent44ebf6db6cf2725e18f0e1129f4005fd456b03dc (diff)
downloadrsend-977629ec3effeaeab698fcc4f42c7827c2b181ed.tar.gz
native: pick the NDK host toolchain tag by build host
The NDK names its prebuilt toolchain directory after the build host, not the target. Hardcoding linux-x86_64 broke rsync/build.sh and rsh/build.sh on macOS, which ships the toolchain under darwin-x86_64 (x86_64 binaries, run under Rosetta on Apple Silicon). Detect the host with uname and fail loud on anything else. Link: https://codeberg.org/0xlena/rsend/pulls/1
Diffstat (limited to 'rsync/build.sh')
-rwxr-xr-xrsync/build.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/rsync/build.sh b/rsync/build.sh
index 1160e74..0a7fcda 100755
--- a/rsync/build.sh
+++ b/rsync/build.sh
@@ -17,7 +17,19 @@ if [ -z "$ndk" ] || [ ! -d "$ndk" ]; then
echo "rsync: Android NDK not found; set ANDROID_NDK_HOME" >&2
exit 1
fi
-tc="$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin"
+# NDK prebuilt toolchains are named by build host, not target. Pick the tag
+# matching this machine (macOS ships an x86_64 clang that runs under Rosetta on
+# Apple Silicon); the target ABI is selected separately below.
+case "$(uname -s)" in
+Linux) host_tag=linux-x86_64 ;;
+Darwin) host_tag=darwin-x86_64 ;;
+*) echo "rsync: unsupported build host $(uname -s)" >&2; exit 1 ;;
+esac
+tc="$ndk/toolchains/llvm/prebuilt/$host_tag/bin"
+if [ ! -d "$tc" ]; then
+ echo "rsync: NDK toolchain not found at $tc" >&2
+ exit 1
+fi
work="$root/rsync/work"
tarball="$root/rsync/rsync-${RSYNC_VERSION}.tar.gz"