blob: db87e77db2f1f95795bedd60ffb1d57a8b6349a6 [file] [log] [blame]
The Android Open Source Project9f5d49a2009-03-03 19:30:03 -08001LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3
4LOCAL_ARM_MODE := arm
5
6LOCAL_SRC_FILES := \
Angus Kong7fb46872013-02-25 16:13:09 -08007 jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
8 jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
9 jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
10 jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
11 jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
12 jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
13 jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \
Elliott Hughes4660f762014-12-03 17:20:46 -080014 jquant2.c jutils.c jmemmgr.c
15
16LOCAL_SRC_FILES_arm += armv6_idct.S
Joseph Wen7b6961a2010-08-11 15:35:47 +080017
Chih-Hung Hsieh9f6aca32014-10-16 11:51:01 -070018# jsimd_arm_neon.S does not compile with clang.
19LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
20
Angus Kongb98230c2013-02-06 18:25:46 -080021ifeq (,$(TARGET_BUILD_APPS))
22# building against master
Joseph Wen7b6961a2010-08-11 15:35:47 +080023# use ashmem as libjpeg decoder's backing store
24LOCAL_CFLAGS += -DUSE_ANDROID_ASHMEM
25LOCAL_SRC_FILES += \
Angus Kong7fb46872013-02-25 16:13:09 -080026 jmem-ashmem.c
Angus Kongb98230c2013-02-06 18:25:46 -080027else
28# unbundled branch, built against NDK.
29LOCAL_SDK_VERSION := 17
Joseph Wen7b6961a2010-08-11 15:35:47 +080030# the original android memory manager.
31# use sdcard as libjpeg decoder's backing store
Angus Kongb98230c2013-02-06 18:25:46 -080032LOCAL_SRC_FILES += \
Angus Kong7fb46872013-02-25 16:13:09 -080033 jmem-android.c
Angus Kongb98230c2013-02-06 18:25:46 -080034endif
Joseph Wen7b6961a2010-08-11 15:35:47 +080035
Angus Kong7fb46872013-02-25 16:13:09 -080036LOCAL_CFLAGS += -DAVOID_TABLES
The Android Open Source Project9f5d49a2009-03-03 19:30:03 -080037LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
38#LOCAL_CFLAGS += -march=armv6j
39
Joseph Wen3147fbe2010-07-12 13:15:16 +080040# enable tile based decode
41LOCAL_CFLAGS += -DANDROID_TILE_BASED_DECODE
42
Xun Sune08a2112013-11-13 18:00:45 +080043ifeq ($(TARGET_ARCH),x86)
Raghu Gandham71ee8592012-11-06 10:17:40 -080044 LOCAL_CFLAGS += -DANDROID_INTELSSE2_IDCT
45 LOCAL_SRC_FILES += jidctintelsse.c
46endif
47
Raghu Gandham71ee8592012-11-06 10:17:40 -080048ifeq ($(strip $(TARGET_ARCH)),arm)
Prajakta Gudadhe6a3be8d2012-06-11 14:08:27 -070049 ifeq ($(ARCH_ARM_HAVE_NEON),true)
50 #use NEON accelerations
Elliott Hughes4660f762014-12-03 17:20:46 -080051 LOCAL_CFLAGS += -DNV_ARM_NEON -D__ARM_HAVE_NEON
Prajakta Gudadhe6a3be8d2012-06-11 14:08:27 -070052 LOCAL_SRC_FILES += \
53 jsimd_arm_neon.S \
54 jsimd_neon.c
55 else
56 # enable armv6 idct assembly
57 LOCAL_CFLAGS += -DANDROID_ARMV6_IDCT
58 endif
Raghu Gandham71ee8592012-11-06 10:17:40 -080059endif
60
61# use mips assembler IDCT implementation if MIPS DSP-ASE is present
62ifeq ($(strip $(TARGET_ARCH)),mips)
63 ifeq ($(strip $(ARCH_MIPS_HAS_DSP)),true)
64 LOCAL_CFLAGS += -DANDROID_MIPS_IDCT
65 LOCAL_SRC_FILES += \
66 mips_jidctfst.c \
67 mips_idct_le.S
68 endif
tengfei.zhao6553d242012-07-04 15:50:59 +080069endif
Chia-chi Yeh4736a382010-12-10 18:11:00 +080070
Angus Kong7fb46872013-02-25 16:13:09 -080071LOCAL_MODULE := libjpeg_static
72
73include $(BUILD_STATIC_LIBRARY)
74
75
76
77# Build shared library
78include $(CLEAR_VARS)
79
80LOCAL_MODULE := libjpeg
81
82LOCAL_MODULE_TAGS := optional
83
84LOCAL_WHOLE_STATIC_LIBRARIES = libjpeg_static
85
86ifeq (,$(TARGET_BUILD_APPS))
87LOCAL_SHARED_LIBRARIES := \
88 libcutils
89else
90# unbundled branch, built against NDK.
91LOCAL_SDK_VERSION := 17
92endif
The Android Open Source Project9f5d49a2009-03-03 19:30:03 -080093
Wei-Ta Chenc4e357f2010-01-06 18:26:16 +080094include $(BUILD_SHARED_LIBRARY)
Raghu Gandham71ee8592012-11-06 10:17:40 -080095
96include $(CLEAR_VARS)
97LOCAL_ARM_MODE := arm
98LOCAL_SRC_FILES := \
99 cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h rdswitch.c cdjpeg.c rdtarga.c rdppm.c rdgif.c rdbmp.c
100LOCAL_MODULE:= cjpeg
101LOCAL_MODULE_TAGS := eng
102LOCAL_SHARED_LIBRARIES := libc libcutils libjpeg
103include $(BUILD_EXECUTABLE)
104
105include $(CLEAR_VARS)
106LOCAL_ARM_MODE := arm
107LOCAL_SRC_FILES := \
108 djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h cdjpeg.c wrppm.c wrgif.c wrbmp.c rdcolmap.c wrtarga.c
109LOCAL_MODULE:= djpeg
110LOCAL_MODULE_TAGS := eng
111LOCAL_SHARED_LIBRARIES := libc libcutils libjpeg
112include $(BUILD_EXECUTABLE)