media/libopus/moz.build

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/libopus/moz.build	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,98 @@
     1.4 +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
     1.5 +# vim: set filetype=python:
     1.6 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.9 +
    1.10 +EXPORTS.opus += [
    1.11 +    'include/opus.h',
    1.12 +    'include/opus_defines.h',
    1.13 +    'include/opus_multistream.h',
    1.14 +    'include/opus_types.h',
    1.15 +]
    1.16 +
    1.17 +MSVC_ENABLE_PGO = True
    1.18 +
    1.19 +FINAL_LIBRARY = 'gkmedias'
    1.20 +
    1.21 +DEFINES['OPUS_BUILD'] = True
    1.22 +DEFINES['OPUS_VERSION'] = '"v1.1-mozilla"'
    1.23 +DEFINES['USE_ALLOCA'] = True
    1.24 +
    1.25 +if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
    1.26 +    DEFINES['OPUS_ARM_ASM'] = True
    1.27 +    DEFINES['OPUS_ARM_EXTERNAL_ASM'] = True
    1.28 +    DEFINES['OPUS_ARM_INLINE_ASM'] = True
    1.29 +    DEFINES['OPUS_ARM_INLINE_EDSP'] = True
    1.30 +    DEFINES['OPUS_ARM_MAY_HAVE_EDSP'] = True
    1.31 +    DEFINES['OPUS_ARM_MAY_HAVE_MEDIA'] = True
    1.32 +    DEFINES['OPUS_ARM_MAY_HAVE_NEON'] = True
    1.33 +
    1.34 +if CONFIG['MOZ_DEBUG']:
    1.35 +    DEFINES['ENABLE_ASSERTIONS'] = True
    1.36 +
    1.37 +if CONFIG['OS_ARCH'] in ('Linux', 'Darwin', 'DragonFly', 'FreeBSD',
    1.38 +                         'NetBSD', 'OpenBSD'):
    1.39 +    DEFINES['HAVE_LRINTF'] = True
    1.40 +
    1.41 +if CONFIG['OS_ARCH'] == 'WINNT':
    1.42 +    DEFINES['inline'] = '__inline'
    1.43 +    if CONFIG['GNU_CC']:
    1.44 +        DEFINES['HAVE_LRINTF'] = True
    1.45 +
    1.46 +if CONFIG['OS_ARCH'] == 'AIX':
    1.47 +    DEFINES['alloca'] = '__alloca'
    1.48 +
    1.49 +if CONFIG['OS_ARCH'] == 'SunOS':
    1.50 +    DEFINES['HAVE_ALLOCA_H'] = True
    1.51 +
    1.52 +if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
    1.53 +    DEFINES['FIXED_POINT'] = 1
    1.54 +    DEFINES['DISABLE_FLOAT_API'] = True
    1.55 +
    1.56 +LOCAL_INCLUDES += [
    1.57 +    'celt',
    1.58 +    'include',
    1.59 +    'silk',
    1.60 +    'src',
    1.61 +]
    1.62 +
    1.63 +# sources.mozbuild is generated from gen-sources.py when a new libopus is
    1.64 +# imported.
    1.65 +include('sources.mozbuild')
    1.66 +
    1.67 +SOURCES += celt_sources
    1.68 +SOURCES += silk_sources
    1.69 +SOURCES += opus_sources
    1.70 +
    1.71 +if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
    1.72 +    LOCAL_INCLUDES += [
    1.73 +        'silk/float',
    1.74 +    ]
    1.75 +    SOURCES += silk_sources_float
    1.76 +    SOURCES += opus_sources_float
    1.77 +else:
    1.78 +    LOCAL_INCLUDES += [
    1.79 +        'silk/fixed',
    1.80 +    ]
    1.81 +    SOURCES += silk_sources_fixed
    1.82 +
    1.83 +if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
    1.84 +    SOURCES += celt_sources_arm
    1.85 +    GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
    1.86 +        'celt_pitch_xcorr_arm-gnu',
    1.87 +    ]]
    1.88 +    # -Os is significantly slower, enable -O3 unless optimization is disabled
    1.89 +    if CONFIG['MOZ_OPTIMIZE']:
    1.90 +      CFLAGS += [
    1.91 +        '-O3',
    1.92 +      ]
    1.93 +      CXXFLAGS += [
    1.94 +        '-O3',
    1.95 +      ]
    1.96 +
    1.97 +# Suppress warnings in third-party code.
    1.98 +if CONFIG['GNU_CC']:
    1.99 +    CFLAGS += ['-Wno-declaration-after-statement']
   1.100 +    if CONFIG['CLANG_CXX']:
   1.101 +        CFLAGS += ['-Wno-\#pragma-messages']

mercurial