install.sh 2.48 KB
Newer Older
ivoire's avatar
ivoire committed
1
2
3
4
5
6
7
8
9
#! /bin/sh

GIT=git

if [ -z "$ANDROID_NDK" -o -z "$ANDROID_SDK" ]; then
   echo "You must define ANDROID_NDK and ANDROID_SDK before starting";
   exit 1;
fi;

10
11
12
13
14
# 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.
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
33
34
35
36
37
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.
38
39
40
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/*
41
42
43
    mv system/lib android-libs
    rmdir system
fi
44
45
export ANDROID_LIBS=${PWD}/android-libs

46
47
if [ ! -d "vlc" ]; then
	echo "VLC source not found, cloning"
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
48
        $GIT clone git://git.videolan.org/vlc/vlc-1.2.git vlc
49
50
51
52
53
54
else
	echo "VLC source found, pulling from remote master"
	pushd vlc > /dev/null
	$GIT pull origin master
	popd > /dev/null
fi
ivoire's avatar
ivoire committed
55
56
57

echo "Applying the patches"
cd vlc
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
58
$GIT am ../patches/*.patch || $GIT am --abort
ivoire's avatar
ivoire committed
59
60
61
62
63
64

echo "Building the contribs"
cd extras/contrib && ./bootstrap -t arm-eabi -d android && make

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
65
66
if test ! -s "../configure"
then
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
67
68
69
    echo "Bootstraping"
    ../bootstrap
fi;
ivoire's avatar
ivoire committed
70
71
72
73

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
74
echo "Building"
ivoire's avatar
ivoire committed
75
make
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
76
77
78
79
80

echo "Building Android"
cd ../../
make distclean
VLC_BUILD_DIR=vlc/android make