Commit c587daf7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Use build-android-{TUPLE} and contrib-android-{TUPLE}

This allows compiling of multiple vlc arch in one vlc repo and this is
also correctly ignored by .gitignore of vlc/
parent e932009b
...@@ -92,6 +92,7 @@ export PATH=${NDK_TOOLCHAIN_PATH}:${PATH} ...@@ -92,6 +92,7 @@ export PATH=${NDK_TOOLCHAIN_PATH}:${PATH}
ANDROID_PATH="`pwd`" ANDROID_PATH="`pwd`"
# Fetch VLC source
if [ ! -z "$FETCH" ] if [ ! -z "$FETCH" ]
then then
# 1/ libvlc, libvlccore and its plugins # 1/ libvlc, libvlccore and its plugins
...@@ -135,6 +136,7 @@ then ...@@ -135,6 +136,7 @@ then
exit 0 exit 0
fi fi
# Setup CFLAGS
if [ ${ANDROID_ABI} = "armeabi-v7a" ] ; then if [ ${ANDROID_ABI} = "armeabi-v7a" ] ; then
EXTRA_CFLAGS="-mfpu=vfpv3-d16 -mcpu=cortex-a8" EXTRA_CFLAGS="-mfpu=vfpv3-d16 -mcpu=cortex-a8"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mthumb -mfloat-abi=softfp" EXTRA_CFLAGS="${EXTRA_CFLAGS} -mthumb -mfloat-abi=softfp"
...@@ -165,6 +167,7 @@ EXTRA_CFLAGS="${EXTRA_CFLAGS} -O2" ...@@ -165,6 +167,7 @@ EXTRA_CFLAGS="${EXTRA_CFLAGS} -O2"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/include" EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/include"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/include" EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/include"
# Make in //
UNAMES=$(uname -s) UNAMES=$(uname -s)
MAKEFLAGS= MAKEFLAGS=
if which nproc >/dev/null if which nproc >/dev/null
...@@ -175,6 +178,7 @@ then ...@@ -175,6 +178,7 @@ then
MAKEFLAGS=-j`sysctl -n machdep.cpu.thread_count` MAKEFLAGS=-j`sysctl -n machdep.cpu.thread_count`
fi fi
# Build buildsystem tools
export PATH=`pwd`/extras/tools/build/bin:$PATH export PATH=`pwd`/extras/tools/build/bin:$PATH
echo "Building tools" echo "Building tools"
cd extras/tools cd extras/tools
...@@ -182,8 +186,11 @@ cd extras/tools ...@@ -182,8 +186,11 @@ cd extras/tools
make $MAKEFLAGS make $MAKEFLAGS
cd ../.. cd ../..
############
# Contribs #
############
echo "Building the contribs" echo "Building the contribs"
mkdir -p contrib/android mkdir -p contrib/contrib-android-${TARGET_TUPLE}
gen_pc_file() { gen_pc_file() {
echo "Generating $1 pkg-config file" echo "Generating $1 pkg-config file"
...@@ -198,7 +205,7 @@ mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig ...@@ -198,7 +205,7 @@ mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig
gen_pc_file EGL 1.1 gen_pc_file EGL 1.1
gen_pc_file GLESv2 2 gen_pc_file GLESv2 2
cd contrib/android cd contrib/contrib-android-${TARGET_TUPLE}
../bootstrap --host=${TARGET_TUPLE} --disable-disc --disable-sout \ ../bootstrap --host=${TARGET_TUPLE} --disable-disc --disable-sout \
--enable-dvdread \ --enable-dvdread \
--enable-dvdnav \ --enable-dvdnav \
...@@ -251,7 +258,10 @@ which autopoint >/dev/null || make $MAKEFLAGS .gettext ...@@ -251,7 +258,10 @@ which autopoint >/dev/null || make $MAKEFLAGS .gettext
export PATH="$PATH:$PWD/../$TARGET_TUPLE/bin" export PATH="$PATH:$PWD/../$TARGET_TUPLE/bin"
make $MAKEFLAGS make $MAKEFLAGS
cd ../.. && mkdir -p android && cd android ############
# Make VLC #
############
cd ../.. && mkdir -p build-android-${TARGET_TUPLE} && cd build-android-${TARGET_TUPLE}
if [ $# -eq 1 ] && [ "$1" = "jni" ]; then if [ $# -eq 1 ] && [ "$1" = "jni" ]; then
CLEAN="jniclean" CLEAN="jniclean"
...@@ -270,10 +280,10 @@ fi ...@@ -270,10 +280,10 @@ fi
echo "Building" echo "Building"
make $MAKEFLAGS make $MAKEFLAGS
####################################
# 2/ VLC android UI and specific code # VLC android UI and specific code
####################################
echo "Building Android" echo "Building VLC for Android"
cd ../../ cd ../../
export ANDROID_SYS_HEADERS_GINGERBREAD=${PWD}/android-headers-gingerbread export ANDROID_SYS_HEADERS_GINGERBREAD=${PWD}/android-headers-gingerbread
...@@ -281,12 +291,14 @@ export ANDROID_SYS_HEADERS_HC=${PWD}/android-headers-hc ...@@ -281,12 +291,14 @@ export ANDROID_SYS_HEADERS_HC=${PWD}/android-headers-hc
export ANDROID_SYS_HEADERS_ICS=${PWD}/android-headers-ics export ANDROID_SYS_HEADERS_ICS=${PWD}/android-headers-ics
export ANDROID_LIBS=${PWD}/android-libs export ANDROID_LIBS=${PWD}/android-libs
export VLC_BUILD_DIR=vlc/android export VLC_BUILD_DIR=vlc/build-android-${TARGET_TUPLE}
make $CLEAN make $CLEAN
make -j1 TARGET_TUPLE=$TARGET_TUPLE PLATFORM_SHORT_ARCH=$PLATFORM_SHORT_ARCH CXXSTL=$CXXSTL RELEASE=$RELEASE $TARGET make -j1 TARGET_TUPLE=$TARGET_TUPLE PLATFORM_SHORT_ARCH=$PLATFORM_SHORT_ARCH CXXSTL=$CXXSTL RELEASE=$RELEASE $TARGET
# 3/ Environment script #
# Exporting a environment script with all the necessary variables
#
echo "Generating environment script." echo "Generating environment script."
cat <<EOF cat <<EOF
This is a script that will export many of the variables used in this This is a script that will export many of the variables used in this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment