summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/make/Android.mk16
-rwxr-xr-xbuild/make/configure.sh19
2 files changed, 29 insertions, 6 deletions
diff --git a/build/make/Android.mk b/build/make/Android.mk
index 6fcd4aec3..d54639aa6 100644
--- a/build/make/Android.mk
+++ b/build/make/Android.mk
@@ -34,8 +34,15 @@
# Application.mk in the jni directory that contains:
# APP_ABI := armeabi-v7a
#
+# By default libvpx will detect at runtime the existance of NEON extension.
+# For this we import the 'cpufeatures' module from the NDK sources.
+# libvpx can also be configured without this runtime detection method.
+# Configuring with --disable-runtime-cpu-detect will assume presence of NEON.
+# Configuring with --disable-runtime-cpu-detect --disable-neon will remove any
+# NEON dependency.
+
# To change to building armeabi, run ./libvpx/configure again, but with
-# --target=arm5te-android-gcc and and modify the Application.mk file to
+# --target=arm5te-android-gcc and modify the Application.mk file to
# set APP_ABI := armeabi
#
# Running ndk-build will build libvpx and include it in your project.
@@ -166,7 +173,9 @@ LOCAL_MODULE := libvpx
LOCAL_LDLIBS := -llog
-LOCAL_STATIC_LIBRARIES := cpufeatures
+ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
+ LOCAL_STATIC_LIBRARIES := cpufeatures
+endif
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_rtcd.h
@@ -196,4 +205,7 @@ ifeq ($(CONFIG_VP8_ENCODER), yes)
$(LIBVPX_PATH)/vp8/encoder/asm_enc_offsets.c))
endif
+ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
$(call import-module,cpufeatures)
+endif
+
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 575a394ff..9a520a997 100755
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -773,17 +773,23 @@ process_common_toolchain() {
check_add_asflags --defsym ARCHITECTURE=${arch_int}
tune_cflags="-mtune="
if [ ${tgt_isa} == "armv7" ]; then
+ check_add_cflags -march=armv7-a -mfloat-abi=softfp
+ check_add_asflags -march=armv7-a -mfloat-abi=softfp
+
if enabled neon
then
check_add_cflags -mfpu=neon #-ftree-vectorize
check_add_asflags -mfpu=neon
fi
- check_add_cflags -march=armv7-a -mcpu=cortex-a8 -mfloat-abi=softfp
- check_add_asflags -mcpu=cortex-a8 -mfloat-abi=softfp #-march=armv7-a
+
+ if [ -z "${tune_cpu}" ]; then
+ tune_cpu=cortex-a8
+ fi
else
check_add_cflags -march=${tgt_isa}
check_add_asflags -march=${tgt_isa}
fi
+
enabled debug && add_asflags -g
asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
;;
@@ -851,12 +857,17 @@ process_common_toolchain() {
add_cflags "--sysroot=${alt_libc}"
add_ldflags "--sysroot=${alt_libc}"
- add_cflags "-I${SDK_PATH}/sources/android/cpufeatures/"
+ # linker flag that routes around a CPU bug in some
+ # Cortex-A8 implementations (NDK Dev Guide)
+ add_ldflags "-Wl,--fix-cortex-a8"
enable pic
soft_enable realtime_only
if [ ${tgt_isa} == "armv7" ]; then
- enable runtime_cpu_detect
+ soft_enable runtime_cpu_detect
+ fi
+ if enabled runtime_cpu_detect; then
+ add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
fi
;;