forked from jeanmarie110/Telegram-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-ndk.sh
executable file
·76 lines (70 loc) · 2.26 KB
/
run-ndk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# DEPRECATED. DO NOT USE
# TODO: make it work again
set -e
# shellcheck source=set-env.sh
source "$(dirname "$0")"/set-env.sh
if [ "$1" = "-f" ]; then
force-clean.sh
fi
IFS=" " read -r -a abis <<< "$(< app/jni/Application.mk grep -Eoh '^APP_ABI := .+' | grep -Eoh ':= .+' | grep -Eoh '[a-zA-Z][a-zA-Z0-9 \-]+')"
echo "Building .so for abis: " "${abis[@]}" "..."
pushd vkryl/leveldb > /dev/null
#for abi in "${abis[@]}"; do
# prebuilt="$ANDROID_NDK/toolchains/llvm/prebuilt/$BUILD_PLATFORM"
# test -d "$prebuilt"
# case $abi in
# x86_64 )
# platform=21
# prefix="$prebuilt/bin/x86_64-linux-android$platform"
# cc="$prefix-clang"
# cxx="$prefix-clang++"
# test -f "$cc" || (echo "CC not found: $cc" && exit 1)
# test -f "$cxx" || (echo "CXX not found: $cxx" && exit 1)
# ;;
# arm64-v8a )
# platform=21
# prefix="$prebuilt/bin/aarch64-linux-android$platform"
# cc="$prefix-clang"
# cxx="$prefix-clang++"
# test -f "$cc" || (echo "CC not found: $cc" && exit 1)
# test -f "$cxx" || (echo "CXX not found: $cxx" && exit 1)
# ;;
# armabi-v7a )
# platform=16
# prefix="$prebuilt/bin/arm-linux-androideabi/bin/armv7a-linux-androideabi$platform"
# cc="$prefix-clang"
# cxx="$prefix-clang++"
# test -f "$cc" || (echo "CC not found: $cc" && exit 1)
# test -f "$cxx" || (echo "CXX not found: $cxx" && exit 1)
# ;;
# x86 )
# platform=16
# prefix="$prebuilt/bin/i686-linux-android$platform"
# cc="$prefix-clang"
# cxx="$prefix-clang++"
# test -f "$cc" || (echo "CC not found: $cc" && exit 1)
# test -f "$cxx" || (echo "CXX not found: $cxx" && exit 1)
# ;;
# * )
# echo "Unknown abi \"$abi\"!"
# exit 1
# ;;
# esac
#
# echo "Building leveldb for $abi, android-$platform..."
# cmake -B".cxx/cmake/debug/$abi" \
# -DANDROID_ABI="$abi" \
# -DANDROID_PLATFORM="android-$platform" \
# -DANDROID_NDK="$NDK_VERSION" \
# -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake" \
# -DCMAKE_MAKE_PROGRAM="$(command -v ninja)" \
# -G Ninja .
#done
popd > /dev/null
pushd app > /dev/null
if "$ANDROID_NDK/ndk-build" NDK_LIBS_OUT=./jniLibs NDK_OUT=./.externalNativeBuild -S -o jni/Android.mk -j "$CPU_COUNT"; then
echo "Installed fresh libraries:"
ls jniLibs/*/*.so
fi
popd > /dev/null