blob: f803b5f027c3a9cd99e4c778a92b8f4e75d4815a [file] [log] [blame]
Matt Sarett58ef73c2015-11-03 10:03:58 -05001LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3
4# By default, the build system generates ARM target binaries in thumb mode,
5# where each instruction is 16 bits wide. Defining this variable as arm
6# forces the build system to generate object files in 32-bit arm mode. This
7# is the same setting previously used by libjpeg.
8# TODO (msarett): Run performance tests to determine whether arm mode is still
9# preferred to thumb mode for libjpeg-turbo.
10LOCAL_ARM_MODE := arm
11
12LOCAL_SRC_FILES := \
13 jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
14 jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
15 jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
16 jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
17 jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
18 jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
19 jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c jmemmgr.c \
20 jmemnobs.c jquant1.c jquant2.c jutils.c
21
22# ARM v7 NEON
23LOCAL_SRC_FILES_arm += simd/jsimd_arm_neon.S simd/jsimd_arm.c
24
25# If we are certain that the ARM v7 device has NEON (and there is no need for
26# a runtime check), we can indicate that with a flag.
27ifeq ($(strip $(TARGET_ARCH)),arm)
28 ifeq ($(ARCH_ARM_HAVE_NEON),true)
29 LOCAL_CFLAGS += -D__ARM_HAVE_NEON__
30 endif
31endif
32
33# ARM v8 64-bit NEON
34LOCAL_SRC_FILES_arm64 += simd/jsimd_arm64_neon.S simd/jsimd_arm64.c
35
36# TODO (msarett): x86 and x86_64 SIMD. Cross-compiling these assembly files
37# on Linux for Android is very tricky. This will require a
38# YASM or NASM as a dependency.
39
40# TODO (msarett): MIPS SIMD. This is available in upstream libjpeg-turbo,
41# but has not been cherry picked into the version used by
42# Android.
43
44LOCAL_CFLAGS += -O3 -fstrict-aliasing
45LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
46
47ifneq (,$(TARGET_BUILD_APPS))
48 # Unbundled branch, built against NDK.
49 LOCAL_SDK_VERSION := 17
50endif
51
52# Build as a static library.
53LOCAL_MODULE := libjpeg-turbo_static
54include $(BUILD_STATIC_LIBRARY)
55
56# Also build as a shared library.
57include $(CLEAR_VARS)
58
59ifneq (,$(TARGET_BUILD_APPS))
60 # Unbundled branch, built against NDK.
61 LOCAL_SDK_VERSION := 17
62endif
63
64LOCAL_WHOLE_STATIC_LIBRARIES = libjpeg-turbo_static
65LOCAL_MODULE := libjpeg-turbo
66include $(BUILD_SHARED_LIBRARY)