media/libvpx/Makefile.in

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4
michael@0 5 #Setup the libvpx assembler config.
michael@0 6 AS=$(VPX_AS)
michael@0 7 ASFLAGS=$(VPX_ASFLAGS) -I. -I$(topsrcdir)/media/libvpx/ -I$(topsrcdir)/media/libvpx/vpx_ports/
michael@0 8 AS_DASH_C_FLAG=$(VPX_DASH_C_FLAG)
michael@0 9 ASM_SUFFIX=$(VPX_ASM_SUFFIX)
michael@0 10
michael@0 11 ifdef VPX_ARM_ASM
michael@0 12 # Building on an ARM platform with a supported assembler, include
michael@0 13 # the optimized assembly in the build.
michael@0 14
michael@0 15 ifeq ($(OS_TARGET),Android)
michael@0 16 # For cpu-features.h
michael@0 17 LOCAL_INCLUDES += -I$(ANDROID_NDK)/sources/android/cpufeatures
michael@0 18 endif
michael@0 19
michael@0 20 ASM_OFFSETS = vpx_scale_asm_offsets.asm vp8_asm_enc_offsets.asm
michael@0 21
michael@0 22
michael@0 23 ifdef VPX_AS_CONVERSION
michael@0 24 # The ARM asm is written in ARM RVCT syntax, but we actually build it with
michael@0 25 # gas using GNU syntax. Add some rules to perform the conversion.
michael@0 26
michael@0 27 GENERATED_DIRS += $(dir $(ASFILES))
michael@0 28
michael@0 29 %.asm.$(ASM_SUFFIX): %.asm $(ASM_OFFSETS)
michael@0 30 $(VPX_AS_CONVERSION) < $< > $@
michael@0 31
michael@0 32 endif
michael@0 33 endif
michael@0 34
michael@0 35 ifdef VPX_NEED_OBJ_INT_EXTRACT
michael@0 36
michael@0 37 # We don't have a compiler that supports a compatible inline asm syntax, so we
michael@0 38 # have to resort to extracting asm offsets from a compiled object. This only
michael@0 39 # works if we have the appropriate system headers obj_int_extract needs to
michael@0 40 # parse that format, and so only has limited support for cross-compilation.
michael@0 41
michael@0 42 ifdef VPX_ARM_ASM
michael@0 43 VPX_OIE_FORMAT := rvds
michael@0 44 else
michael@0 45 VPX_OIE_FORMAT := gas
michael@0 46 endif
michael@0 47
michael@0 48 GARBAGE += vpx_scale_asm_offsets.$(OBJ_SUFFIX) vpx_scale_asm_offsets.asm
michael@0 49 GARBAGE += vp8_asm_enc_offsets.$(OBJ_SUFFIX) vp8_asm_enc_offsets.asm
michael@0 50
michael@0 51 else
michael@0 52
michael@0 53 # We can extract the asm offsets directly from generated assembly using inline
michael@0 54 # asm. This is the preferred method. However we need to strip out CFLAGS that
michael@0 55 # cause LTO because then the resulting .S file is useless.
michael@0 56
michael@0 57 vpx_scale_asm_offsets.s: CFLAGS := -DINLINE_ASM
michael@0 58
michael@0 59 OFFSET_PATTERN := '^[a-zA-Z0-9_]* EQU'
michael@0 60
michael@0 61 # This rule, as well as the rule for vp8_asm_enc_offsets.s further below are here
michael@0 62 # because the generic rule in rules.mk was made to not be implicit, and we
michael@0 63 # can't put the C files in CSRCS.
michael@0 64 vpx_scale_asm_offsets.s: $(srcdir)/vpx_scale/vpx_scale_asm_offsets.c
michael@0 65 $(REPORT_BUILD)
michael@0 66 $(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
michael@0 67
michael@0 68 vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.s
michael@0 69 grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
michael@0 70 $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
michael@0 71
michael@0 72 GARBAGE += vpx_scale_asm_offsets.s vpx_scale_asm_offsets.asm
michael@0 73
michael@0 74 vp8_asm_enc_offsets.s: CFLAGS := -DINLINE_ASM
michael@0 75
michael@0 76 vp8_asm_enc_offsets.s: $(srcdir)/vp8/encoder/vp8_asm_enc_offsets.c
michael@0 77 $(REPORT_BUILD)
michael@0 78 $(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
michael@0 79
michael@0 80 vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.s
michael@0 81 grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
michael@0 82 $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
michael@0 83
michael@0 84 GARBAGE += vp8_asm_enc_offsets.s vp8_asm_enc_offsets.asm
michael@0 85
michael@0 86 endif
michael@0 87
michael@0 88 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
michael@0 89
michael@0 90 include $(topsrcdir)/config/rules.mk
michael@0 91
michael@0 92 quantize_sse4.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
michael@0 93 quantize_ssse3.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
michael@0 94
michael@0 95 ifdef VPX_NEED_OBJ_INT_EXTRACT
michael@0 96
michael@0 97 vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
michael@0 98 ./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
michael@0 99 $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
michael@0 100
michael@0 101 # Filter out this object, because we don't want to link against it.
michael@0 102 # It was generated solely so it could be parsed by obj_int_extract.
michael@0 103 OBJS := $(filter-out vpx_scale_asm_offsets.$(OBJ_SUFFIX),$(OBJS))
michael@0 104
michael@0 105 vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
michael@0 106 ./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
michael@0 107 $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
michael@0 108
michael@0 109 # Filter out this object, because we don't want to link against it.
michael@0 110 # It was generated solely so it could be parsed by obj_int_extract.
michael@0 111 OBJS := $(filter-out vp8_asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS))
michael@0 112
michael@0 113 endif
michael@0 114
michael@0 115 # Workaround a bug of Sun Studio (CR 6963410)
michael@0 116 ifdef SOLARIS_SUNPRO_CC
michael@0 117 ifeq (86,$(findstring 86,$(OS_TEST)))
michael@0 118 filter.o: filter.c Makefile.in
michael@0 119 $(REPORT_BUILD)
michael@0 120 @$(MAKE_DEPS_AUTO_CC)
michael@0 121 $(CC) -o $@ -c $(patsubst -xO[45],-xO3,$(COMPILE_CFLAGS)) $<
michael@0 122 endif
michael@0 123 endif

mercurial