Thu, 15 Jan 2015 15:59:08 +0100
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.
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 gyp_vars = {
8 'build_with_mozilla': 1,
9 'build_with_chromium': 0,
10 'use_official_google_api_keys': 0,
11 'have_clock_monotonic': 1 if CONFIG['HAVE_CLOCK_MONOTONIC'] else 0,
12 'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0,
13 'include_alsa_audio': 1 if CONFIG['MOZ_ALSA'] else 0,
14 'include_pulse_audio': 1 if CONFIG['MOZ_PULSEAUDIO'] else 0,
15 # basic stuff for everything
16 'include_internal_video_render': 0,
17 'clang_use_chrome_plugins': 0,
18 'enable_protobuf': 0,
19 'include_tests': 0,
20 'enable_android_opensl': 1,
21 'enable_android_opensl_output': 0,
22 # use_system_lib* still seems to be in use in trunk/build
23 'use_system_libjpeg': 0,
24 'use_system_libvpx': 0,
25 'build_libjpeg': 0,
26 'build_libvpx': 0,
27 'build_libyuv': 0,
28 'libyuv_dir': '/media/libyuv',
29 'yuv_disable_avx2': 0 if CONFIG['HAVE_X86_AVX2'] else 1,
31 # saves 4MB when webrtc_trace is off
32 'enable_lazy_trace_alloc': 1,
34 # turn off mandatory use of NEON and instead use NEON detection
35 'arm_neon': 0,
36 'arm_neon_optional': 1,
38 'moz_widget_toolkit_gonk': 0,
39 'moz_webrtc_omx': 0,
41 # (for vp8) chromium sets to 0 also
42 'use_temporal_layers': 0,
43 # Creates AEC internal sample dump files in current directory
44 # 'aec_debug_dump': 1,
46 # codec enable/disables:
47 'include_g711': 1,
48 'include_opus': 1,
49 'include_g722': 0,
50 'include_ilbc': 0,
51 'include_isac': 0,
52 'include_pcm16b': 1,
53 }
55 os = CONFIG['OS_TARGET']
57 if os == 'WINNT':
58 gyp_vars.update(
59 MSVS_VERSION=CONFIG['_MSVS_VERSION'],
60 MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_OS'] else 32,
61 )
62 elif os == 'Android':
63 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
64 gyp_vars['build_with_gonk'] = 1
65 gyp_vars['moz_widget_toolkit_gonk'] = 1
66 if int(CONFIG['ANDROID_VERSION']) >= 18:
67 gyp_vars['moz_webrtc_omx'] = 1
68 else:
69 gyp_vars.update(
70 gtest_target_type='executable',
71 android_toolchain=CONFIG['ANDROID_TOOLCHAIN'],
72 )
74 flavors = {
75 'WINNT': 'win',
76 'Android': 'linux' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' else 'android',
77 'Linux': 'linux',
78 'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
79 'SunOS': 'solaris',
80 'GNU/kFreeBSD': 'freebsd',
81 'DragonFly': 'dragonfly',
82 'FreeBSD': 'freebsd',
83 'NetBSD': 'netbsd',
84 'OpenBSD': 'openbsd',
85 }
86 gyp_vars['OS'] = flavors[os]
88 arches = {
89 'x86_64': 'x64',
90 'x86': 'ia32',
91 }
93 gyp_vars['target_arch'] = arches.get(CONFIG['CPU_ARCH'], CONFIG['CPU_ARCH'])
95 if CONFIG['ARM_ARCH']:
96 if int(CONFIG['ARM_ARCH']) < 7:
97 gyp_vars['armv7'] = 0
98 gyp_vars['arm_neon_optional'] = 0
99 elif os == 'Android':
100 gyp_vars['armv7'] = 1
101 else:
102 # CPU detection for ARM works on Android only. armv7 always uses CPU
103 # detection, so we have to set armv7=0 for non-Android target
104 gyp_vars['armv7'] = 0
105 # For libyuv
106 gyp_vars['arm_version'] = CONFIG['ARM_ARCH']
108 # Don't try to compile ssse3/sse4.1 code if toolchain doesn't support
109 if CONFIG['INTEL_ARCHITECTURE']:
110 if not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] or not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1']:
111 gyp_vars['yuv_disable_asm'] = 1
113 if CONFIG['MACOS_SDK_DIR']:
114 gyp_vars['mac_sdk_path'] = CONFIG['MACOS_SDK_DIR']