gecko-dev/media/libjpeg/moz.build

324 строки
10 KiB
Python

# -*- 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", "ImageLib")
EXPORTS += [
'jconfig.h',
'jerror.h',
'jinclude.h',
'jmorecfg.h',
'jpegint.h',
'jpeglib.h',
]
SOURCES += [
'jcomapi.c',
'jdapimin.c',
'jdapistd.c',
'jdatadst.c',
'jdatasrc.c',
'jdcoefct.c',
'jdcolor.c',
'jddctmgr.c',
'jdhuff.c',
'jdicc.c',
'jdinput.c',
'jdmainct.c',
'jdmarker.c',
'jdmaster.c',
'jdmerge.c',
'jdphuff.c',
'jdpostct.c',
'jdsample.c',
'jdtrans.c',
'jerror.c',
'jfdctflt.c',
'jfdctfst.c',
'jfdctint.c',
'jidctflt.c',
'jidctfst.c',
'jidctint.c',
'jidctred.c',
'jmemmgr.c',
'jmemnobs.c',
'jquant1.c',
'jquant2.c',
'jutils.c',
]
# These files enable support for writing JPEGs
SOURCES += [
'jcapimin.c',
'jcapistd.c',
'jccoefct.c',
'jccolor.c',
'jcdctmgr.c',
'jchuff.c',
'jcicc.c',
'jcinit.c',
'jcmainct.c',
'jcmarker.c',
'jcmaster.c',
'jcparam.c',
'jcphuff.c',
'jcprepct.c',
'jcsample.c',
'jctrans.c',
]
if CONFIG['LIBJPEG_TURBO_HAVE_VLD1_S16_X3']:
DEFINES['HAVE_VLD1_S16_X3'] = True
if CONFIG['LIBJPEG_TURBO_HAVE_VLD1_U16_X2']:
DEFINES['HAVE_VLD1_U16_X2'] = True
if CONFIG['LIBJPEG_TURBO_HAVE_VLD1Q_U8_X4']:
DEFINES['HAVE_VLD1Q_U8_X4'] = True
if CONFIG['LIBJPEG_TURBO_NEON_INTRINSICS']:
DEFINES['NEON_INTRINSICS'] = True
if CONFIG['LIBJPEG_TURBO_USE_NASM']:
USE_NASM = True
if CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']:
if CONFIG['CPU_ARCH'] == 'arm':
LOCAL_INCLUDES += [
'/media/libjpeg/simd/arm',
'/media/libjpeg/simd/arm/aarch32',
]
SOURCES += [
'simd/arm/aarch32/jsimd.c',
]
simd_sources = [
'simd/arm/aarch32/jchuff-neon.c',
'simd/arm/jcgray-neon.c',
'simd/arm/jcphuff-neon.c',
'simd/arm/jcsample-neon.c',
'simd/arm/jdcolor-neon.c',
'simd/arm/jdmerge-neon.c',
'simd/arm/jdsample-neon.c',
'simd/arm/jfdctfst-neon.c',
'simd/arm/jfdctint-neon.c',
'simd/arm/jidctred-neon.c',
'simd/arm/jquanti-neon.c',
]
SOURCES += simd_sources
if CONFIG['LIBJPEG_TURBO_NEON_INTRINSICS']:
simd_sources_intrinsics = [
'simd/arm/jccolor-neon.c',
'simd/arm/jidctfst-neon.c',
'simd/arm/jidctint-neon.c',
]
SOURCES += simd_sources_intrinsics
simd_sources += simd_sources_intrinsics
else:
SOURCES += [
'simd/arm/aarch32/jsimd_neon.S',
]
for srcfile in simd_sources:
SOURCES[srcfile].flags += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
elif CONFIG['CPU_ARCH'] == 'aarch64':
LOCAL_INCLUDES += [
'/media/libjpeg/simd/arm',
'/media/libjpeg/simd/arm/aarch64',
]
SOURCES += [
'simd/arm/aarch64/jsimd.c',
]
simd_sources = [
'simd/arm/jcgray-neon.c',
'simd/arm/jcphuff-neon.c',
'simd/arm/jcsample-neon.c',
'simd/arm/jdmerge-neon.c',
'simd/arm/jdsample-neon.c',
'simd/arm/jfdctfst-neon.c',
'simd/arm/jidctfst-neon.c',
'simd/arm/jidctred-neon.c',
'simd/arm/jquanti-neon.c',
]
SOURCES += simd_sources
if CONFIG['LIBJPEG_TURBO_NEON_INTRINSICS']:
simd_sources_intrinsics = [
'simd/arm/aarch64/jchuff-neon.c',
'simd/arm/jccolor-neon.c',
'simd/arm/jdcolor-neon.c',
'simd/arm/jfdctint-neon.c',
'simd/arm/jidctint-neon.c',
]
SOURCES += simd_sources_intrinsics
simd_sources += simd_sources_intrinsics
else:
SOURCES += [
'simd/arm/aarch64/jsimd_neon.S',
]
for srcfile in simd_sources:
SOURCES[srcfile].flags += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
elif CONFIG['CPU_ARCH'] == 'mips32':
SOURCES += [
'simd/mips/jsimd.c',
'simd/mips/jsimd_dspr2.S',
]
if CONFIG['CC_TYPE'] == 'clang':
SOURCES['simd/mips/jsimd_dspr2.S'].flags += [
'-fno-integrated-as',
]
elif CONFIG['CPU_ARCH'] == 'mips64':
LOCAL_INCLUDES += ['/media/libjpeg/simd/mips64']
simd_sources = [
'simd/mips64/jccolor-mmi.c',
'simd/mips64/jcgray-mmi.c',
'simd/mips64/jcsample-mmi.c',
'simd/mips64/jdcolor-mmi.c',
'simd/mips64/jdmerge-mmi.c',
'simd/mips64/jdsample-mmi.c',
'simd/mips64/jfdctfst-mmi.c',
'simd/mips64/jfdctint-mmi.c',
'simd/mips64/jidctfst-mmi.c',
'simd/mips64/jidctint-mmi.c',
'simd/mips64/jquanti-mmi.c',
]
SOURCES += simd_sources
SOURCES += [
'simd/mips64/jsimd.c'
]
for srcfile in simd_sources:
SOURCES[srcfile].flags += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
elif CONFIG['CPU_ARCH'] == 'x86_64':
SOURCES += [
'simd/x86_64/jccolor-avx2.asm',
'simd/x86_64/jccolor-sse2.asm',
'simd/x86_64/jcgray-avx2.asm',
'simd/x86_64/jcgray-sse2.asm',
'simd/x86_64/jchuff-sse2.asm',
'simd/x86_64/jcphuff-sse2.asm',
'simd/x86_64/jcsample-avx2.asm',
'simd/x86_64/jcsample-sse2.asm',
'simd/x86_64/jdcolor-avx2.asm',
'simd/x86_64/jdcolor-sse2.asm',
'simd/x86_64/jdmerge-avx2.asm',
'simd/x86_64/jdmerge-sse2.asm',
'simd/x86_64/jdsample-avx2.asm',
'simd/x86_64/jdsample-sse2.asm',
'simd/x86_64/jfdctflt-sse.asm',
'simd/x86_64/jfdctfst-sse2.asm',
'simd/x86_64/jfdctint-avx2.asm',
'simd/x86_64/jfdctint-sse2.asm',
'simd/x86_64/jidctflt-sse2.asm',
'simd/x86_64/jidctfst-sse2.asm',
'simd/x86_64/jidctint-avx2.asm',
'simd/x86_64/jidctint-sse2.asm',
'simd/x86_64/jidctred-sse2.asm',
'simd/x86_64/jquantf-sse2.asm',
'simd/x86_64/jquanti-avx2.asm',
'simd/x86_64/jquanti-sse2.asm',
'simd/x86_64/jsimd.c',
'simd/x86_64/jsimdcpu.asm',
]
elif CONFIG['CPU_ARCH'] == 'x86':
SOURCES += [
'simd/i386/jccolor-avx2.asm',
'simd/i386/jccolor-mmx.asm',
'simd/i386/jccolor-sse2.asm',
'simd/i386/jcgray-avx2.asm',
'simd/i386/jcgray-mmx.asm',
'simd/i386/jcgray-sse2.asm',
'simd/i386/jchuff-sse2.asm',
'simd/i386/jcphuff-sse2.asm',
'simd/i386/jcsample-avx2.asm',
'simd/i386/jcsample-mmx.asm',
'simd/i386/jcsample-sse2.asm',
'simd/i386/jdcolor-avx2.asm',
'simd/i386/jdcolor-mmx.asm',
'simd/i386/jdcolor-sse2.asm',
'simd/i386/jdmerge-avx2.asm',
'simd/i386/jdmerge-mmx.asm',
'simd/i386/jdmerge-sse2.asm',
'simd/i386/jdsample-avx2.asm',
'simd/i386/jdsample-mmx.asm',
'simd/i386/jdsample-sse2.asm',
'simd/i386/jfdctflt-3dn.asm',
'simd/i386/jfdctflt-sse.asm',
'simd/i386/jfdctfst-mmx.asm',
'simd/i386/jfdctfst-sse2.asm',
'simd/i386/jfdctint-avx2.asm',
'simd/i386/jfdctint-mmx.asm',
'simd/i386/jfdctint-sse2.asm',
'simd/i386/jidctflt-3dn.asm',
'simd/i386/jidctflt-sse.asm',
'simd/i386/jidctflt-sse2.asm',
'simd/i386/jidctfst-mmx.asm',
'simd/i386/jidctfst-sse2.asm',
'simd/i386/jidctint-avx2.asm',
'simd/i386/jidctint-mmx.asm',
'simd/i386/jidctint-sse2.asm',
'simd/i386/jidctred-mmx.asm',
'simd/i386/jidctred-sse2.asm',
'simd/i386/jquant-3dn.asm',
'simd/i386/jquant-mmx.asm',
'simd/i386/jquant-sse.asm',
'simd/i386/jquantf-sse2.asm',
'simd/i386/jquanti-avx2.asm',
'simd/i386/jquanti-sse2.asm',
'simd/i386/jsimd.c',
'simd/i386/jsimdcpu.asm',
]
elif CONFIG['CPU_ARCH'].startswith('ppc'):
# PowerPC has no assembly files, but still needs its own headers.
LOCAL_INCLUDES += ['/media/libjpeg/simd/powerpc']
# For libjpeg's internal runtime detection to work, jsimd.c must NOT
# be compiled with -maltivec (otherwise it gets statically set),
# but everything else should be. If -maltivec was already
# specified in .mozconfig, though, then this won't harm anything.
ppc_vmx_sources = [
'simd/powerpc/jccolor-altivec.c',
'simd/powerpc/jcgray-altivec.c',
'simd/powerpc/jcsample-altivec.c',
'simd/powerpc/jdcolor-altivec.c',
'simd/powerpc/jdmerge-altivec.c',
'simd/powerpc/jdsample-altivec.c',
'simd/powerpc/jfdctfst-altivec.c',
'simd/powerpc/jfdctint-altivec.c',
'simd/powerpc/jidctfst-altivec.c',
'simd/powerpc/jidctint-altivec.c',
'simd/powerpc/jquanti-altivec.c',
]
SOURCES += ppc_vmx_sources
SOURCES += [
'simd/powerpc/jsimd.c',
]
for srcfile in ppc_vmx_sources:
SOURCES[srcfile].flags += CONFIG['PPC_VMX_FLAGS']
else: # No SIMD support?
SOURCES += [
'jsimd_none.c',
]
ASFLAGS += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
# Make sure the x86 & x86-64 ASM files can see the necessary includes.
if CONFIG['CPU_ARCH'] == 'x86':
ASFLAGS += ['-I%s/media/libjpeg/simd/nasm/' % TOPSRCDIR]
ASFLAGS += ['-I%s/media/libjpeg/simd/i386/' % TOPSRCDIR]
if CONFIG['CPU_ARCH'] == 'x86_64':
ASFLAGS += ['-I%s/media/libjpeg/simd/nasm/' % TOPSRCDIR]
ASFLAGS += ['-I%s/media/libjpeg/simd/x86_64/' % TOPSRCDIR]
# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()
FINAL_LIBRARY = 'gkmedias'