HOWTO 3.29 KB
Newer Older
ivoire's avatar
ivoire committed
1
2
#! /bin/sh

Rafaël Carré's avatar
Rafaël Carré committed
3
4
5
6
7
8
9
10
11
# Read the Android HOWTO and setup all that stuff correctly.
# Get the Android SDK Platform 2.1, 2.2 and 2.3 API : version 7, 8 and (9 or 10)
# or modify numbers in configure.sh and vlc-android/default.properties.
# Create an AVD with this platform.

# XXX : important!
# If you plan to use the emulator, you need a build without neon
# export NO_NEON=1
# make sure it is set for both the contribs bootstrap next and the configure.sh later.
ivoire's avatar
ivoire committed
12
13

if [ -z "$ANDROID_NDK" -o -z "$ANDROID_SDK" ]; then
Rafaël Carré's avatar
Rafaël Carré committed
14
15
16
17
   echo "You must define ANDROID_NDK and ANDROID_SDK before starting."
   echo "They must point to your NDK and SDK directories."
   exit 1
fi
ivoire's avatar
ivoire committed
18

19
20
21
22
23
# Using CyanogenMod headers instead of AOSP, since CyanogenMod
# has commit 1563f4aca88d354c502dba056d173cefc7c2ea7f,
# "Stagefright: Memcpy optimization on output port." (available
# upstream at https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=commit;h=052368f194c9fc180b9b0335b60114a2f1fb88d8),
# which adds some vtable entries needed on newer qualcomm devices.
24
25
if [ ! -d "android-headers/frameworks/base" ]; then
	echo "Fetching Android system headers (1/2)"
Rafaël Carré's avatar
Rafaël Carré committed
26
	git clone -b gingerbread --depth=1 git://github.com/CyanogenMod/android_frameworks_base.git android-headers/frameworks/base
27
28
29
else
	echo "Updating Android system headers (1/2)"
	pushd android-headers/frameworks/base > /dev/null
Rafaël Carré's avatar
Rafaël Carré committed
30
	git pull origin gingerbread
31
32
33
34
	popd > /dev/null
fi
if [ ! -d "android-headers/system/core" ]; then
	echo "Fetching Android system headers (2/2)"
Rafaël Carré's avatar
Rafaël Carré committed
35
	git clone -b gingerbread --depth=1 git://github.com/CyanogenMod/android_system_core.git android-headers/system/core
36
37
38
else
	echo "Updating Android system headers (2/2)"
	pushd android-headers/system/core > /dev/null
Rafaël Carré's avatar
Rafaël Carré committed
39
	git pull origin gingerbread
40
41
	popd > /dev/null
fi
42
43
44
45
46
export ANDROID_SYS_HEADERS=${PWD}/android-headers

echo "Fetching Android libraries for linking"
# Libraries from any froyo/gingerbread device/emulator should work
# fine, since the symbols used should be available on most of them.
47
48
if [ ! -f "update-cm-7.1.0.1-NS-signed.zip" ]; then
    curl -O http://mirror.sea.tdrevolution.net/cm/stable/gingerbread/update-cm-7.1.0.1-NS-signed.zip
Rafaël Carré's avatar
Rafaël Carré committed
49
    unzip update-cm-7.1.0.1-NS-signed.zip system/lib/\*
50
51
52
    mv system/lib android-libs
    rmdir system
fi
53
54
export ANDROID_LIBS=${PWD}/android-libs

55
56
if [ ! -d "vlc" ]; then
	echo "VLC source not found, cloning"
Rafaël Carré's avatar
Rafaël Carré committed
57
        git clone git://git.videolan.org/vlc/vlc-1.2.git vlc
58
59
60
else
	echo "VLC source found, pulling from remote master"
	pushd vlc > /dev/null
Rafaël Carré's avatar
Rafaël Carré committed
61
	git pull origin master
62
63
	popd > /dev/null
fi
ivoire's avatar
ivoire committed
64
65
66

echo "Applying the patches"
cd vlc
Rafaël Carré's avatar
Rafaël Carré committed
67
git am ../patches/*.patch || git am --abort
ivoire's avatar
ivoire committed
68
69

echo "Building the contribs"
Rafaël Carré's avatar
Rafaël Carré committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
mkdir contrib/android; cd contrib/android
../bootstrap --host=arm-linux-androideabi --disable-disc --disable-sout \
    --disable-sdl \
    --disable-SDL_image \
    --disable-fontconfig \
    --disable-ass \
    --disable-freetyp2 \
    --disable-fribidi \
    --disable-zvbi \
    --disable-kate \
    --disable-caca \
    --disable-gettext \
    --disable-mpcdec \
    --disable-sidplay2

make fetch
make
ivoire's avatar
ivoire committed
87
88
89

cd ../.. && mkdir -p android && cd android

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
90
91
if test ! -s "../configure"
then
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
92
93
94
    echo "Bootstraping"
    ../bootstrap
fi;
ivoire's avatar
ivoire committed
95
96
97
98

echo "Configuring"
sh ../extras/package/android/configure.sh

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
99
echo "Building"
ivoire's avatar
ivoire committed
100
make
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
101
102
103

echo "Building Android"
cd ../../
Rafaël Carré's avatar
Rafaël Carré committed
104

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
105
106
make distclean
VLC_BUILD_DIR=vlc/android make