forked from andoma/movian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.android
executable file
·112 lines (90 loc) · 2.5 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
#!/bin/bash
OS="android"
DEFAULT_UI="glw"
CONFIGURE_POSTFIX="android"
source support/configure.inc
SDK="${ANDROID_HOME}"
NDK="${ANDROID_HOME}/../ndk"
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
}
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-
if [ ! -f "${TOOLCHAIN}gcc" ]; then
echo "Installing toolchain..."
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-18 --install-dir=${TOPDIR}/build.android/toolchain
fi
CC=${TOOLCHAIN}gcc
CXX=${TOOLCHAIN}g++
setup_env "$@"
enable sqlite_internal
enable spidermonkey
enable glw_backend_opengl_es
enable glw
enable polarssl
enable librtmp
enable httpserver
#enable dvd
enable libfreetype
enable stdin
enable trex
bzip2_setup
freetype_setup --host=arm-linux-gnueabihf
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=linux"
libav_setup
rtmpdump_setup
xmp_setup
libyuv_setup
# libspotify_setup "12.1.103-Linux-armv6-bcm2708hardfp"
cat >> ${CONFIG_MAK} <<EOF
CFLAGS_arch = ${ARCH_CFLAGS}
CFLAGS_cfg += ${ARCH_CFLAGS}
LDFLAGS_cfg += ${ARCH_LDFLAGS} -lOpenSLES -lGLESv2 -llog -landroid -ljnigraphics
SDK = ${SDK}
NDK = ${NDK}
ADB = ${SDK}/platform-tools/adb
EOF
finalize
echo
echo "NOTE: Support for Android is still experimental"
echo "NOTE: Video playback does not work at all"
echo "NOTE: A lot of other things are probably broken as well"
echo "NOTE: You have been warned"
echo