-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·37 lines (33 loc) · 859 Bytes
/
bootstrap.sh
File metadata and controls
executable file
·37 lines (33 loc) · 859 Bytes
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
#!/bin/bash
VALID=("armeabi" "armeabi-v7a" "x86" "mips")
WD=${PWD##*/}
WD=${WD//_/ }
NDK=${1}/ndk
ARCH=${WD:0:3}
if [ ${ARCH} = "mip" ]; then
ARCH=mips
fi
TC=${1}/toolchain/${ARCH}
echo "-- BOOTSTRAPPING ${WD}"
MATCH=$(echo "${VALID[@]:0}" | grep -o "${WD}")
if [[ ! -z $MATCH ]]; then
if [ ! -f ${TC}/SOURCES ]; then
echo -- Creating Toolchain at ${TC}
${NDK}/build/tools/make-standalone-toolchain.sh --arch=${ARCH} --platform=android-9 --install-dir=${TC}
else
echo -- Found Toolchain at ${TC}
fi
fi
if [ ! -f Makefile ]; then
if [[ -z $MATCH ]]; then
cmake ..
else
if [ $# -gt 0 ]; then
cmake -DANDROID_STANDALONE_TOOLCHAIN="${TC}" -DANDROID_ABI="${WD}" -DCMAKE_TOOLCHAIN_FILE=../../cmake/android.toolchain.cmake ..
else
echo "-- Android Toolchain not Specified!"
fi
fi
else
echo "-- Makefile present... Skipping cmake."
fi