Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 EXPORTS.opus += [
8 'include/opus.h',
9 'include/opus_defines.h',
10 'include/opus_multistream.h',
11 'include/opus_types.h',
12 ]
14 MSVC_ENABLE_PGO = True
16 FINAL_LIBRARY = 'gkmedias'
18 DEFINES['OPUS_BUILD'] = True
19 DEFINES['OPUS_VERSION'] = '"v1.1-mozilla"'
20 DEFINES['USE_ALLOCA'] = True
22 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
23 DEFINES['OPUS_ARM_ASM'] = True
24 DEFINES['OPUS_ARM_EXTERNAL_ASM'] = True
25 DEFINES['OPUS_ARM_INLINE_ASM'] = True
26 DEFINES['OPUS_ARM_INLINE_EDSP'] = True
27 DEFINES['OPUS_ARM_MAY_HAVE_EDSP'] = True
28 DEFINES['OPUS_ARM_MAY_HAVE_MEDIA'] = True
29 DEFINES['OPUS_ARM_MAY_HAVE_NEON'] = True
31 if CONFIG['MOZ_DEBUG']:
32 DEFINES['ENABLE_ASSERTIONS'] = True
34 if CONFIG['OS_ARCH'] in ('Linux', 'Darwin', 'DragonFly', 'FreeBSD',
35 'NetBSD', 'OpenBSD'):
36 DEFINES['HAVE_LRINTF'] = True
38 if CONFIG['OS_ARCH'] == 'WINNT':
39 DEFINES['inline'] = '__inline'
40 if CONFIG['GNU_CC']:
41 DEFINES['HAVE_LRINTF'] = True
43 if CONFIG['OS_ARCH'] == 'AIX':
44 DEFINES['alloca'] = '__alloca'
46 if CONFIG['OS_ARCH'] == 'SunOS':
47 DEFINES['HAVE_ALLOCA_H'] = True
49 if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
50 DEFINES['FIXED_POINT'] = 1
51 DEFINES['DISABLE_FLOAT_API'] = True
53 LOCAL_INCLUDES += [
54 'celt',
55 'include',
56 'silk',
57 'src',
58 ]
60 # sources.mozbuild is generated from gen-sources.py when a new libopus is
61 # imported.
62 include('sources.mozbuild')
64 SOURCES += celt_sources
65 SOURCES += silk_sources
66 SOURCES += opus_sources
68 if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
69 LOCAL_INCLUDES += [
70 'silk/float',
71 ]
72 SOURCES += silk_sources_float
73 SOURCES += opus_sources_float
74 else:
75 LOCAL_INCLUDES += [
76 'silk/fixed',
77 ]
78 SOURCES += silk_sources_fixed
80 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
81 SOURCES += celt_sources_arm
82 GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
83 'celt_pitch_xcorr_arm-gnu',
84 ]]
85 # -Os is significantly slower, enable -O3 unless optimization is disabled
86 if CONFIG['MOZ_OPTIMIZE']:
87 CFLAGS += [
88 '-O3',
89 ]
90 CXXFLAGS += [
91 '-O3',
92 ]
94 # Suppress warnings in third-party code.
95 if CONFIG['GNU_CC']:
96 CFLAGS += ['-Wno-declaration-after-statement']
97 if CONFIG['CLANG_CXX']:
98 CFLAGS += ['-Wno-\#pragma-messages']