diff options
Diffstat (limited to 'libs/libopus/moz.build')
-rw-r--r-- | libs/libopus/moz.build | 63 |
1 files changed, 46 insertions, 17 deletions
diff --git a/libs/libopus/moz.build b/libs/libopus/moz.build index 6bd177cc9..a612bc664 100644 --- a/libs/libopus/moz.build +++ b/libs/libopus/moz.build @@ -1,10 +1,11 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. with Files('*'): - BUG_COMPONENT = ('Core', 'Video/Audio') + BUG_COMPONENT = ('Core', 'Audio/Video') EXPORTS.opus += [ 'include/opus.h', @@ -19,13 +20,12 @@ ALLOW_COMPILER_WARNINGS = True FINAL_LIBRARY = 'multimedia' DEFINES['OPUS_BUILD'] = True -DEFINES['OPUS_VERSION'] = '"v1.1.3-mozilla"' +DEFINES['OPUS_VERSION'] = '2654707e86cc94413998976d179b2ab4a2aa3114' DEFINES['USE_ALLOCA'] = True +DEFINES['ENABLE_HARDENING'] = True -# We only need to export symbols if we're built into libmultimedia -# instead of libxul. -if not CONFIG['GKMEDIAS_SHARED_LIBRARY']: - DEFINES['OPUS_EXPORT'] = '' +# Don't export symbols +DEFINES['OPUS_EXPORT'] = '' if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']: DEFINES['OPUS_ARM_ASM'] = True @@ -46,7 +46,7 @@ if CONFIG['OS_ARCH'] in ('Linux', 'Darwin', 'DragonFly', 'FreeBSD', if CONFIG['OS_ARCH'] == 'WINNT': DEFINES['inline'] = '__inline' - if CONFIG['GNU_CC']: + if CONFIG['CC_TYPE'] in ('clang', 'gcc'): DEFINES['HAVE_LRINTF'] = True if CONFIG['OS_ARCH'] == 'AIX': @@ -63,6 +63,8 @@ LOCAL_INCLUDES += [ 'celt', 'include', 'silk', + 'silk/fixed', + 'silk/float', 'src', ] @@ -76,18 +78,32 @@ UNIFIED_SOURCES += opus_sources SOURCES += opus_nonunified_sources if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']: - LOCAL_INCLUDES += [ - 'silk/float', - ] UNIFIED_SOURCES += silk_sources_float UNIFIED_SOURCES += opus_sources_float else: - LOCAL_INCLUDES += [ - 'silk/fixed', - ] UNIFIED_SOURCES += silk_sources_fixed -# for webrtc - UNIFIED_SOURCES += opus_sources_float + +if CONFIG['CPU_ARCH'] in ('x86', 'x86_64'): + DEFINES['OPUS_HAVE_RTCD'] = True + DEFINES['OPUS_X86_MAY_HAVE_SSE'] = True + DEFINES['OPUS_X86_MAY_HAVE_SSE2'] = True + DEFINES['OPUS_X86_MAY_HAVE_SSE4_1'] = True + DEFINES['OPUS_X86_MAY_HAVE_AVX'] = True + SOURCES += celt_sources_sse + SOURCES += celt_sources_sse2 + SOURCES += celt_sources_sse4_1 + SOURCES += silk_sources_sse4_1 + if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']: + SOURCES += silk_sources_fixed_sse4_1 + for f in SOURCES: + if f in celt_sources_sse: + SOURCES[f].flags += CONFIG['SSE_FLAGS'] + if f in celt_sources_sse2: + SOURCES[f].flags += CONFIG['SSE2_FLAGS'] + if f in celt_sources_sse4_1 or \ + f in silk_sources_sse4_1 or \ + f in silk_sources_fixed_sse4_1: + SOURCES[f].flags += ['-msse4.1'] if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']: SOURCES += celt_sources_arm @@ -109,7 +125,20 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']: ] ASFLAGS += CONFIG['NEON_FLAGS'] +if CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): + DEFINES['OPUS_ARM_PRESUME_AARCH64_NEON_INTR'] = True + DEFINES['OPUS_ARM_PRESUME_NEON'] = True + DEFINES['OPUS_ARM_PRESUME_NEON_INTR'] = True + SOURCES += celt_sources_arm_neon_intr + SOURCES += silk_sources_arm_neon_intr + if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']: + DEFINES['OPUS_ARM_MAY_HAVE_NEON'] = True + DEFINES['OPUS_ARM_MAY_HAVE_NEON_INTR'] = True + else: + SOURCES += silk_sources_fixed_arm_neon_intr + # Suppress warnings in third-party code. -if CONFIG['GNU_CC']: - if CONFIG['CLANG_CXX']: +if CONFIG['CC_TYPE'] in ('clang', 'gcc'): + if CONFIG['CC_TYPE'] == 'clang': CFLAGS += ['-Wno-#pragma-messages'] + |