blob: a53d907cfb24dd0a73f60f2c43fc96ea7037b2a4 [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 \
14 jquant2.c jutils.c jmemmgr.c armv6_idct.S
Joseph Wen7b6961a2010-08-11 15:35:47 +080015
Chih-Hung Hsieh9f6aca32014-10-16 11:51:01 -070016# jsimd_arm_neon.S does not compile with clang.
17LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
18
Angus Kongb98230c2013-02-06 18:25:46 -080019ifeq (,$(TARGET_BUILD_APPS))
20# building against master
Joseph Wen7b6961a2010-08-11 15:35:47 +080021# use ashmem as libjpeg decoder's backing store
22LOCAL_CFLAGS += -DUSE_ANDROID_ASHMEM
23LOCAL_SRC_FILES += \
Angus Kong7fb46872013-02-25 16:13:09 -080024 jmem-ashmem.c
Angus Kongb98230c2013-02-06 18:25:46 -080025else
26# unbundled branch, built against NDK.
27LOCAL_SDK_VERSION := 17
Joseph Wen7b6961a2010-08-11 15:35:47 +080028# the original android memory manager.
29# use sdcard as libjpeg decoder's backing store
Angus Kongb98230c2013-02-06 18:25:46 -080030LOCAL_SRC_FILES += \
Angus Kong7fb46872013-02-25 16:13:09 -080031 jmem-android.c
Angus Kongb98230c2013-02-06 18:25:46 -080032endif
Joseph Wen7b6961a2010-08-11 15:35:47 +080033
Angus Kong7fb46872013-02-25 16:13:09 -080034LOCAL_CFLAGS += -DAVOID_TABLES
The Android Open Source Project9f5d49a2009-03-03 19:30:03 -080035LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
36#LOCAL_CFLAGS += -march=armv6j
37
Joseph Wen3147fbe2010-07-12 13:15:16 +080038# enable tile based decode
39LOCAL_CFLAGS += -DANDROID_TILE_BASED_DECODE
40
Xun Sune08a2112013-11-13 18:00:45 +080041ifeq ($(TARGET_ARCH),x86)
Raghu Gandham71ee8592012-11-06 10:17:40 -080042 LOCAL_CFLAGS += -DANDROID_INTELSSE2_IDCT
43 LOCAL_SRC_FILES += jidctintelsse.c
44endif
45
Raghu Gandham71ee8592012-11-06 10:17:40 -080046ifeq ($(strip $(TARGET_ARCH)),arm)
Prajakta Gudadhe6a3be8d2012-06-11 14:08:27 -070047 ifeq ($(ARCH_ARM_HAVE_NEON),true)
48 #use NEON accelerations
49 LOCAL_CFLAGS += -DNV_ARM_NEON
50 LOCAL_SRC_FILES += \
51 jsimd_arm_neon.S \
52 jsimd_neon.c
53 else
54 # enable armv6 idct assembly
55 LOCAL_CFLAGS += -DANDROID_ARMV6_IDCT
56 endif
Raghu Gandham71ee8592012-11-06 10:17:40 -080057endif
58
59# use mips assembler IDCT implementation if MIPS DSP-ASE is present
60ifeq ($(strip $(TARGET_ARCH)),mips)
61 ifeq ($(strip $(ARCH_MIPS_HAS_DSP)),true)
62 LOCAL_CFLAGS += -DANDROID_MIPS_IDCT
63 LOCAL_SRC_FILES += \
64 mips_jidctfst.c \
65 mips_idct_le.S
66 endif
tengfei.zhao6553d242012-07-04 15:50:59 +080067endif
Chia-chi Yeh4736a382010-12-10 18:11:00 +080068
Angus Kong7fb46872013-02-25 16:13:09 -080069LOCAL_MODULE := libjpeg_static
70
71include $(BUILD_STATIC_LIBRARY)
72
73
74
75# Build shared library
76include $(CLEAR_VARS)
77
78LOCAL_MODULE := libjpeg
79
80LOCAL_MODULE_TAGS := optional
81
82LOCAL_WHOLE_STATIC_LIBRARIES = libjpeg_static
83
84ifeq (,$(TARGET_BUILD_APPS))
85LOCAL_SHARED_LIBRARIES := \
86 libcutils
87else
88# unbundled branch, built against NDK.
89LOCAL_SDK_VERSION := 17
90endif
The Android Open Source Project9f5d49a2009-03-03 19:30:03 -080091
Wei-Ta Chenc4e357f2010-01-06 18:26:16 +080092include $(BUILD_SHARED_LIBRARY)
Raghu Gandham71ee8592012-11-06 10:17:40 -080093
94include $(CLEAR_VARS)
95LOCAL_ARM_MODE := arm
96LOCAL_SRC_FILES := \
97 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
98LOCAL_MODULE:= cjpeg
99LOCAL_MODULE_TAGS := eng
100LOCAL_SHARED_LIBRARIES := libc libcutils libjpeg
101include $(BUILD_EXECUTABLE)
102
103include $(CLEAR_VARS)
104LOCAL_ARM_MODE := arm
105LOCAL_SRC_FILES := \
106 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
107LOCAL_MODULE:= djpeg
108LOCAL_MODULE_TAGS := eng
109LOCAL_SHARED_LIBRARIES := libc libcutils libjpeg
110include $(BUILD_EXECUTABLE)