-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAndroid.mk
More file actions
138 lines (117 loc) · 3.89 KB
/
Android.mk
File metadata and controls
138 lines (117 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
LOCAL_PATH:= $(call my-dir)
# We need to build this for both the device (as a shared library)
# and the host (as a static library for tools to use).
common_SRC_FILES := \
png.c \
pngerror.c \
pngget.c \
pngmem.c \
pngpread.c \
pngread.c \
pngrio.c \
pngrtran.c \
pngrutil.c \
pngset.c \
pngtrans.c \
pngwio.c \
pngwrite.c \
pngwtran.c \
pngwutil.c \
ifeq ($(ARCH_ARM_HAVE_NEON),true)
my_cflags_arm := -DPNG_ARM_NEON_OPT=2
endif
my_cflags_arm64 := -DPNG_ARM_NEON_OPT=2
my_src_files_arm := \
arm/arm_init.c \
arm/filter_neon.S \
arm/filter_neon_intrinsics.c
my_cflags_intel := -DPNG_INTEL_SSE_OPT=1
my_src_files_intel := \
intel/intel_init.c \
intel/filter_sse2_intrinsics.c
common_CFLAGS := -std=gnu89 -Wno-unused-parameter #-fvisibility=hidden ## -fomit-frame-pointer
# For the host
# =====================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_SRC_FILES_x86 += $(my_src_files_intel)
LOCAL_SRC_FILES_x86_64 += $(my_src_files_intel)
LOCAL_CFLAGS += $(common_CFLAGS)
# Disable optimizations because they crash on windows
# LOCAL_CFLAGS_x86 += $(my_cflags_intel)
# LOCAL_CFLAGS_x86_64 += $(my_cflags_intel)
LOCAL_ASFLAGS += $(common_ASFLAGS)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_STATIC_LIBRARIES := libz
LOCAL_MODULE:= libpng
LOCAL_MODULE_HOST_OS := darwin linux windows
include $(BUILD_HOST_STATIC_LIBRARY)
# For the device (static) for NDK
# =====================================================
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_SRC_FILES_arm := $(my_src_files_arm)
LOCAL_SRC_FILES_arm64 := $(my_src_files_arm)
LOCAL_SRC_FILES_x86 += $(my_src_files_intel)
LOCAL_SRC_FILES_x86_64 += $(my_src_files_intel)
LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv
LOCAL_CFLAGS_arm := $(my_cflags_arm)
LOCAL_CFLAGS_arm64 := $(my_cflags_arm64)
LOCAL_CFLAGS_x86 += $(my_cflags_intel)
LOCAL_CFLAGS_x86_64 += $(my_cflags_intel)
LOCAL_ASFLAGS += $(common_ASFLAGS)
LOCAL_SANITIZE := never
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := libz
LOCAL_MODULE:= libpng_ndk
LOCAL_SDK_VERSION := 14
include $(BUILD_STATIC_LIBRARY)
# For the device (static) for platform (retains fortify support)
# =====================================================
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_SRC_FILES_arm := $(my_src_files_arm)
LOCAL_SRC_FILES_arm64 := $(my_src_files_arm)
LOCAL_SRC_FILES_x86 += $(my_src_files_intel)
LOCAL_SRC_FILES_x86_64 += $(my_src_files_intel)
LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv
LOCAL_CFLAGS_arm := $(my_cflags_arm)
LOCAL_CFLAGS_arm64 := $(my_cflags_arm64)
LOCAL_CFLAGS_x86 += $(my_cflags_intel)
LOCAL_CFLAGS_x86_64 += $(my_cflags_intel)
LOCAL_ASFLAGS += $(common_ASFLAGS)
LOCAL_SANITIZE := never
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := libz
LOCAL_MODULE:= libpng
include $(BUILD_STATIC_LIBRARY)
# For the device (shared)
# =====================================================
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_SRC_FILES_arm := $(my_src_files_arm)
LOCAL_SRC_FILES_arm64 := $(my_src_files_arm)
LOCAL_SRC_FILES_x86 += $(my_src_files_intel)
LOCAL_SRC_FILES_x86_64 += $(my_src_files_intel)
LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv
LOCAL_CFLAGS_arm := $(my_cflags_arm)
LOCAL_CFLAGS_arm64 := $(my_cflags_arm64)
LOCAL_CFLAGS_x86 += $(my_cflags_intel)
LOCAL_CFLAGS_x86_64 += $(my_cflags_intel)
LOCAL_ASFLAGS += $(common_ASFLAGS)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := libz
LOCAL_MODULE:= libpng
include $(BUILD_SHARED_LIBRARY)
# For testing
# =====================================================
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_SRC_FILES:= pngtest.c
LOCAL_MODULE := pngtest
LOCAL_SHARED_LIBRARIES:= libpng libz
LOCAL_MODULE_TAGS := debug
include $(BUILD_EXECUTABLE)