Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | include $(CLEAR_VARS) |
| 3 | |
| 4 | LOCAL_ARM_MODE := arm |
| 5 | |
| 6 | # Set ANDROID_JPEG_USE_VENUM to true to enable VeNum optimizations |
| 7 | ANDROID_JPEG_USE_VENUM := true |
| 8 | |
| 9 | # Disable VeNum optimizations if they are not supported on the build target |
| 10 | ifneq ($(ARCH_ARM_HAVE_VFP),true) |
| 11 | ANDROID_JPEG_USE_VENUM := false |
| 12 | else |
| 13 | ifneq ($(ARCH_ARM_HAVE_NEON),true) |
| 14 | ANDROID_JPEG_USE_VENUM := false |
| 15 | endif |
| 16 | endif |
| 17 | |
| 18 | LOCAL_SRC_FILES := \ |
| 19 | jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \ |
| 20 | jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \ |
| 21 | jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \ |
| 22 | jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \ |
| 23 | jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \ |
| 24 | jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \ |
| 25 | jfdctint.c jidctflt.c jquant1.c \ |
| 26 | jquant2.c jutils.c jmemmgr.c \ |
| 27 | |
| 28 | # use ashmem as libjpeg decoder's backing store |
| 29 | LOCAL_CFLAGS += -DUSE_ANDROID_ASHMEM |
| 30 | LOCAL_SRC_FILES += \ |
| 31 | jmem-ashmem.c |
| 32 | |
| 33 | # the original android memory manager. |
| 34 | # use sdcard as libjpeg decoder's backing store |
| 35 | #LOCAL_SRC_FILES += \ |
| 36 | # jmem-android.c |
| 37 | |
| 38 | |
| 39 | # the assembler is only for the ARM version, don't break the Linux sim |
| 40 | ifneq ($(TARGET_ARCH),arm) |
| 41 | ANDROID_JPEG_NO_ASSEMBLER := true |
| 42 | endif |
| 43 | |
| 44 | ifeq ($(strip $(ANDROID_JPEG_NO_ASSEMBLER)),true) |
| 45 | LOCAL_SRC_FILES += jidctint.c jidctfst.c jidctred.c |
| 46 | else |
| 47 | ifeq ($(ANDROID_JPEG_USE_VENUM),true) |
| 48 | LOCAL_SRC_FILES += jidctvenum.c |
| 49 | LOCAL_SRC_FILES += asm/armv7/jdcolor-armv7.S |
| 50 | LOCAL_SRC_FILES += asm/armv7/jdcolor-android-armv7.S |
| 51 | LOCAL_SRC_FILES += asm/armv7/jdidct-armv7.S |
| 52 | LOCAL_CFLAGS += -DANDROID_JPEG_USE_VENUM |
| 53 | else # ANDROID_JPEG_USE_VENUM, false |
| 54 | LOCAL_SRC_FILES += jidctint.c jidctred.c jidctfst.c armv6_idct.S |
| 55 | LOCAL_CFLAGS += -DANDROID_ARMV6_IDCT |
| 56 | endif # ANDROID_JPEG_USE_VENUM |
| 57 | endif |
| 58 | |
| 59 | LOCAL_CFLAGS += -DAVOID_TABLES |
| 60 | LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays |
| 61 | |
| 62 | # enable tile based decode |
| 63 | LOCAL_CFLAGS += -DANDROID_TILE_BASED_DECODE |
| 64 | |
| 65 | ifdef NEEDS_ARM_ERRATA_754319_754320 |
| 66 | asm_flags := \ |
| 67 | --defsym NEEDS_ARM_ERRATA_754319_754320_ASM=1 |
| 68 | |
| 69 | LOCAL_CFLAGS+= \ |
| 70 | $(foreach f,$(asm_flags),-Wa,"$(f)") |
| 71 | endif |
| 72 | |
| 73 | LOCAL_MODULE:= libjpegtwrp |
| 74 | |
| 75 | LOCAL_SHARED_LIBRARIES := \ |
| 76 | libcutils |
| 77 | |
| 78 | include $(BUILD_STATIC_LIBRARY) |
| 79 | |