Bug 1063356 - Define __ANDROID__ for libvpx asm. r=kinetik,mshal
The assembly relies on __ANDROID__ to decide whether to call
'lrand48' or 'rand'. The later is available on desktop but
only on Android L or later. However, this macro isn't defined
by the linux vpx_config asm file we use for x86 Android builds,
so we must pass it manually when invoking yasm.
--- a/media/libvpx/Makefile.in
+++ b/media/libvpx/Makefile.in
@@ -1,18 +1,24 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#Setup the libvpx assembler config.
+# Set up the libvpx assembler config.
+
AS=$(VPX_AS)
ASFLAGS=$(VPX_ASFLAGS) -I. -I$(topsrcdir)/media/libvpx/ -I$(topsrcdir)/media/libvpx/vpx_ports/
AS_DASH_C_FLAG=$(VPX_DASH_C_FLAG)
ASM_SUFFIX=$(VPX_ASM_SUFFIX)
+ifeq ($(OS_TARGET),Android)
+ # For LIBVPX_RAND
+ ASFLAGS += -D__ANDROID__
+endif
+
ifdef VPX_ARM_ASM
# Building on an ARM platform with a supported assembler, include
# the optimized assembly in the build.
ifeq ($(OS_TARGET),Android)
# For cpu-features.h
LOCAL_INCLUDES += -I$(ANDROID_NDK)/sources/android/cpufeatures
endif