diff options
Diffstat (limited to '')
-rw-r--r-- | media/libjpeg/moz.build | 226 |
1 files changed, 226 insertions, 0 deletions
diff --git a/media/libjpeg/moz.build b/media/libjpeg/moz.build new file mode 100644 index 0000000000..c214868216 --- /dev/null +++ b/media/libjpeg/moz.build @@ -0,0 +1,226 @@ +# -*- 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', +] + +SOURCES += [ + 'jpeg_nbits_table.c', +] + +if CONFIG['LIBJPEG_TURBO_USE_YASM']: + USE_YASM = True + +if CONFIG['LIBJPEG_TURBO_ASFLAGS']: + if CONFIG['CPU_ARCH'] == 'arm': + SOURCES += [ + 'simd/arm/jsimd.c', + 'simd/arm/jsimd_neon.S', + ] + elif CONFIG['CPU_ARCH'] == 'aarch64': + SOURCES += [ + 'simd/arm64/jsimd.c', + 'simd/arm64/jsimd_neon.S', + ] + 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'] == '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_ASFLAGS'] + +# 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' + |