summaryrefslogtreecommitdiff
path: root/build/make/configure.sh
diff options
context:
space:
mode:
authorJohann Koenig <johannkoenig@google.com>2016-09-15 19:17:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-09-15 19:17:14 +0000
commitee01b78ddd88a9156d6b926fc932d3cdfc070df9 (patch)
tree4cacf4af280f6a4414f2e7c1ca72383ca7334f51 /build/make/configure.sh
parent4282d29355df3b72372669fe3b745c753dfe1c7d (diff)
parenta3400f4376ce3d94011cc5f4ac87324d909874f3 (diff)
downloadlibvpx-ee01b78ddd88a9156d6b926fc932d3cdfc070df9.tar
libvpx-ee01b78ddd88a9156d6b926fc932d3cdfc070df9.tar.gz
libvpx-ee01b78ddd88a9156d6b926fc932d3cdfc070df9.tar.bz2
libvpx-ee01b78ddd88a9156d6b926fc932d3cdfc070df9.zip
Merge "Documentation for building unit tests for Android"
Diffstat (limited to 'build/make/configure.sh')
-rw-r--r--build/make/configure.sh72
1 files changed, 38 insertions, 34 deletions
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 14fada09d..35609e89a 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -978,47 +978,50 @@ EOF
;;
android*)
- if [ -z "${sdk_path}" ]; then
- die "Must specify --sdk-path for Android builds."
- fi
-
- 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,"/"); \
+ 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
+ fi
- if [ -d "${alt_libc}" ]; then
- add_cflags "--sysroot=${alt_libc}"
- add_ldflags "--sysroot=${alt_libc}"
- 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"
+ # 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"
+ 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
;;
@@ -1392,6 +1395,7 @@ EOF
*-win*-vs*)
;;
*-android-gcc)
+ # bionic includes basic pthread functionality, obviating -lpthread.
;;
*)
check_header pthread.h && add_extralibs -lpthread