2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-26 00:47:22 +04:00
|
|
|
# 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/.
|
|
|
|
|
2015-03-03 22:36:00 +03:00
|
|
|
with Files('*'):
|
|
|
|
BUG_COMPONENT = ('Core', 'Video/Audio')
|
|
|
|
|
2014-11-18 20:58:00 +03:00
|
|
|
EXPORTS.theora += [
|
|
|
|
'include/theora/codec.h',
|
|
|
|
'include/theora/theoradec.h',
|
|
|
|
'include/theora/theoraenc.h',
|
|
|
|
]
|
|
|
|
|
2015-10-20 04:05:20 +03:00
|
|
|
# We allow warnings for third-party code that can be updated from upstream.
|
2015-08-28 06:44:53 +03:00
|
|
|
ALLOW_COMPILER_WARNINGS = True
|
|
|
|
|
2014-11-18 20:58:00 +03:00
|
|
|
FINAL_LIBRARY = 'gkmedias'
|
|
|
|
|
|
|
|
# The encoder is currently not included.
|
|
|
|
DEFINES['THEORA_DISABLE_ENCODE'] = True
|
|
|
|
|
|
|
|
# Suppress warnings in third-party code.
|
2015-11-06 00:05:26 +03:00
|
|
|
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
|
2014-11-18 20:58:00 +03:00
|
|
|
CFLAGS += ['-Wno-type-limits']
|
2015-11-06 00:05:26 +03:00
|
|
|
if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
|
|
|
|
CFLAGS += ['-Wno-tautological-compare']
|
|
|
|
if CONFIG['CLANG_CL']:
|
|
|
|
CFLAGS += [
|
|
|
|
'-Wno-pointer-sign',
|
|
|
|
'-Wno-shift-op-parentheses',
|
|
|
|
]
|
2014-11-18 20:58:00 +03:00
|
|
|
|
|
|
|
UNIFIED_SOURCES += [
|
|
|
|
'lib/apiwrapper.c',
|
|
|
|
'lib/bitpack.c',
|
|
|
|
'lib/decapiwrapper.c',
|
|
|
|
'lib/decinfo.c',
|
|
|
|
'lib/decode.c',
|
|
|
|
'lib/dequant.c',
|
|
|
|
'lib/fragment.c',
|
|
|
|
'lib/huffdec.c',
|
|
|
|
'lib/idct.c',
|
|
|
|
'lib/info.c',
|
|
|
|
'lib/internal.c',
|
|
|
|
'lib/quant.c',
|
|
|
|
'lib/state.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
LOCAL_INCLUDES += ['include']
|
|
|
|
|
|
|
|
if '86' in CONFIG['OS_TEST']:
|
|
|
|
if CONFIG['OS_ARCH'] != 'SunOS':
|
2016-08-26 21:30:38 +03:00
|
|
|
if CONFIG['CLANG_CL']:
|
|
|
|
# clang-cl can't handle libtheora's inline asm.
|
|
|
|
pass
|
|
|
|
elif CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
|
2014-11-18 20:58:00 +03:00
|
|
|
DEFINES['OC_X86_ASM'] = True
|
|
|
|
if '64' in CONFIG['OS_TEST']:
|
|
|
|
DEFINES['OC_X86_64_ASM'] = True
|
|
|
|
if CONFIG['_MSC_VER']:
|
2016-08-26 21:30:38 +03:00
|
|
|
if CONFIG['CLANG_CL']:
|
|
|
|
# clang-cl can't handle libtheora's inline asm.
|
|
|
|
pass
|
|
|
|
elif '64' not in CONFIG['OS_TEST']:
|
2014-11-18 20:58:00 +03:00
|
|
|
SOURCES += [
|
|
|
|
'lib/x86_vc/mmxfrag.c',
|
|
|
|
'lib/x86_vc/mmxidct.c',
|
|
|
|
'lib/x86_vc/mmxstate.c',
|
|
|
|
'lib/x86_vc/x86cpu.c',
|
|
|
|
'lib/x86_vc/x86state.c',
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
SOURCES += [
|
|
|
|
'lib/x86/mmxfrag.c',
|
|
|
|
'lib/x86/mmxidct.c',
|
|
|
|
'lib/x86/mmxstate.c',
|
|
|
|
'lib/x86/sse2idct.c',
|
|
|
|
'lib/x86/x86cpu.c',
|
|
|
|
'lib/x86/x86state.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['GNU_AS']:
|
|
|
|
if 'arm' in CONFIG['OS_TEST']:
|
|
|
|
SOURCES += [
|
|
|
|
'lib/arm/armcpu.c',
|
|
|
|
'lib/arm/armstate.c',
|
|
|
|
]
|
|
|
|
for var in ('OC_ARM_ASM',
|
|
|
|
'OC_ARM_ASM_EDSP',
|
|
|
|
'OC_ARM_ASM_MEDIA',
|
|
|
|
'OC_ARM_ASM_NEON'):
|
|
|
|
DEFINES[var] = True
|
|
|
|
# The Android NDK doesn't pre-define anything to indicate the OS it's
|
|
|
|
# on, so do it for them.
|
|
|
|
if CONFIG['OS_TARGET'] == 'Android':
|
|
|
|
DEFINES['__linux__'] = True
|
2013-03-19 22:47:00 +04:00
|
|
|
|
2016-03-01 21:47:19 +03:00
|
|
|
SOURCES += [ '!%s.s' % f for f in [
|
2015-05-08 08:13:10 +03:00
|
|
|
'armbits-gnu',
|
|
|
|
'armfrag-gnu',
|
|
|
|
'armidct-gnu',
|
|
|
|
'armloop-gnu',
|
|
|
|
]]
|
|
|
|
|
|
|
|
# These flags are a lie; they're just used to enable the requisite
|
|
|
|
# opcodes; actual arch detection is done at runtime.
|
|
|
|
ASFLAGS += [
|
|
|
|
'-march=armv7-a',
|
|
|
|
]
|
2016-09-14 12:34:19 +03:00
|
|
|
ASFLAGS += CONFIG['NEON_FLAGS']
|
2016-06-29 06:48:49 +03:00
|
|
|
|
|
|
|
if CONFIG['CLANG_CXX']:
|
|
|
|
ASFLAGS += [
|
|
|
|
'-no-integrated-as',
|
|
|
|
]
|