nandi/jolt-nativepublic Fork 0
089e6f7d8398ecab5c661dbf79e4063ec6c3b48c
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

android-ndk-bin · 23 lines · 868 BBash Blame HistoryRaw
Cross-compile for Android, with an NDK nobody has to install 14a30c0 nandi 19d ago1#!/bin/sh
2# Print the directory holding the NDK's clang and LLVM binutils.
3#
4# android-cc needs one of those binaries and an APK build needs others —
5# llvm-objcopy, for the boot image blob — so the lookup is here rather than
6# duplicated at each caller. ANDROID_NDK_HOME wins if it is set; otherwise the
7# pin in android-ndk.dotslash beside this script answers, downloading once.
8set -e
9dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
10
11ndk=${ANDROID_NDK_HOME:-${ANDROID_NDK_ROOT:-}}
12if [ -n "$ndk" ]; then
13 for host in linux-x86_64 darwin-x86_64; do
14 if [ -d "$ndk/toolchains/llvm/prebuilt/$host/bin" ]; then
15 echo "$ndk/toolchains/llvm/prebuilt/$host/bin"
16 exit 0
17 fi
18 done
19 echo "scripts/android-ndk-bin: no llvm prebuilt under $ndk" >&2
20 exit 1
21fi
22
23dirname -- "$(dotslash -- fetch "$dir/android-ndk.dotslash")"