Bug 859830: determine Android API level through android/api-leve.h instead. r=glandium

This commit is contained in:
Vicamo Yang 2013-04-12 13:39:42 +08:00
parent 0e977ab226
commit 57bd116b87
5 changed files with 13 additions and 10 deletions

View File

@ -109,6 +109,8 @@ case "$target" in
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-android-toolchain=$android_toolchain"
fi
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-android-version=$android_version"
if test -z "$android_platform" ; then
AC_MSG_CHECKING([for android platform directory])
@ -184,11 +186,8 @@ case "$target" in
ANDROID_NDK="${android_ndk}"
ANDROID_TOOLCHAIN="${android_toolchain}"
ANDROID_PLATFORM="${android_platform}"
ANDROID_VERSION="${android_version}"
AC_DEFINE(ANDROID)
AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version)
AC_SUBST(ANDROID_VERSION)
CROSS_COMPILE=1
AC_SUBST(ANDROID_NDK)
AC_SUBST(ANDROID_TOOLCHAIN)

View File

@ -9335,7 +9335,7 @@ if test -n "$_WRAP_MALLOC"; then
fi
if test -z "$MOZ_NATIVE_NSPR"; then
ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla --with-android-version=$ANDROID_VERSION"
ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
if test -z "$MOZ_DEBUG"; then
ac_configure_args="$ac_configure_args --disable-debug"
else

View File

@ -109,6 +109,8 @@ case "$target" in
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-android-toolchain=$android_toolchain"
fi
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-android-version=$android_version"
if test -z "$android_platform" ; then
AC_MSG_CHECKING([for android platform directory])
@ -184,11 +186,8 @@ case "$target" in
ANDROID_NDK="${android_ndk}"
ANDROID_TOOLCHAIN="${android_toolchain}"
ANDROID_PLATFORM="${android_platform}"
ANDROID_VERSION="${android_version}"
AC_DEFINE(ANDROID)
AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version)
AC_SUBST(ANDROID_VERSION)
CROSS_COMPILE=1
AC_SUBST(ANDROID_NDK)
AC_SUBST(ANDROID_TOOLCHAIN)

View File

@ -14,7 +14,9 @@
#include "Mappable.h"
#include "Logging.h"
#if defined(ANDROID) && ANDROID_VERSION < 8
#if defined(ANDROID)
#include <android/api-level.h>
#if __ANDROID_API__ < 8
/* Android API < 8 doesn't provide sigaltstack */
#include <sys/syscall.h>
@ -25,7 +27,8 @@ inline int sigaltstack(const stack_t *ss, stack_t *oss) {
}
} /* extern "C" */
#endif
#endif /* __ANDROID_API__ */
#endif /* ANDROID */
using namespace mozilla;

View File

@ -6,10 +6,12 @@
// Android runs a fairly new Linux kernel, so signal info is there,
// but the C library doesn't have the structs defined.
#include <android/api-level.h>
// All NDK platform versions have asm/sigcontext.h for ARM
// Only NDK >= 6, platform >= 9 have asm/sigcontext.h for x86
// Only NDK >= 8, platform >= 9 have asm/sigcontext.h for MIPS
#if defined(__arm__) || defined(__thumb__) || ANDROID_VERSION >= 9
#if defined(__arm__) || defined(__thumb__) || __ANDROID_API__ >= 9
#include <asm/sigcontext.h>
#else
#error use newer NDK or newer platform version (e.g. --with-android-version=9)