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 | |
John Reck | 1db10ef | 2014-05-23 22:27:27 +0000 | [diff] [blame] | 23 | # Previously these arm-specific flags were never applied. |
| 24 | # TODO: apply the flags and fix the build. |
| 25 | # my_cflags_arm := -DPNG_ARM_NEON_OPT=2 -DPNG_ARM_NEON_CHECK_SUPPORTED |
| 26 | my_cflags_arm := |
Stephen Hines | bdcf23a | 2014-04-17 16:25:53 -0700 | [diff] [blame] | 27 | |
| 28 | # BUG: http://llvm.org/PR19472 - SLP vectorization (on ARM at least) crashes |
| 29 | # when we can't lower a vectorized bswap. |
| 30 | my_cflags_arm += -fno-slp-vectorize |
| 31 | |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 32 | my_src_files_arm := \ |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 33 | arm/arm_init.c \ |
| 34 | arm/filter_neon.S \ |
| 35 | arm/filter_neon_intrinsics.c |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 36 | |
| 37 | |
| 38 | common_CFLAGS := -std=gnu89 #-fvisibility=hidden ## -fomit-frame-pointer |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 39 | |
Raphael Moll | 671f9cd | 2011-02-09 12:43:48 -0800 | [diff] [blame] | 40 | ifeq ($(HOST_OS),windows) |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 41 | ifeq ($(USE_MINGW),) |
| 42 | # Case where we're building windows but not under linux (so it must be cygwin) |
| 43 | # In this case, gcc cygwin doesn't recognize -fvisibility=hidden |
| 44 | $(info libpng: Ignoring gcc flag $(common_CFLAGS) on Cygwin) |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 45 | common_CFLAGS := |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 46 | endif |
Raphael Moll | 671f9cd | 2011-02-09 12:43:48 -0800 | [diff] [blame] | 47 | endif |
| 48 | |
Tim Murray | 43d98c9 | 2014-04-23 15:34:05 -0700 | [diff] [blame] | 49 | ifeq ($(HOST_OS),darwin) |
| 50 | common_CFLAGS += -no-integrated-as |
| 51 | common_ASFLAGS += -no-integrated-as |
| 52 | endif |
| 53 | |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 54 | common_C_INCLUDES += |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 55 | |
| 56 | common_COPY_HEADERS_TO := libpng |
| 57 | common_COPY_HEADERS := png.h pngconf.h pngusr.h |
| 58 | |
| 59 | # For the host |
| 60 | # ===================================================== |
| 61 | |
| 62 | include $(CLEAR_VARS) |
| 63 | |
| 64 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
| 65 | LOCAL_CFLAGS += $(common_CFLAGS) |
Tim Murray | 43d98c9 | 2014-04-23 15:34:05 -0700 | [diff] [blame] | 66 | LOCAL_ASFLAGS += $(common_ASFLAGS) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 67 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) external/zlib |
| 68 | |
| 69 | LOCAL_MODULE:= libpng |
| 70 | |
| 71 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) |
| 72 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) |
| 73 | |
| 74 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 75 | |
| 76 | |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 77 | # For the device (static) |
| 78 | # ===================================================== |
| 79 | |
| 80 | include $(CLEAR_VARS) |
| 81 | LOCAL_CLANG := true |
| 82 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
| 83 | LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 84 | LOCAL_CFLAGS_arm := $(my_cflags_arm) |
Tim Murray | 43d98c9 | 2014-04-23 15:34:05 -0700 | [diff] [blame] | 85 | LOCAL_ASFLAGS += $(common_ASFLAGS) |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 86 | LOCAL_SRC_FILES_arm := $(my_src_files_arm) |
| 87 | |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 88 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ |
| 89 | external/zlib |
| 90 | LOCAL_SHARED_LIBRARIES := \ |
| 91 | libz |
| 92 | |
| 93 | LOCAL_MODULE:= libpng |
| 94 | |
| 95 | include $(BUILD_STATIC_LIBRARY) |
| 96 | |
| 97 | # For the device (shared) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 98 | # ===================================================== |
| 99 | |
| 100 | include $(CLEAR_VARS) |
Stephen Hines | deba48b | 2012-08-03 17:25:20 -0700 | [diff] [blame] | 101 | LOCAL_CLANG := true |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 102 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 103 | LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 104 | LOCAL_CFLAGS_arm := $(my_cflags_arm) |
Tim Murray | 43d98c9 | 2014-04-23 15:34:05 -0700 | [diff] [blame] | 105 | LOCAL_ASFLAGS += $(common_ASFLAGS) |
Ying Wang | 3446b93 | 2014-02-27 14:05:59 -0800 | [diff] [blame] | 106 | LOCAL_SRC_FILES_arm := $(my_src_files_arm) |
| 107 | |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 108 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ |
| 109 | external/zlib |
| 110 | LOCAL_SHARED_LIBRARIES := \ |
| 111 | libz |
| 112 | |
| 113 | LOCAL_MODULE:= libpng |
| 114 | |
| 115 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) |
| 116 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) |
| 117 | |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 118 | include $(BUILD_SHARED_LIBRARY) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 119 | |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 120 | # For testing |
| 121 | # ===================================================== |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 122 | |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 123 | include $(CLEAR_VARS) |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 124 | LOCAL_CLANG := true |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 125 | LOCAL_C_INCLUDES:= $(common_C_INCLUDES) external/zlib |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 126 | LOCAL_SRC_FILES:= pngtest.c |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 127 | LOCAL_MODULE := pngtest |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame] | 128 | LOCAL_SHARED_LIBRARIES:= libpng libz |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 129 | LOCAL_MODULE_TAGS := debug |
| 130 | include $(BUILD_EXECUTABLE) |