tenfourfox/media/libvpx/moz.build
Ken 3f33f8a6e5
Intel fixes (#608)
* ycbcr: intel assembly fixes for old gcc-as in Tiger

minor changes in assembly that are friendly to the
older gcc-as in Tiger

* libvpx/moz.build: only use force_cpusubtype_all on PPC

this flag is not accepted by the intel assembler

* libvpx: compiler/assembler fixes for intel

use clang-3.4 as the primary compiler
use yasm for the assembly

* nss: use clang-3.4 as compiler on Intel

nss contains assembly that the old gas assembler can't manage
using clang-3.4 is the easiest fix for this, as it is
already needed elsewhere for libvpx

* Intel mozconfig: update

we need to force the old gas assembler to be used
for the majority of the build as the newer clang
one will fail

* client.mk: use original which

MacPorts has a newer version of the which command
that is supposed to be more like current 'which' versions,
but there is an error in it at present and the construct
used in TFF doesn't work correctly.

Until this is fixed, use the original /usr/bin/which (and that
one can in fact be used forever, of course).
2020-06-11 15:31:09 -07:00

123 lines
3.5 KiB
Python

# -*- Mode: python; c-basic-offset: 4; 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')
include('sources.mozbuild')
EXPORTS.vpx += files['EXPORTS']
SOURCES += files['SOURCES']
if CONFIG['MOZ_VPX_ERROR_CONCEALMENT']:
SOURCES += files['ERROR_CONCEALMENT']
if CONFIG['VPX_X86_ASM']:
SOURCES += files['X86_ASM']
if '64' in CONFIG['OS_TEST']:
SOURCES += files['X86-64_ASM']
#avx2 can be enabled on all supported compilters
SOURCES += files['AVX2']
#postproc is only enabled on x86 with asm
SOURCES += files['VP8_POSTPROC']
# TenFourFox AltiVec
if CONFIG['VPX_VMX_ASM']:
SOURCES += [
'vp8/common/ppc/copy_altivec.s',
'vp8/common/ppc/filter_altivec.s',
'vp8/common/ppc/filter_bilinear_altivec.s',
'vp8/common/ppc/idctllm_altivec.s',
'vp8/common/ppc/loopfilter_altivec.c',
'vp8/common/ppc/loopfilter_filters_altivec.s',
# This might not be needed anymore.
'vp8/common/ppc/recon_altivec.s',
'vp8/common/ppc/vp8_intrinsics_vmx.c',
'vp9/common/ppc/vp9_convolve_vmx.c',
'vp9/common/ppc/vp9_idct_intrin_vmx.c',
'vp9/common/ppc/vp9_intrapred_vmx.c',
]
arm_asm_files = []
if CONFIG['VPX_ARM_ASM']:
arm_asm_files += files['ARM_ASM']
if CONFIG['VPX_AS_CONVERSION']:
SOURCES += sorted([
"!%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX'])
if f.endswith('.asm') else f
for f in sorted(arm_asm_files)
])
else:
SOURCES += sorted(arm_asm_files)
for f in SOURCES:
if f.endswith('.c') and 'neon' in f:
SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
# boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of
# using RTCD, so we have to make sure we only add one of the two.
if 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files:
SOURCES += [
'vp8/encoder/boolhuff.c',
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
FINAL_LIBRARY = 'gkmedias'
DEFINES['HAVE_CONFIG_H'] = 'vpx_config.h'
if CONFIG['OS_TARGET'] == 'Android':
# Older versions of the Android NDK don't pre-define anything to indicate
# the OS they're on, so do it for them.
DEFINES['__linux__'] = True
if not CONFIG['MOZ_WEBRTC']:
SOURCES += [
'%%%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
]
if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']:
for f in SOURCES:
if f.endswith('.c'):
if 'sse2' in f:
SOURCES[f].flags += CONFIG['SSE2_FLAGS']
if 'ssse3' in f:
SOURCES[f].flags += ['-mssse3']
if 'sse4' in f:
SOURCES[f].flags += ['-msse4.1']
if 'avx2' in f:
SOURCES[f].flags += ['-mavx2']
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
CFLAGS += ['-Wno-sign-compare']
ASFLAGS += CONFIG['VPX_ASFLAGS']
ASFLAGS += [
'-I.',
'-I%s/media/libvpx/' % TOPSRCDIR,
'-I%s/media/libvpx/vpx_ports/' % TOPSRCDIR,
]
# moved from Makefile.in for TenFourFox
# this only works on gcc-as (ie PPC)
if not '86' in CONFIG['OS_TEST']:
ASFLAGS += ['-force_cpusubtype_ALL']
if CONFIG['OS_TARGET'] == 'Android':
# For LIBVPX_RAND
ASFLAGS += [
'-D__ANDROID__'
]