forked from andoma/movian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.android
executable file
·119 lines (93 loc) · 2.75 KB
/
configure.android
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
PLATFORM="android"
DEFAULT_UI="glw"
CONFIGURE_POSTFIX="android"
source support/configure.inc
SDK="${ANDROID_HOME}"
NDK="${ANDROID_HOME}/../ndk"
export ANDROID_API=android-17
export ANDROID_EABI=arm-linux-androideabi-4.9
install_openssl()
{
OPENSSL_VER="1.0.2"
download_file http://www.lonelycoder.com/download/openssl-${OPENSSL_VER}-${ANDROID_API}-${ANDROID_EABI}.tar.gz openssltarball
tar -C "${BUILDDIR}/inst" --strip-components=1 -xf "${openssltarball}"
}
show_help(){
common_help
echo " --sdk=PREFIX Use Android SDK from this path [$SDK]"
echo " --ndk=DIR Use Android NDK from this path [$NDK]"
exit 1
}
enable sqlite_internal
enable glw_backend_opengl_es
enable glw
#enable librtmp
enable httpserver
enable libfreetype
enable stdin
enable openssl
[ -f project.config ] && source project.config
for opt do
optval="${opt#*=}"
case "$opt" in
--help) show_help
;;
--ndk=*) NDK="$optval"
;;
--sdk=*) SDK="$optval"
;;
*)
common_opt $opt $optval
esac
done
if [ -z "${SDK}" ]; then
echo "Android SDK not found"
echo "Either specify path to SDK using --sdk=/path/to/sdk"
echo " OR "
echo "Set ANDROID_HOME environment variable"
die
fi
echo "Using Android SDK at : ${SDK}"
echo
if [ ! -x "${SDK}/tools/ant" ]; then
echo "''ant'' not found in ${SDK}/tools/"
echo "Check that your configured path to the SDK is correct"
die
fi
TOOLCHAIN=${TOPDIR}/build.android/toolchain/bin/arm-linux-androideabi-
CC=${TOOLCHAIN}gcc
CXX=${TOOLCHAIN}g++
setup_env "$@"
echo "Using Android NDK at : ${NDK}"
stat "${NDK}"
echo
if [ ! -f "${CC}" ]; then
echo "Installing toolchain..."
stat "${NDK}/build/tools/make-standalone-toolchain.sh"
if [ ! -f "${NDK}/build/tools/make-standalone-toolchain.sh" ]; then
echo "NDK not found, either set NDK environment varable or specify --ndk=/path/to/ndk"
die
fi
${NDK}/build/tools/make-standalone-toolchain.sh --platform=${ANDROID_API} --install-dir=${TOPDIR}/build.android/toolchain --toolchain=${ANDROID_EABI}
fi
bzip2_setup
freetype_setup --host=arm-linux-gnueabihf
install_openssl
ARCH_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
ARCH_LDFLAGS="-march=armv7-a -Wl,--fix-cortex-a8"
LIBAV_CFLAGS="-I${EXT_INSTALL_DIR}/include ${ARCH_CFLAGS}"
LIBAV_LDFLAGS="-L${EXT_INSTALL_DIR}/lib ${ARCH_LDFLAGS}"
LIBAV_ARCH_FLAGS="--cross-prefix=${TOOLCHAIN} --enable-cross-compile --arch=armv7 --target-os=android --enable-shared --disable-static"
ext_setup
libyuv_setup
cat >> ${CONFIG_MAK} <<EOF
CFLAGS_arch = ${ARCH_CFLAGS}
CFLAGS_cfg += ${ARCH_CFLAGS}
LDFLAGS_cfg += ${ARCH_LDFLAGS} -lOpenSLES -lGLESv2 -llog -landroid -ljnigraphics
LDFLAGS_cfg += -lssl -lcrypto
SDK = ${SDK}
NDK = ${NDK}
ADB = ${SDK}/platform-tools/adb
EOF
finalize