michael@0: # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- michael@0: # vim: set filetype=python: michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: EXPORTS.opus += [ michael@0: 'include/opus.h', michael@0: 'include/opus_defines.h', michael@0: 'include/opus_multistream.h', michael@0: 'include/opus_types.h', michael@0: ] michael@0: michael@0: MSVC_ENABLE_PGO = True michael@0: michael@0: FINAL_LIBRARY = 'gkmedias' michael@0: michael@0: DEFINES['OPUS_BUILD'] = True michael@0: DEFINES['OPUS_VERSION'] = '"v1.1-mozilla"' michael@0: DEFINES['USE_ALLOCA'] = True michael@0: michael@0: if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']: michael@0: DEFINES['OPUS_ARM_ASM'] = True michael@0: DEFINES['OPUS_ARM_EXTERNAL_ASM'] = True michael@0: DEFINES['OPUS_ARM_INLINE_ASM'] = True michael@0: DEFINES['OPUS_ARM_INLINE_EDSP'] = True michael@0: DEFINES['OPUS_ARM_MAY_HAVE_EDSP'] = True michael@0: DEFINES['OPUS_ARM_MAY_HAVE_MEDIA'] = True michael@0: DEFINES['OPUS_ARM_MAY_HAVE_NEON'] = True michael@0: michael@0: if CONFIG['MOZ_DEBUG']: michael@0: DEFINES['ENABLE_ASSERTIONS'] = True michael@0: michael@0: if CONFIG['OS_ARCH'] in ('Linux', 'Darwin', 'DragonFly', 'FreeBSD', michael@0: 'NetBSD', 'OpenBSD'): michael@0: DEFINES['HAVE_LRINTF'] = True michael@0: michael@0: if CONFIG['OS_ARCH'] == 'WINNT': michael@0: DEFINES['inline'] = '__inline' michael@0: if CONFIG['GNU_CC']: michael@0: DEFINES['HAVE_LRINTF'] = True michael@0: michael@0: if CONFIG['OS_ARCH'] == 'AIX': michael@0: DEFINES['alloca'] = '__alloca' michael@0: michael@0: if CONFIG['OS_ARCH'] == 'SunOS': michael@0: DEFINES['HAVE_ALLOCA_H'] = True michael@0: michael@0: if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']: michael@0: DEFINES['FIXED_POINT'] = 1 michael@0: DEFINES['DISABLE_FLOAT_API'] = True michael@0: michael@0: LOCAL_INCLUDES += [ michael@0: 'celt', michael@0: 'include', michael@0: 'silk', michael@0: 'src', michael@0: ] michael@0: michael@0: # sources.mozbuild is generated from gen-sources.py when a new libopus is michael@0: # imported. michael@0: include('sources.mozbuild') michael@0: michael@0: SOURCES += celt_sources michael@0: SOURCES += silk_sources michael@0: SOURCES += opus_sources michael@0: michael@0: if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']: michael@0: LOCAL_INCLUDES += [ michael@0: 'silk/float', michael@0: ] michael@0: SOURCES += silk_sources_float michael@0: SOURCES += opus_sources_float michael@0: else: michael@0: LOCAL_INCLUDES += [ michael@0: 'silk/fixed', michael@0: ] michael@0: SOURCES += silk_sources_fixed michael@0: michael@0: if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']: michael@0: SOURCES += celt_sources_arm michael@0: GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [ michael@0: 'celt_pitch_xcorr_arm-gnu', michael@0: ]] michael@0: # -Os is significantly slower, enable -O3 unless optimization is disabled michael@0: if CONFIG['MOZ_OPTIMIZE']: michael@0: CFLAGS += [ michael@0: '-O3', michael@0: ] michael@0: CXXFLAGS += [ michael@0: '-O3', michael@0: ] michael@0: michael@0: # Suppress warnings in third-party code. michael@0: if CONFIG['GNU_CC']: michael@0: CFLAGS += ['-Wno-declaration-after-statement'] michael@0: if CONFIG['CLANG_CXX']: michael@0: CFLAGS += ['-Wno-\#pragma-messages']