Bug 1063356 - Define __ANDROID__ for libvpx asm. r=kinetik,mshal
authorRalph Giles <giles@mozilla.com>
Thu, 16 Oct 2014 13:39:20 -0700
changeset 211074 82ff6f0054839c90b6ef22e991e08e4773ebb8e7
parent 211073 f249d3d1dcfd7b72fe24b18e22a47a28a404388b
child 211075 5dc1be48edc3bf0d474a413497e433caac4d9aa9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerskinetik, mshal
bugs1063356
milestone36.0a1
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.
media/libvpx/Makefile.in
--- 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