media/libopus/moz.build

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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 EXPORTS.opus += [
michael@0 8 'include/opus.h',
michael@0 9 'include/opus_defines.h',
michael@0 10 'include/opus_multistream.h',
michael@0 11 'include/opus_types.h',
michael@0 12 ]
michael@0 13
michael@0 14 MSVC_ENABLE_PGO = True
michael@0 15
michael@0 16 FINAL_LIBRARY = 'gkmedias'
michael@0 17
michael@0 18 DEFINES['OPUS_BUILD'] = True
michael@0 19 DEFINES['OPUS_VERSION'] = '"v1.1-mozilla"'
michael@0 20 DEFINES['USE_ALLOCA'] = True
michael@0 21
michael@0 22 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
michael@0 23 DEFINES['OPUS_ARM_ASM'] = True
michael@0 24 DEFINES['OPUS_ARM_EXTERNAL_ASM'] = True
michael@0 25 DEFINES['OPUS_ARM_INLINE_ASM'] = True
michael@0 26 DEFINES['OPUS_ARM_INLINE_EDSP'] = True
michael@0 27 DEFINES['OPUS_ARM_MAY_HAVE_EDSP'] = True
michael@0 28 DEFINES['OPUS_ARM_MAY_HAVE_MEDIA'] = True
michael@0 29 DEFINES['OPUS_ARM_MAY_HAVE_NEON'] = True
michael@0 30
michael@0 31 if CONFIG['MOZ_DEBUG']:
michael@0 32 DEFINES['ENABLE_ASSERTIONS'] = True
michael@0 33
michael@0 34 if CONFIG['OS_ARCH'] in ('Linux', 'Darwin', 'DragonFly', 'FreeBSD',
michael@0 35 'NetBSD', 'OpenBSD'):
michael@0 36 DEFINES['HAVE_LRINTF'] = True
michael@0 37
michael@0 38 if CONFIG['OS_ARCH'] == 'WINNT':
michael@0 39 DEFINES['inline'] = '__inline'
michael@0 40 if CONFIG['GNU_CC']:
michael@0 41 DEFINES['HAVE_LRINTF'] = True
michael@0 42
michael@0 43 if CONFIG['OS_ARCH'] == 'AIX':
michael@0 44 DEFINES['alloca'] = '__alloca'
michael@0 45
michael@0 46 if CONFIG['OS_ARCH'] == 'SunOS':
michael@0 47 DEFINES['HAVE_ALLOCA_H'] = True
michael@0 48
michael@0 49 if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
michael@0 50 DEFINES['FIXED_POINT'] = 1
michael@0 51 DEFINES['DISABLE_FLOAT_API'] = True
michael@0 52
michael@0 53 LOCAL_INCLUDES += [
michael@0 54 'celt',
michael@0 55 'include',
michael@0 56 'silk',
michael@0 57 'src',
michael@0 58 ]
michael@0 59
michael@0 60 # sources.mozbuild is generated from gen-sources.py when a new libopus is
michael@0 61 # imported.
michael@0 62 include('sources.mozbuild')
michael@0 63
michael@0 64 SOURCES += celt_sources
michael@0 65 SOURCES += silk_sources
michael@0 66 SOURCES += opus_sources
michael@0 67
michael@0 68 if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
michael@0 69 LOCAL_INCLUDES += [
michael@0 70 'silk/float',
michael@0 71 ]
michael@0 72 SOURCES += silk_sources_float
michael@0 73 SOURCES += opus_sources_float
michael@0 74 else:
michael@0 75 LOCAL_INCLUDES += [
michael@0 76 'silk/fixed',
michael@0 77 ]
michael@0 78 SOURCES += silk_sources_fixed
michael@0 79
michael@0 80 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
michael@0 81 SOURCES += celt_sources_arm
michael@0 82 GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
michael@0 83 'celt_pitch_xcorr_arm-gnu',
michael@0 84 ]]
michael@0 85 # -Os is significantly slower, enable -O3 unless optimization is disabled
michael@0 86 if CONFIG['MOZ_OPTIMIZE']:
michael@0 87 CFLAGS += [
michael@0 88 '-O3',
michael@0 89 ]
michael@0 90 CXXFLAGS += [
michael@0 91 '-O3',
michael@0 92 ]
michael@0 93
michael@0 94 # Suppress warnings in third-party code.
michael@0 95 if CONFIG['GNU_CC']:
michael@0 96 CFLAGS += ['-Wno-declaration-after-statement']
michael@0 97 if CONFIG['CLANG_CXX']:
michael@0 98 CFLAGS += ['-Wno-\#pragma-messages']

mercurial