summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-07-04 09:06:49 +0200
committerJan Holesovsky <kendy@collabora.com>2019-07-09 09:32:43 +0200
commitdcaeb9bc6d4e7eb9a84635f876b7ce87e2440f8b (patch)
tree28f2b62dfdb1635862c092c03f3ee00903cd8ff4
parentc22f3afb7b9c431904fec143a5f98eb362328402 (diff)
android: Allow specification of the API level.cp-android-20coas-0.1.0
Change-Id: Icf33e2703f42a7866ce895437cf5f276066eeebe
-rw-r--r--configure.ac15
1 files changed, 14 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 78a1a7f3f48d..060c463b0606 100644
--- a/configure.ac
+++ b/configure.ac
@@ -366,6 +366,11 @@ AC_ARG_WITH(android-sdk,
[Specify location of the Android SDK. Mandatory when building for Android.]),
,)
+AC_ARG_WITH(android-api-level,
+ AS_HELP_STRING([--with-android-api-level],
+ [Specify the API level when building for Android. Defaults to 16 for ARM and x86 and to 21 for ARM64 and x86-64]),
+,)
+
ANDROID_NDK_HOME=
if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
with_android_ndk="$SRC_ROOT/external/android-ndk"
@@ -402,6 +407,10 @@ if test -n "$with_android_ndk"; then
esac
ANDROID_API_LEVEL=16
+ if test -n "$with_android_api_level" ; then
+ ANDROID_API_LEVEL="$with_android_api_level"
+ fi
+
android_cpu=$host_cpu
ANDROID_ARCH=$android_cpu
if test $host_cpu = arm; then
@@ -415,7 +424,9 @@ if test -n "$with_android_ndk"; then
android_gnu_prefix=$android_platform_prefix
LLVM_TRIPLE=aarch64-none-linux-android
# minimum android version that supports aarch64
- ANDROID_API_LEVEL=21
+ if test "$ANDROID_API_LEVEL" -lt "21" ; then
+ ANDROID_API_LEVEL=21
+ fi
ANDROID_APP_ABI=arm64-v8a
ANDROID_ARCH=arm64
elif test $host_cpu = mips; then
@@ -451,6 +462,8 @@ if test -n "$with_android_ndk"; then
AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
fi
+ AC_MSG_NOTICE([using the Android API level... $ANDROID_API_LEVEL])
+
# NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
# linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
# manage to link the (app-specific) single huge .so that is built for the app in