HOWTO 3.37 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

Rafaël Carré's avatar
Rafaël Carré committed
19
# 1/ libvlc, libvlccore and its plugins
20

21
22
if [ ! -d "vlc" ]; then
	echo "VLC source not found, cloning"
Rafaël Carré's avatar
Rafaël Carré committed
23
        git clone git://git.videolan.org/vlc/vlc-1.2.git vlc
24
25
26
else
	echo "VLC source found, pulling from remote master"
	pushd vlc > /dev/null
Rafaël Carré's avatar
Rafaël Carré committed
27
	git pull origin master
28
29
	popd > /dev/null
fi
ivoire's avatar
ivoire committed
30
31
32

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

echo "Building the contribs"
Rafaël Carré's avatar
Rafaël Carré committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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
53
54
55

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
56
57
if test ! -s "../configure"
then
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
58
    echo "Bootstraping"
Rafaël Carré's avatar
Rafaël Carré committed
59
60
    (cd .. && ./bootstrap)
fi
ivoire's avatar
ivoire committed
61
62
63
64

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
65
echo "Building"
ivoire's avatar
ivoire committed
66
make
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
67

Rafaël Carré's avatar
Rafaël Carré committed
68
69
70

# 2/ VLC android UI and specific code

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
71
72
echo "Building Android"
cd ../../
Rafaël Carré's avatar
Rafaël Carré committed
73

Rafaël Carré's avatar
Rafaël Carré committed
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
# 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.
if [ ! -d "android-headers/frameworks/base" ]; then
	echo "Fetching Android system headers (1/2)"
	git clone -b gingerbread --depth=1 git://github.com/CyanogenMod/android_frameworks_base.git android-headers/frameworks/base
else
	echo "Updating Android system headers (1/2)"
	pushd android-headers/frameworks/base > /dev/null
	git pull origin gingerbread
	popd > /dev/null
fi
if [ ! -d "android-headers/system/core" ]; then
	echo "Fetching Android system headers (2/2)"
	git clone -b gingerbread --depth=1 git://github.com/CyanogenMod/android_system_core.git android-headers/system/core
else
	echo "Updating Android system headers (2/2)"
	pushd android-headers/system/core > /dev/null
	git pull origin gingerbread
	popd > /dev/null
fi
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.
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
    unzip update-cm-7.1.0.1-NS-signed.zip system/lib/\*
    mv system/lib android-libs
    rmdir system
fi
export ANDROID_LIBS=${PWD}/android-libs

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
110
111
make distclean
VLC_BUILD_DIR=vlc/android make