gecko/media/libvpx/Makefile.in
Jan Gerber 7daba17fb2 Bug 918550 - Update libvpx to 1.3.0 r=glandium,cpearce
This updates our in-tree copy of libvpx to the
v1.3.0 git tag (2e88f2f2ec777259bda1714e72f1ecd2519bceb5)
libvpx 1.3.0 adds support for VP9. VP9 support is built
but not yet exposed with this commit.

Our update.sh script is replaced with update.py that can
update the build system to a given git commit.
 - checkout out upstream git
 - create platform dependend config files
 - add/remove changed libvpx files
 - update moz.build
 - warn about new build categories in libvpx
2013-12-06 03:19:00 -08:00

162 lines
4.7 KiB
Makefile

# 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.
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)
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
ifndef MOZ_WEBRTC
# For cpu-features.c
VPATH += $(ANDROID_NDK)/sources/android/cpufeatures
CSRCS += cpu-features.c
endif
endif
ASM_OFFSETS = vpx_scale_asm_offsets.asm
ifdef MOZ_VP8_ENCODER
ASM_OFFSETS += vp8_asm_enc_offsets.asm
endif
ifdef VPX_AS_CONVERSION
# The ARM asm is written in ARM RVCT syntax, but we actually build it with
# gas using GNU syntax. Add some rules to perform the conversion.
GENERATED_DIRS += $(dir $(ASFILES))
%.asm.$(ASM_SUFFIX): %.asm $(ASM_OFFSETS)
$(VPX_AS_CONVERSION) < $< > $@
endif
endif
ifdef VPX_NEED_OBJ_INT_EXTRACT
# We don't have a compiler that supports a compatible inline asm syntax, so we
# have to resort to extracting asm offsets from a compiled object. This only
# works if we have the appropriate system headers obj_int_extract needs to
# parse that format, and so only has limited support for cross-compilation.
ifdef VPX_ARM_ASM
VPX_OIE_FORMAT := rvds
else
VPX_OIE_FORMAT := gas
endif
GARBAGE += vpx_scale_asm_offsets.$(OBJ_SUFFIX) vpx_scale_asm_offsets.asm
ifdef MOZ_VP8_ENCODER
GARBAGE += vp8_asm_enc_offsets.$(OBJ_SUFFIX) vp8_asm_enc_offsets.asm
endif
else
# We can extract the asm offsets directly from generated assembly using inline
# asm. This is the preferred method.
vpx_scale_asm_offsets.s: CFLAGS += -DINLINE_ASM
OFFSET_PATTERN := '^[a-zA-Z0-9_]* EQU'
# This rule, as well as the rule for vp8_asm_enc_offsets.s further below are here
# because the generic rule in rules.mk was made to not be implicit, and we
# can't put the C files in CSRCS.
vpx_scale_asm_offsets.s: $(srcdir)/vpx_scale/vpx_scale_asm_offsets.c
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.s
grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
GARBAGE += vpx_scale_asm_offsets.s vpx_scale_asm_offsets.asm
ifdef MOZ_VP8_ENCODER
vp8_asm_enc_offsets.s: CFLAGS += -DINLINE_ASM
vp8_asm_enc_offsets.s: $(srcdir)/vp8/encoder/vp8_asm_enc_offsets.c
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.s
grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
GARBAGE += vp8_asm_enc_offsets.s vp8_asm_enc_offsets.asm
endif
endif
EXTRA_MDDEPEND_FILES = vp8_asm_enc_offsets.s.pp vp8_asm_enc_offsets.$(OBJ_SUFFIX).pp vpx_scale_asm_offsets.s.pp vpx_scale_asm_offsets.$(OBJ_SUFFIX).pp
include $(topsrcdir)/config/rules.mk
# This must be after rules.mk in order to use $(OBJ_SUFFIX) outside a
# recursively-expanded variable.
# dont add for MSVC
ifndef _MSC_VER
%_sse2.$(OBJ_SUFFIX): CFLAGS += -msse2
%_ssse3.$(OBJ_SUFFIX): CFLAGS += -mssse3
%_avx2.$(OBJ_SUFFIX): CFLAGS += -mavx2
endif
quantize_sse4.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
quantize_ssse3.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
ifdef VPX_NEED_OBJ_INT_EXTRACT
# only for MSVC
ifdef _MSC_VER
NO_PROFILE_GUIDED_OPTIMIZE := vpx_scale_asm_offsets.c
endif
vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
# Filter out this object, because we don't want to link against it.
# It was generated solely so it could be parsed by obj_int_extract.
OBJS := $(filter-out vpx_scale_asm_offsets.$(OBJ_SUFFIX),$(OBJS))
ifdef MOZ_VP8_ENCODER
ifdef _MSC_VER
NO_PROFILE_GUIDED_OPTIMIZE += vp8_asm_enc_offsets.c
endif
vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
# Filter out this object, because we don't want to link against it.
# It was generated solely so it could be parsed by obj_int_extract.
OBJS := $(filter-out vp8_asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS))
endif
endif
# Workaround a bug of Sun Studio (CR 6963410)
ifdef SOLARIS_SUNPRO_CC
ifeq (86,$(findstring 86,$(OS_TEST)))
filter.o: filter.c Makefile.in
$(REPORT_BUILD)
@$(MAKE_DEPS_AUTO_CC)
$(CC) -o $@ -c $(patsubst -xO[45],-xO3,$(COMPILE_CFLAGS)) $<
endif
endif