Android.mk revision 9f6aca34abc4842152e49fd553e357adc2f3f357
1LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3
4LOCAL_ARM_MODE := arm
5
6LOCAL_SRC_FILES := \
7    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
15
16# jsimd_arm_neon.S does not compile with clang.
17LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
18
19ifeq (,$(TARGET_BUILD_APPS))
20# building against master
21# use ashmem as libjpeg decoder's backing store
22LOCAL_CFLAGS += -DUSE_ANDROID_ASHMEM
23LOCAL_SRC_FILES += \
24    jmem-ashmem.c
25else
26# unbundled branch, built against NDK.
27LOCAL_SDK_VERSION := 17
28# the original android memory manager.
29# use sdcard as libjpeg decoder's backing store
30LOCAL_SRC_FILES += \
31    jmem-android.c
32endif
33
34LOCAL_CFLAGS += -DAVOID_TABLES
35LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
36#LOCAL_CFLAGS += -march=armv6j
37
38# enable tile based decode
39LOCAL_CFLAGS += -DANDROID_TILE_BASED_DECODE
40
41ifeq ($(TARGET_ARCH),x86)
42  LOCAL_CFLAGS += -DANDROID_INTELSSE2_IDCT
43  LOCAL_SRC_FILES += jidctintelsse.c
44endif
45
46ifeq ($(strip $(TARGET_ARCH)),arm)
47  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
57endif
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
67endif
68
69LOCAL_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
91
92include $(BUILD_SHARED_LIBRARY)
93
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)
111