media/libvpx/moz.build

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 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
michael@0 2 # vim: set filetype=python:
michael@0 3 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6
michael@0 7 include('sources.mozbuild')
michael@0 8
michael@0 9 EXPORTS.vpx += files['EXPORTS']
michael@0 10
michael@0 11 if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
michael@0 12 HOST_SOURCES += [
michael@0 13 'build/make/obj_int_extract.c',
michael@0 14 ]
michael@0 15
michael@0 16 HOST_PROGRAM = 'host_obj_int_extract'
michael@0 17
michael@0 18 # Unify fewer files together to reduce the chance of name collision
michael@0 19 FILES_PER_UNIFIED_FILE = 8
michael@0 20
michael@0 21 SOURCES += files['SOURCES']
michael@0 22 UNIFIED_SOURCES += files['UNIFIED_SOURCES']
michael@0 23
michael@0 24 if CONFIG['MOZ_VPX_ERROR_CONCEALMENT']:
michael@0 25 SOURCES += files['ERROR_CONCEALMENT']
michael@0 26
michael@0 27 if CONFIG['VPX_X86_ASM'] and CONFIG['OS_TARGET'] == 'WINNT':
michael@0 28 offset_sources = [
michael@0 29 'vp8/encoder/vp8_asm_enc_offsets.c',
michael@0 30 'vpx_scale/vpx_scale_asm_offsets.c',
michael@0 31 ]
michael@0 32 SOURCES += offset_sources
michael@0 33 if CONFIG['_MSC_VER']:
michael@0 34 for s in offset_sources:
michael@0 35 SOURCES[s].no_pgo = True
michael@0 36
michael@0 37 if CONFIG['VPX_X86_ASM']:
michael@0 38 SOURCES += files['X86_ASM']
michael@0 39
michael@0 40 if '64' in CONFIG['OS_TEST']:
michael@0 41 SOURCES += files['X86-64_ASM']
michael@0 42
michael@0 43 # AVX2 only supported on
michael@0 44 # Darwin toolchain right now
michael@0 45 if CONFIG['OS_TARGET'] == 'Darwin':
michael@0 46 SOURCES += files['AVX2']
michael@0 47
michael@0 48 #postproc is only enabled on x86 with asm
michael@0 49 SOURCES += files['VP8_POSTPROC']
michael@0 50
michael@0 51 arm_asm_files = []
michael@0 52 if CONFIG['VPX_ARM_ASM']:
michael@0 53 arm_asm_files += files['ARM_ASM']
michael@0 54
michael@0 55 if CONFIG['VPX_AS_CONVERSION']:
michael@0 56 GENERATED_SOURCES += [ "%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX'])
michael@0 57 for f in sorted(arm_asm_files) if f.endswith('.asm')
michael@0 58 ]
michael@0 59 SOURCES += [
michael@0 60 f for f in sorted(arm_asm_files) if not f.endswith('.asm')
michael@0 61 ]
michael@0 62 else:
michael@0 63 SOURCES += sorted(arm_asm_files)
michael@0 64
michael@0 65 # boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of
michael@0 66 # using RTCD, so we have to make sure we only add one of the two.
michael@0 67 if 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files:
michael@0 68 SOURCES += [
michael@0 69 'vp8/encoder/boolhuff.c',
michael@0 70 ]
michael@0 71
michael@0 72 MSVC_ENABLE_PGO = True
michael@0 73
michael@0 74 if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
michael@0 75 NO_VISIBILITY_FLAGS = True
michael@0 76
michael@0 77 FINAL_LIBRARY = 'gkmedias'
michael@0 78
michael@0 79 DEFINES['HAVE_CONFIG_H'] = 'vpx_config.h'
michael@0 80
michael@0 81 if CONFIG['OS_TARGET'] == 'Android':
michael@0 82 # Older versions of the Android NDK don't pre-define anything to indicate
michael@0 83 # the OS they're on, so do it for them.
michael@0 84 DEFINES['__linux__'] = True
michael@0 85
michael@0 86 if not CONFIG['MOZ_WEBRTC']:
michael@0 87 SOURCES += [
michael@0 88 '%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
michael@0 89 ]
michael@0 90
michael@0 91 if not CONFIG['_MSC_VER']:
michael@0 92 for f in SOURCES:
michael@0 93 if f.endswith('.c'):
michael@0 94 if 'sse2' in f:
michael@0 95 SOURCES[f].flags += CONFIG['SSE2_FLAGS']
michael@0 96 if 'ssse3' in f:
michael@0 97 SOURCES[f].flags += ['-mssse3']
michael@0 98 if 'avx2' in f:
michael@0 99 SOURCES[f].flags += ['-mavx2']
michael@0 100
michael@0 101 # Suppress warnings in third-party code.
michael@0 102 if CONFIG['GNU_CC']:
michael@0 103 CFLAGS += ['-Wno-sign-compare']

mercurial