Skip to content

Commit

Permalink
feat(starkliup): support Android Termux
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Aug 30, 2023
1 parent 025259a commit 5069b79
Showing 1 changed file with 31 additions and 20 deletions.
51 changes: 31 additions & 20 deletions starkliup/starkliup
Original file line number Diff line number Diff line change
Expand Up @@ -148,26 +148,37 @@ detect_host_triple() {

case $PLATFORM in
Linux)
# Likely very unreliable way to check musl
if [ -n "$(ls /lib | grep "libc.musl-")" ]; then
case $ARCHITECTURE in
x86_64)
TRIPLE="x86_64-unknown-linux-musl"
;;
aarch64|arm64)
TRIPLE="aarch64-unknown-linux-musl"
;;
esac
else
case $ARCHITECTURE in
x86_64)
TRIPLE="x86_64-unknown-linux-gnu"
;;
aarch64|arm64)
TRIPLE="aarch64-unknown-linux-gnu"
;;
esac
fi
# Android Termux detection
case $PREFIX in
*com.termux*)
case $ARCHITECTURE in
aarch64|arm64)
TRIPLE="aarch64-linux-android"
;;
esac
;;
*)
# Likely very unreliable way to check musl
if [ -n "$(ls /lib | grep "libc.musl-")" ]; then
case $ARCHITECTURE in
x86_64)
TRIPLE="x86_64-unknown-linux-musl"
;;
aarch64|arm64)
TRIPLE="aarch64-unknown-linux-musl"
;;
esac
else
case $ARCHITECTURE in
x86_64)
TRIPLE="x86_64-unknown-linux-gnu"
;;
aarch64|arm64)
TRIPLE="aarch64-unknown-linux-gnu"
;;
esac
fi
esac
;;
Darwin)
case $ARCHITECTURE in
Expand Down

0 comments on commit 5069b79

Please sign in to comment.