The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | |
| 3 | # We need to build this for both the device (as a shared library) |
| 4 | # and the host (as a static library for tools to use). |
| 5 | |
| 6 | common_SRC_FILES := \ |
| 7 | png.c \ |
| 8 | pngerror.c \ |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 9 | pngget.c \ |
| 10 | pngmem.c \ |
| 11 | pngpread.c \ |
| 12 | pngread.c \ |
| 13 | pngrio.c \ |
| 14 | pngrtran.c \ |
| 15 | pngrutil.c \ |
| 16 | pngset.c \ |
| 17 | pngtrans.c \ |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 18 | pngwio.c \ |
| 19 | pngwrite.c \ |
| 20 | pngwtran.c \ |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 21 | pngwutil.c \ |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 22 | |
sireesh | 282702a | 2014-06-18 14:16:48 +0530 | [diff] [blame] | 23 | ifeq ($(ARCH_ARM_HAVE_NEON),true) |
Riley Andrews | b439741 | 2014-08-19 17:21:02 -0700 | [diff] [blame] | 24 | my_cflags_arm := -DPNG_ARM_NEON_OPT=2 |
sireesh | 282702a | 2014-06-18 14:16:48 +0530 | [diff] [blame] | 25 | endif |
Stephen Hines | bdcf23a | 2014-04-17 16:25:53 -0700 | [diff] [blame] | 26 | |
Riley Andrews | b439741 | 2014-08-19 17:21:02 -0700 | [diff] [blame] | 27 | my_cflags_arm64 := -DPNG_ARM_NEON_OPT=2 |
sireesh | 43608cf | 2014-06-26 13:09:53 +0530 | [diff] [blame] | 28 | |
Stephen Hines | bdcf23a | 2014-04-17 16:25:53 -0700 | [diff] [blame] | 29 | # BUG: http://llvm.org/PR19472 - SLP vectorization (on ARM at least) crashes |
| 30 | # when we can't lower a vectorized bswap. |
| 31 | my_cflags_arm += -fno-slp-vectorize |
| 32 | |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 33 | my_src_files_arm := \ |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 34 | arm/arm_init.c \ |
| 35 | arm/filter_neon.S \ |
| 36 | arm/filter_neon_intrinsics.c |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 37 | |
| 38 | |
| 39 | common_CFLAGS := -std=gnu89 #-fvisibility=hidden ## -fomit-frame-pointer |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 40 | |
Raphael Moll | 671f9cd | 2011-02-09 12:43:48 -0800 | [diff] [blame] | 41 | ifeq ($(HOST_OS),windows) |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 42 | ifeq ($(USE_MINGW),) |
| 43 | # Case where we're building windows but not under linux (so it must be cygwin) |
| 44 | # In this case, gcc cygwin doesn't recognize -fvisibility=hidden |
| 45 | $(info libpng: Ignoring gcc flag $(common_CFLAGS) on Cygwin) |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 46 | common_CFLAGS := |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 47 | endif |
Raphael Moll | 671f9cd | 2011-02-09 12:43:48 -0800 | [diff] [blame] | 48 | endif |
| 49 | |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 50 | # For the host |
| 51 | # ===================================================== |
| 52 | |
| 53 | include $(CLEAR_VARS) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 54 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
| 55 | LOCAL_CFLAGS += $(common_CFLAGS) |
Tim Murray | 43d98c9 | 2014-04-23 15:34:05 -0700 | [diff] [blame] | 56 | LOCAL_ASFLAGS += $(common_ASFLAGS) |
Trevor Drake | b74a801 | 2015-02-22 21:33:27 +0000 | [diff] [blame] | 57 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 58 | LOCAL_MODULE:= libpng |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 59 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 60 | |
| 61 | |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 62 | # For the device (static) |
| 63 | # ===================================================== |
| 64 | |
| 65 | include $(CLEAR_VARS) |
| 66 | LOCAL_CLANG := true |
| 67 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
| 68 | LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 69 | LOCAL_CFLAGS_arm := $(my_cflags_arm) |
Tim Murray | 43d98c9 | 2014-04-23 15:34:05 -0700 | [diff] [blame] | 70 | LOCAL_ASFLAGS += $(common_ASFLAGS) |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 71 | LOCAL_SRC_FILES_arm := $(my_src_files_arm) |
sireesh | 43608cf | 2014-06-26 13:09:53 +0530 | [diff] [blame] | 72 | LOCAL_CFLAGS_arm64 := $(my_cflags_arm64) |
| 73 | LOCAL_SRC_FILES_arm64 := $(my_src_files_arm) |
Dan Albert | 1afb070 | 2014-10-21 11:10:48 -0700 | [diff] [blame] | 74 | LOCAL_ADDRESS_SANITIZER := false |
Trevor Drake | b74a801 | 2015-02-22 21:33:27 +0000 | [diff] [blame] | 75 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) |
| 76 | LOCAL_SHARED_LIBRARIES := libz |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 77 | LOCAL_MODULE:= libpng |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 78 | include $(BUILD_STATIC_LIBRARY) |
| 79 | |
| 80 | # For the device (shared) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 81 | # ===================================================== |
| 82 | |
| 83 | include $(CLEAR_VARS) |
Stephen Hines | deba48b | 2012-08-03 17:25:20 -0700 | [diff] [blame] | 84 | LOCAL_CLANG := true |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 85 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 86 | LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 87 | LOCAL_CFLAGS_arm := $(my_cflags_arm) |
Tim Murray | 43d98c9 | 2014-04-23 15:34:05 -0700 | [diff] [blame] | 88 | LOCAL_ASFLAGS += $(common_ASFLAGS) |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 89 | LOCAL_SRC_FILES_arm := $(my_src_files_arm) |
sireesh | 43608cf | 2014-06-26 13:09:53 +0530 | [diff] [blame] | 90 | LOCAL_CFLAGS_arm64 := $(my_cflags_arm64) |
| 91 | LOCAL_SRC_FILES_arm64 := $(my_src_files_arm) |
Trevor Drake | b74a801 | 2015-02-22 21:33:27 +0000 | [diff] [blame] | 92 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) |
| 93 | LOCAL_SHARED_LIBRARIES := libz |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 94 | LOCAL_MODULE:= libpng |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 95 | include $(BUILD_SHARED_LIBRARY) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 96 | |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 97 | # For testing |
| 98 | # ===================================================== |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 99 | |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 100 | include $(CLEAR_VARS) |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 101 | LOCAL_CLANG := true |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 102 | LOCAL_SRC_FILES:= pngtest.c |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 103 | LOCAL_MODULE := pngtest |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 104 | LOCAL_SHARED_LIBRARIES:= libpng libz |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 105 | LOCAL_MODULE_TAGS := debug |
| 106 | include $(BUILD_EXECUTABLE) |