forked from cropsly/ffmpeg-android
-
Notifications
You must be signed in to change notification settings - Fork 1
/
abi_settings.sh
executable file
·57 lines (51 loc) · 1.69 KB
/
abi_settings.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
#!/bin/bash
. settings.sh
BASEDIR=$2
case $1 in
armeabi-v7a)
NDK_ABI='arm'
NDK_TOOLCHAIN_ABI='arm-linux-androideabi'
NDK_CROSS_PREFIX="${NDK_TOOLCHAIN_ABI}"
;;
armeabi-v7a-neon)
NDK_ABI='arm'
NDK_TOOLCHAIN_ABI='arm-linux-androideabi'
NDK_CROSS_PREFIX="${NDK_TOOLCHAIN_ABI}"
CFLAGS="${CFLAGS} -mfpu=neon"
;;
x86)
NDK_ABI='x86'
NDK_TOOLCHAIN_ABI='x86'
NDK_CROSS_PREFIX="i686-linux-android"
CFLAGS="$CFLAGS -march=i686"
;;
esac
TOOLCHAIN_PREFIX=${BASEDIR}/toolchain-android
if [ ! -d "$TOOLCHAIN_PREFIX" ]; then
${ANDROID_NDK_ROOT_PATH}/build/tools/make-standalone-toolchain.sh --toolchain=${NDK_TOOLCHAIN_ABI}-${NDK_TOOLCHAIN_ABI_VERSION} --platform=android-${ANDROID_API_VERSION} --install-dir=${TOOLCHAIN_PREFIX}
fi
CROSS_PREFIX=${TOOLCHAIN_PREFIX}/bin/${NDK_CROSS_PREFIX}-
NDK_SYSROOT=${TOOLCHAIN_PREFIX}/sysroot
export PKG_CONFIG_LIBDIR="${TOOLCHAIN_PREFIX}/lib/pkgconfig"
if [ $3 == 1 ]; then
export CC="${CROSS_PREFIX}gcc --sysroot=${NDK_SYSROOT}"
export LD="${CROSS_PREFIX}ld"
export RANLIB="${CROSS_PREFIX}ranlib"
export STRIP="${CROSS_PREFIX}strip"
export READELF="${CROSS_PREFIX}readelf"
export OBJDUMP="${CROSS_PREFIX}objdump"
export ADDR2LINE="${CROSS_PREFIX}addr2line"
export AR="${CROSS_PREFIX}ar"
export AS="${CROSS_PREFIX}as"
export CXX="${CROSS_PREFIX}g++"
export OBJCOPY="${CROSS_PREFIX}objcopy"
export ELFEDIT="${CROSS_PREFIX}elfedit"
export CPP="${CROSS_PREFIX}cpp"
export DWP="${CROSS_PREFIX}dwp"
export GCONV="${CROSS_PREFIX}gconv"
export GDP="${CROSS_PREFIX}gdb"
export GPROF="${CROSS_PREFIX}gprof"
export NM="${CROSS_PREFIX}nm"
export SIZE="${CROSS_PREFIX}size"
export STRINGS="${CROSS_PREFIX}strings"
fi