blob: 1bd050454e52f47fab6cb5c3fa8de582c4906995 (
plain)
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
# Android makefile to be used with ndk-build.
#
# Run ndk-build with the following arguments:
# APP_BUILD_SCRIPT=platform/java/Android.mk (this file)
# APP_PROJECT_DIR=build/android (where you want the output)
# APP_PLATFORM=android-16
# APP_OPTIM=release (or debug)
# APP_ABI=all (or armeabi, armeabi-v7a, arm64-v8a, x86, x86_64, mips, mips64)
#
# The top-level Makefile will invoke ndk-build with appropriate arguments
# if you run 'make android'.
#
# LOCAL_C_INCLUDES paths are relative to the NDK root directory.
# LOCAL_SRC_FILES paths are relative to LOCAL_PATH.
#
# We make sure to use absolute paths everywhere, so this makefile works
# regardless of where it is called from.
LOCAL_PATH := $(call my-dir)
MUPDF_PATH := $(realpath $(LOCAL_PATH)/../..)
# --- Include pre-built ghostscript library if building with gproof support ---
ifdef FZ_ENABLE_GPRF
include $(CLEAR_VARS)
LOCAL_MODULE := gsso
LOCAL_SRC_FILES := libgs.so
include $(PREBUILT_SHARED_LIBRARY)
endif
# --- Build a local static library for core mupdf ---
include $(CLEAR_VARS)
LOCAL_MODULE := mupdf_core
ifdef FZ_ENABLE_GPRF
LOCAL_CFLAGS += -DFZ_ENABLE_GPRF
endif
LOCAL_C_INCLUDES := \
$(MUPDF_PATH)/include \
$(MUPDF_PATH)/generated \
$(MUPDF_PATH)/scripts/freetype \
$(MUPDF_PATH)/scripts/libjpeg \
$(MUPDF_PATH)/thirdparty/freetype/include \
$(MUPDF_PATH)/thirdparty/harfbuzz/src \
$(MUPDF_PATH)/thirdparty/jbig2dec \
$(MUPDF_PATH)/thirdparty/libjpeg \
$(MUPDF_PATH)/thirdparty/mujs \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2 \
$(MUPDF_PATH)/thirdparty/zlib \
LOCAL_CFLAGS := \
-ffunction-sections -fdata-sections \
-DTOFU_NOTO -DTOFU_CJK \
-DAA_BITS=8 \
LOCAL_SRC_FILES += \
$(wildcard $(MUPDF_PATH)/source/fitz/*.c) \
$(wildcard $(MUPDF_PATH)/source/pdf/*.c) \
$(wildcard $(MUPDF_PATH)/source/xps/*.c) \
$(wildcard $(MUPDF_PATH)/source/svg/*.c) \
$(wildcard $(MUPDF_PATH)/source/cbz/*.c) \
$(wildcard $(MUPDF_PATH)/source/gprf/*.c) \
$(wildcard $(MUPDF_PATH)/source/html/*.c) \
$(wildcard $(MUPDF_PATH)/generated/*.c) \
include $(BUILD_STATIC_LIBRARY)
# --- Build a local static library for thirdparty libraries ---
include $(CLEAR_VARS)
LOCAL_MODULE := mupdf_thirdparty
LOCAL_CPP_EXTENSION := .cc
LOCAL_C_INCLUDES := \
$(MUPDF_PATH)/include \
$(MUPDF_PATH)/scripts/freetype \
$(MUPDF_PATH)/scripts/libjpeg \
$(MUPDF_PATH)/thirdparty/freetype/include \
$(MUPDF_PATH)/thirdparty/harfbuzz/src \
$(MUPDF_PATH)/thirdparty/jbig2dec \
$(MUPDF_PATH)/thirdparty/libjpeg \
$(MUPDF_PATH)/thirdparty/mujs \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2 \
$(MUPDF_PATH)/thirdparty/zlib \
LOCAL_CFLAGS := \
-ffunction-sections -fdata-sections \
-DFT2_BUILD_LIBRARY -DDARWIN_NO_CARBON \
'-DFT_CONFIG_MODULES_H="slimftmodules.h"' \
'-DFT_CONFIG_OPTIONS_H="slimftoptions.h"' \
-DHAVE_STDINT_H \
-DOPJ_STATIC -DOPJ_HAVE_INTTYPES_H -DOPJ_HAVE_STDINT_H -DUSE_JPIP \
LOCAL_CPPFLAGS := \
-ffunction-sections -fdata-sections \
-fno-rtti -fno-exceptions -fvisibility-inlines-hidden --std=c++0x \
-DHAVE_OT -DHAVE_UCDN -DHB_NO_MT \
-Dhb_malloc_impl=hb_malloc \
-Dhb_calloc_impl=hb_calloc \
-Dhb_realloc_impl=hb_realloc \
-Dhb_free_impl=hb_free \
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftbase.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftbbox.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftbitmap.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftfntfmt.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftgasp.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftglyph.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftinit.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftstroke.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftsynth.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftsystem.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/fttype1.c \
$(MUPDF_PATH)/thirdparty/freetype/src/cff/cff.c \
$(MUPDF_PATH)/thirdparty/freetype/src/cid/type1cid.c \
$(MUPDF_PATH)/thirdparty/freetype/src/psaux/psaux.c \
$(MUPDF_PATH)/thirdparty/freetype/src/pshinter/pshinter.c \
$(MUPDF_PATH)/thirdparty/freetype/src/psnames/psnames.c \
$(MUPDF_PATH)/thirdparty/freetype/src/raster/raster.c \
$(MUPDF_PATH)/thirdparty/freetype/src/sfnt/sfnt.c \
$(MUPDF_PATH)/thirdparty/freetype/src/smooth/smooth.c \
$(MUPDF_PATH)/thirdparty/freetype/src/truetype/truetype.c \
$(MUPDF_PATH)/thirdparty/freetype/src/type1/type1.c \
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-blob.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-buffer-serialize.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-buffer.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-common.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-face.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-fallback-shape.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-font.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ft.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-font.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-layout.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-map.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-tibetan.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-use-table.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-fallback.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-shape.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ot-tag.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-set.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-shape-plan.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-shape.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-shaper.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-ucdn.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-unicode.cc \
$(MUPDF_PATH)/thirdparty/harfbuzz/src/hb-warning.cc \
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_arith.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_arith_iaid.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_arith_int.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_generic.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_halftone.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_huffman.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_image.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_metadata.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_mmr.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_page.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_refinement.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_segment.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_symbol_dict.c \
$(MUPDF_PATH)/thirdparty/jbig2dec/jbig2_text.c \
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/libjpeg/jaricom.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jcomapi.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdapimin.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdapistd.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdarith.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdatadst.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdatasrc.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdcoefct.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdcolor.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jddctmgr.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdhuff.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdinput.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdmainct.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdmarker.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdmaster.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdmerge.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdpostct.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdsample.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jdtrans.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jerror.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jfdctflt.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jfdctfst.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jfdctint.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jidctflt.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jidctfst.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jidctint.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jmemmgr.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jquant1.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jquant2.c \
$(MUPDF_PATH)/thirdparty/libjpeg/jutils.c \
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/mujs/one.c \
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/bio.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/cidx_manager.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/cio.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/dwt.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/event.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/function_list.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/image.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/invert.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/j2k.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/jp2.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/mct.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/mqc.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/openjpeg.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/phix_manager.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/pi.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/ppix_manager.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/raw.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/t1.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/t2.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/tcd.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/tgt.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/thix_manager.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/thread.c \
$(MUPDF_PATH)/thirdparty/openjpeg/src/lib/openjp2/tpix_manager.c \
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/zlib/adler32.c \
$(MUPDF_PATH)/thirdparty/zlib/compress.c \
$(MUPDF_PATH)/thirdparty/zlib/crc32.c \
$(MUPDF_PATH)/thirdparty/zlib/deflate.c \
$(MUPDF_PATH)/thirdparty/zlib/inffast.c \
$(MUPDF_PATH)/thirdparty/zlib/inflate.c \
$(MUPDF_PATH)/thirdparty/zlib/inftrees.c \
$(MUPDF_PATH)/thirdparty/zlib/trees.c \
$(MUPDF_PATH)/thirdparty/zlib/uncompr.c \
$(MUPDF_PATH)/thirdparty/zlib/zutil.c \
include $(BUILD_STATIC_LIBRARY)
# --- Build the final JNI shared library ---
include $(CLEAR_VARS)
LOCAL_MODULE := mupdf_java
LOCAL_C_INCLUDES := \
$(MUPDF_PATH)/include
LOCAL_CFLAGS := \
-DHAVE_ANDROID
LOCAL_SRC_FILES := \
$(MUPDF_PATH)/platform/java/mupdf_native.c
LOCAL_STATIC_LIBRARIES := mupdf_core mupdf_thirdparty
LOCAL_LDLIBS := -ljnigraphics -llog -lm
LOCAL_LDFLAGS := -Wl,--gc-sections
include $(BUILD_SHARED_LIBRARY)
|