...
 
Commits (3)
......@@ -863,6 +863,85 @@ process_common_toolchain() {
add_extralibs -lposix4
;;
esac
# Configure Android toolchain
case ${tgt_os} in
android*)
case ${tgt_isa} in
armv7)
ANDROID_TOOLCHAIN_PREFIX=arm-linux-androideabi
ANDROID_TOOLCHAIN_ARCH=arm
;;
x86)
ANDROID_TOOLCHAIN_PREFIX=x86-linux-android
ANDROID_TOOLCHAIN_ALT_PREFIX=x86_64-linux-android
ANDROID_TOOLCHAIN_ARCH=x86
;;
x86_64)
ANDROID_TOOLCHAIN_PREFIX=x86_64-linux-android
ANDROID_TOOLCHAIN_ALT_PREFIX=x86_64-linux-android
ANDROID_TOOLCHAIN_ARCH=x86_64
;;
arm64)
ANDROID_TOOLCHAIN_PREFIX=aarch64-linux-android
ANDROID_TOOLCHAIN_ARCH=arm64
;;
esac
SDK_PATH=${sdk_path}
COMPILER_LOCATION=`find "${SDK_PATH}" \
-name "${ANDROID_TOOLCHAIN_PREFIX}-gcc*" -print -quit`
if [ -z "${COMPILER_LOCATION}" ]; then
COMPILER_LOCATION=`find "${SDK_PATH}" \
-name "${ANDROID_TOOLCHAIN_ALT_PREFIX}-gcc*" -print -quit`
ANDROID_TOOLCHAIN_PREFIX=${ANDROID_TOOLCHAIN_ALT_PREFIX}
fi
TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/${ANDROID_TOOLCHAIN_PREFIX}-
CC=${TOOLCHAIN_PATH}gcc
CXX=${TOOLCHAIN_PATH}g++
AR=${TOOLCHAIN_PATH}ar
LD=${TOOLCHAIN_PATH}gcc
AS=${TOOLCHAIN_PATH}as
STRIP=${TOOLCHAIN_PATH}strip
NM=${TOOLCHAIN_PATH}nm
if [ -z "${alt_libc}" ]; then
alt_libc=`find "${SDK_PATH}" -name arch-${ANDROID_TOOLCHAIN_ARCH} -print | \
awk '{n = split($0,a,"/"); \
split(a[n-1],b,"-"); \
print $0 " " b[2]}' | \
sort -g -k 2 | \
awk '{ print $1 }' | tail -1`
fi
if [ -d "${alt_libc}" ]; then
add_cflags "--sysroot=${alt_libc}"
add_ldflags "--sysroot=${alt_libc}"
fi
if [ ${tgt_isa} = "armv7" ]; then
# linker flag that routes around a CPU bug in some
# Cortex-A8 implementations (NDK Dev Guide)
add_ldflags "-Wl,--fix-cortex-a8"
fi
if [ ${tgt_isa} = "x86" ] || [ ${tgt_isa} = "x86_64" ]; then
add_asflags "-D__ANDROID__"
add_cflags "-D__ANDROID__"
fi
enable_feature pic
soft_enable realtime_only
if [ ${tgt_isa} = "armv7" ]; then
soft_enable runtime_cpu_detect
fi
if enabled runtime_cpu_detect; then
add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
fi
add_cflags "-I${SDK_PATH}/sysroot/usr/include -I${SDK_PATH}/sysroot/usr/include/${ANDROID_TOOLCHAIN_PREFIX}"
;;
esac
# Process ARM architecture variants
case ${toolchain} in
......@@ -978,53 +1057,6 @@ EOF
disable_feature os_support
;;
android*)
if [ -n "${sdk_path}" ]; then
SDK_PATH=${sdk_path}
COMPILER_LOCATION=`find "${SDK_PATH}" \
-name "arm-linux-androideabi-gcc*" -print -quit`
TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
CC=${TOOLCHAIN_PATH}gcc
CXX=${TOOLCHAIN_PATH}g++
AR=${TOOLCHAIN_PATH}ar
LD=${TOOLCHAIN_PATH}gcc
AS=${TOOLCHAIN_PATH}as
STRIP=${TOOLCHAIN_PATH}strip
NM=${TOOLCHAIN_PATH}nm
if [ -z "${alt_libc}" ]; then
alt_libc=`find "${SDK_PATH}" -name arch-arm -print | \
awk '{n = split($0,a,"/"); \
split(a[n-1],b,"-"); \
print $0 " " b[2]}' | \
sort -g -k 2 | \
awk '{ print $1 }' | tail -1`
fi
if [ -d "${alt_libc}" ]; then
add_cflags "--sysroot=${alt_libc}"
add_ldflags "--sysroot=${alt_libc}"
fi
# linker flag that routes around a CPU bug in some
# Cortex-A8 implementations (NDK Dev Guide)
add_ldflags "-Wl,--fix-cortex-a8"
enable_feature pic
soft_enable realtime_only
if [ ${tgt_isa} = "armv7" ]; then
soft_enable runtime_cpu_detect
fi
if enabled runtime_cpu_detect; then
add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
fi
else
echo "Assuming standalone build with NDK toolchain."
echo "See build/make/Android.mk for details."
check_add_ldflags -static
soft_enable unit_tests
fi
;;
darwin*)
XCRUN_FIND="xcrun --sdk iphoneos --find"
......
......@@ -17,6 +17,10 @@
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
#ifdef __ANDROID__
#define rand lrand48
#endif
void vpx_plane_add_noise_c(uint8_t *start, const int8_t *noise, int blackclamp,
int whiteclamp, int width, int height, int pitch) {
int i, j;
......