[Android] Move contribs building to compile-libvlc.sh

Jean-Baptiste Kempf git at videolan.org
Wed Feb 4 18:30:18 CET 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb  4 18:30:07 2015 +0100| [4f5b835a44a3987a227728b85f7c64fda654f645] | committer: Jean-Baptiste Kempf

Move contribs building to compile-libvlc.sh

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=4f5b835a44a3987a227728b85f7c64fda654f645
---

 compile-libvlc.sh |   96 +++++++++++++++++++++++++++++++++++++++++++++++++----
 compile.sh        |   68 -------------------------------------
 2 files changed, 90 insertions(+), 74 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index 33b5be2..edbb83a 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -12,12 +12,6 @@ if [ -z "$ANDROID_ABI" ]; then
     exit 1
 fi
 
-# ANDROID_API must be previously set by compile.sh or env.sh
-if [ -z "$ANDROID_API" ];then
-    echo "ANDROID_API not set, call ./compile.sh first"
-    exit 1
-fi
-
 for i in ${@}; do
     case "$i" in
         release|--release)
@@ -58,6 +52,27 @@ else
     PLATFORM_SHORT_ARCH="arm"
 fi
 
+
+# try to detect NDK version
+REL=$(grep -o '^r[0-9]*.*' $ANDROID_NDK/RELEASE.TXT 2>/dev/null|cut -b2-)
+case "$REL" in
+    10*)
+        if [ "${HAVE_64}" = 1 ];then
+            GCCVER=4.9
+            ANDROID_API=android-21
+        else
+            GCCVER=4.8
+            ANDROID_API=android-9
+        fi
+        CXXSTL="/"${GCCVER}
+    ;;
+    *)
+        echo "You need the NDKv10 or later"
+        exit 1
+    ;;
+esac
+
+
 # Make in //
 if [ -z "$MAKEFLAGS" ]; then
     UNAMES=$(uname -s)
@@ -110,6 +125,75 @@ if [ ! -f config.h ]; then
     ./bootstrap
 fi
 
+############
+# Contribs #
+############
+echo "Building the contribs"
+mkdir -p contrib/contrib-android-${TARGET_TUPLE}
+
+gen_pc_file() {
+    echo "Generating $1 pkg-config file"
+    echo "Name: $1
+Description: $1
+Version: $2
+Libs: -l$1
+Cflags:" > contrib/${TARGET_TUPLE}/lib/pkgconfig/`echo $1|tr 'A-Z' 'a-z'`.pc
+}
+
+mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig
+gen_pc_file EGL 1.1
+gen_pc_file GLESv2 2
+
+cd contrib/contrib-android-${TARGET_TUPLE}
+../bootstrap --host=${TARGET_TUPLE} --disable-disc --disable-sout \
+    --enable-dvdread \
+    --enable-dvdnav \
+    --disable-dca \
+    --disable-goom \
+    --disable-chromaprint \
+    --disable-lua \
+    --disable-schroedinger \
+    --disable-sdl \
+    --disable-SDL_image \
+    --disable-fontconfig \
+    --enable-zvbi \
+    --disable-kate \
+    --disable-caca \
+    --disable-gettext \
+    --disable-mpcdec \
+    --disable-upnp \
+    --disable-gme \
+    --disable-tremor \
+    --enable-vorbis \
+    --disable-sidplay2 \
+    --disable-samplerate \
+    --disable-faad2 \
+    --disable-harfbuzz \
+    --enable-iconv \
+    --disable-aribb24 \
+    --disable-aribb25 \
+    --disable-mpg123 \
+    --enable-libdsm
+
+# TODO: mpeg2, theora
+
+# Some libraries have arm assembly which won't build in thumb mode
+# We append -marm to the CFLAGS of these libs to disable thumb mode
+[ ${ANDROID_ABI} = "armeabi-v7a" ] && echo "NOTHUMB := -marm" >> config.mak
+
+echo "EXTRA_CFLAGS= -g ${EXTRA_CFLAGS}" >> config.mak
+echo "EXTRA_LDFLAGS= ${EXTRA_LDFLAGS}" >> config.mak
+export VLC_EXTRA_CFLAGS="${EXTRA_CFLAGS}"
+export VLC_EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
+
+make fetch
+# We already have zlib available
+[ -e .zlib ] || (mkdir -p zlib; touch .zlib)
+which autopoint >/dev/null || make $MAKEFLAGS .gettext
+export PATH="$PATH:$PWD/../$TARGET_TUPLE/bin"
+make $MAKEFLAGS
+
+
 ###################
 # BUILD DIRECTORY #
 ###################
diff --git a/compile.sh b/compile.sh
index 1c7a447..b78d717 100755
--- a/compile.sh
+++ b/compile.sh
@@ -236,74 +236,6 @@ make $MAKEFLAGS
 cd ../..
 
 ############
-# Contribs #
-############
-echo "Building the contribs"
-mkdir -p contrib/contrib-android-${TARGET_TUPLE}
-
-gen_pc_file() {
-    echo "Generating $1 pkg-config file"
-    echo "Name: $1
-Description: $1
-Version: $2
-Libs: -l$1
-Cflags:" > contrib/${TARGET_TUPLE}/lib/pkgconfig/`echo $1|tr 'A-Z' 'a-z'`.pc
-}
-
-mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig
-gen_pc_file EGL 1.1
-gen_pc_file GLESv2 2
-
-cd contrib/contrib-android-${TARGET_TUPLE}
-../bootstrap --host=${TARGET_TUPLE} --disable-disc --disable-sout \
-    --enable-dvdread \
-    --enable-dvdnav \
-    --disable-dca \
-    --disable-goom \
-    --disable-chromaprint \
-    --disable-lua \
-    --disable-schroedinger \
-    --disable-sdl \
-    --disable-SDL_image \
-    --disable-fontconfig \
-    --enable-zvbi \
-    --disable-kate \
-    --disable-caca \
-    --disable-gettext \
-    --disable-mpcdec \
-    --disable-upnp \
-    --disable-gme \
-    --disable-tremor \
-    --enable-vorbis \
-    --disable-sidplay2 \
-    --disable-samplerate \
-    --disable-faad2 \
-    --disable-harfbuzz \
-    --enable-iconv \
-    --disable-aribb24 \
-    --disable-aribb25 \
-    --disable-mpg123 \
-    --enable-libdsm
-
-# TODO: mpeg2, theora
-
-# Some libraries have arm assembly which won't build in thumb mode
-# We append -marm to the CFLAGS of these libs to disable thumb mode
-[ ${ANDROID_ABI} = "armeabi-v7a" ] && echo "NOTHUMB := -marm" >> config.mak
-
-echo "EXTRA_CFLAGS= -g ${EXTRA_CFLAGS}" >> config.mak
-echo "EXTRA_LDFLAGS= ${EXTRA_LDFLAGS}" >> config.mak
-export VLC_EXTRA_CFLAGS="${EXTRA_CFLAGS}"
-export VLC_EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
-
-make fetch
-# We already have zlib available
-[ -e .zlib ] || (mkdir -p zlib; touch .zlib)
-which autopoint >/dev/null || make $MAKEFLAGS .gettext
-export PATH="$PATH:$PWD/../$TARGET_TUPLE/bin"
-make $MAKEFLAGS
-
-############
 # Make VLC #
 ############
 cd ../..



More information about the Android mailing list