compile.sh 2.13 KB
Newer Older
Rémi Duraffort's avatar
Rémi Duraffort 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.
Rémi Duraffort's avatar
Rémi Duraffort 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
Rémi Duraffort's avatar
Rémi Duraffort committed
18

19 20 21 22
# Add the NDK toolchain to the PATH, needed both for contribs and for building
# stub libraries
export PATH=${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:${PATH}

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

25 26
if [ ! -d "vlc" ]; then
	echo "VLC source not found, cloning"
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
27
        git clone git://git.videolan.org/vlc/vlc-2.0.git vlc
28 29 30
else
	echo "VLC source found, pulling from remote master"
	pushd vlc > /dev/null
Rafaël Carré's avatar
Rafaël Carré committed
31
	git pull origin master
32 33
	popd > /dev/null
fi
Rémi Duraffort's avatar
Rémi Duraffort committed
34 35 36

echo "Applying the patches"
cd vlc
Rafaël Carré's avatar
Rafaël Carré committed
37
git am ../patches/*.patch || git am --abort
Rémi Duraffort's avatar
Rémi Duraffort committed
38 39

echo "Building the contribs"
Rafaël Carré's avatar
Rafaël Carré committed
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 \
53
    --disable-upnp \
54
    --disable-sidplay2
Rafaël Carré's avatar
Rafaël Carré committed
55 56 57

make fetch
make
Rémi Duraffort's avatar
Rémi Duraffort committed
58 59 60

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
61 62
if test ! -s "../configure"
then
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
63
    echo "Bootstraping"
Sébastien Toque's avatar
Sébastien Toque committed
64
    ../bootstrap
Rafaël Carré's avatar
Rafaël Carré committed
65
fi
Rémi Duraffort's avatar
Rémi Duraffort committed
66 67 68 69

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
70
echo "Building"
Rémi Duraffort's avatar
Rémi Duraffort committed
71
make
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
72

Rafaël Carré's avatar
Rafaël Carré committed
73 74 75

# 2/ VLC android UI and specific code

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
76 77
echo "Building Android"
cd ../../
Rafaël Carré's avatar
Rafaël Carré committed
78

79 80
export ANDROID_SYS_HEADERS_GINGERBREAD=${PWD}/android-headers-gingerbread
export ANDROID_SYS_HEADERS_ICS=${PWD}/android-headers-ics
Rafaël Carré's avatar
Rafaël Carré committed
81 82

export ANDROID_LIBS=${PWD}/android-libs
83
export VLC_BUILD_DIR=vlc/android
Rafaël Carré's avatar
Rafaël Carré committed
84

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
85
make distclean
86
make