summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorFred Ross-Perry <fred.ross-perry@artifex.com>2018-02-18 08:44:31 -0800
committerTor Andersson <tor.andersson@artifex.com>2018-02-27 14:07:57 +0100
commit58c07a42f0cb3fbd3fbbc81a268e1c39138798aa (patch)
tree6b9e4bcb4e85dc3b8d16f6b58f94e1e1f69d37bf /platform
parentc3da8016dcb38098a04f3cdcdd1d5db0008d86c0 (diff)
downloadmupdf-58c07a42f0cb3fbd3fbbc81a268e1c39138798aa.tar.xz
jni: Add the ability to supply extra C flags to Android libmupdf builds.
Use the MUPDF_EXTRA_CFLAGS, CPPFLAGS, LDLIBS, and LDFLAGS variables.
Diffstat (limited to 'platform')
-rw-r--r--platform/java/Android.mk19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/java/Android.mk b/platform/java/Android.mk
index 1b880fac..7adf1487 100644
--- a/platform/java/Android.mk
+++ b/platform/java/Android.mk
@@ -10,6 +10,9 @@
# The top-level Makefile will invoke ndk-build with appropriate arguments
# if you run 'make android'.
#
+# Use the MUPDF_EXTRA_CFLAGS, MUPDF_EXTRA_CPPFLAGS, MUPDF_EXTRA_LDFLAGS,
+# and MUPDF_EXTRA_LDLIBS variables to add more compiler flags.
+#
# LOCAL_C_INCLUDES paths are relative to the NDK root directory.
# LOCAL_SRC_FILES paths are relative to LOCAL_PATH.
#
@@ -57,6 +60,9 @@ LOCAL_CFLAGS := \
-DTOFU_NOTO -DTOFU_CJK \
-DAA_BITS=8 \
+LOCAL_CFLAGS += \
+ $(MUPDF_EXTRA_CFLAGS)
+
LOCAL_SRC_FILES += \
$(wildcard $(MUPDF_PATH)/source/fitz/*.c) \
$(wildcard $(MUPDF_PATH)/source/pdf/*.c) \
@@ -98,6 +104,9 @@ LOCAL_CFLAGS := \
-DHAVE_STDINT_H \
-DOPJ_STATIC -DOPJ_HAVE_INTTYPES_H -DOPJ_HAVE_STDINT_H -DUSE_JPIP \
+LOCAL_CFLAGS += \
+ $(MUPDF_EXTRA_CFLAGS)
+
LOCAL_CPPFLAGS := \
-ffunction-sections -fdata-sections \
-fno-rtti -fno-exceptions -fvisibility-inlines-hidden --std=c++0x \
@@ -107,6 +116,9 @@ LOCAL_CPPFLAGS := \
-Dhb_realloc_impl=fz_hb_realloc \
-Dhb_free_impl=fz_hb_free \
+LOCAL_CPPFLAGS += \
+ $(MUPDF_EXTRA_CPPFLAGS)
+
LOCAL_SRC_FILES += \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftbase.c \
$(MUPDF_PATH)/thirdparty/freetype/src/base/ftbbox.c \
@@ -297,11 +309,18 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS := \
-DHAVE_ANDROID
+LOCAL_CFLAGS += \
+ $(MUPDF_EXTRA_CFLAGS)
+
LOCAL_SRC_FILES := \
$(MUPDF_PATH)/platform/java/mupdf_native.c
LOCAL_STATIC_LIBRARIES := mupdf_core mupdf_thirdparty
+
LOCAL_LDLIBS := -ljnigraphics -llog -lm
+LOCAL_LDLIBS += $(MUDPF_EXTRA_LDLIBS)
+
LOCAL_LDFLAGS := -Wl,--gc-sections
+LOCAL_LDFLAGS += $(MUDPF_EXTRA_LDFLAGS)
include $(BUILD_SHARED_LIBRARY)