Commit 0402cd86 authored by Thomas Guillem's avatar Thomas Guillem Committed by Jean-Baptiste Kempf

build: add 64bits and android-L support

Don't hardcode android api to android-9 anymore, use ANDROID_API export.

In case of 64bits build: set ANDROID_API to android-L and GCCVER to 4.9.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 79d6682e
......@@ -78,7 +78,7 @@ $(LIBVLCJNI_H):
printf "/* Autogenerated from the list of modules */\n $$DEFINITION\n $$BUILTINS\n" > $@
$(PRIVATE_LIBDIR)/%.so: $(PRIVATE_LIBDIR)/%.c
$(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-$(PLATFORM_SHORT_ARCH)
$(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(ANDROID_NDK)/platforms/$(ANDROID_API)/arch-$(PLATFORM_SHORT_ARCH)
$(PRIVATE_LIBDIR)/%.c: $(PRIVATE_LIBDIR)/%.symbols
$(VERBOSE)rm -f $@
......
......@@ -34,22 +34,6 @@ if [ -z "$ANDROID_ABI" ]; then
exit 1
fi
# try to detect NDK version
REL=$(grep -o '^r[0-9]*.*' $ANDROID_NDK/RELEASE.TXT 2>/dev/null|cut -b2-)
case "$REL" in
9*|10*)
GCCVER=4.8
CXXSTL="/"${GCCVER}
;;
7|8|*)
echo "You need the NDKv9 or later"
exit 1
;;
esac
export GCCVER
export CXXSTL
# Set up ABI variables
if [ ${ANDROID_ABI} = "x86" ] ; then
TARGET_TUPLE="i686-linux-android"
......@@ -68,6 +52,38 @@ 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-L
else
GCCVER=4.8
ANDROID_API=android-9
fi
CXXSTL="/"${GCCVER}
;;
9*)
if [ "${HAVE_64}" = 1 ];then
echo "You need the NDKv10 or later for 64 bits build"
exit 1
fi
GCCVER=4.8
ANDROID_API=android-9
CXXSTL="/"${GCCVER}
;;
7|8|*)
echo "You need the NDKv9 or later"
exit 1
;;
esac
export GCCVER
export CXXSTL
export ANDROID_API
# XXX : important!
[ "$HAVE_ARM" = 1 ] && cat << EOF
For an ARMv6 device without FPU:
......@@ -83,6 +99,7 @@ export PATH_HOST
export HAVE_ARM
export HAVE_X86
export HAVE_MIPS
export HAVE_64
export PLATFORM_SHORT_ARCH
# Add the NDK toolchain to the PATH, needed both for contribs and for building
......@@ -329,6 +346,7 @@ echo "# Re-run 'sh compile.sh' to update this file." >> env.sh
# The essentials
cat <<EssentialsA >> env.sh
export ANDROID_API=$ANDROID_API
export ANDROID_ABI=$ANDROID_ABI
export ANDROID_SDK=$ANDROID_SDK
export ANDROID_NDK=$ANDROID_NDK
......
......@@ -10,9 +10,11 @@ if [ -z "$ANDROID_ABI" ]; then
exit 1
fi
# Must use android-9 here. Any replacement functions needed are in the vlc-android/jni
# folder.
ANDROID_API=android-9
# 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
VLC_SOURCEDIR=..
......
APP_PLATFORM := android-9
APP_PLATFORM := $(ANDROID_API)
APP_ABI := $(ANDROID_ABI)
NDK_TOOLCHAIN_VERSION=4.6
NDK_TOOLCHAIN_VERSION=$(GCCVER)
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