summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorfred ross-perry <fredross-perry@Fred-Ross-Perrys-Computer.local>2016-08-12 14:05:03 -0700
committerfredross-perry <fross-perry@conceptuamath.com>2016-08-16 11:21:02 -0700
commit786057a2c19f33d7e95fca13d3711ce60d388966 (patch)
treedfe0c72fa3a3f2da9f9d3a198ea2834f8cdad5e1 /platform/android
parentc8665eae28ca2f4aa56239eb411c6ea1200d65fb (diff)
downloadmupdf-786057a2c19f33d7e95fca13d3711ce60d388966.tar.xz
Android viewer: get experimental proofing to build again.
- use FZ_ENABLE_GPRF everywhere - chasing changed fz APIs in gprf-doc.c
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/viewer/build.gradle26
-rw-r--r--platform/android/viewer/jni/Android.mk4
-rw-r--r--platform/android/viewer/jni/Core.mk8
-rw-r--r--platform/android/viewer/jni/mupdf.c6
4 files changed, 25 insertions, 19 deletions
diff --git a/platform/android/viewer/build.gradle b/platform/android/viewer/build.gradle
index 1736e939..3d8088d2 100644
--- a/platform/android/viewer/build.gradle
+++ b/platform/android/viewer/build.gradle
@@ -1,5 +1,3 @@
-import org.apache.tools.ant.taskdefs.condition.Os
-
buildscript {
repositories {
jcenter()
@@ -58,29 +56,37 @@ android {
}
}
-/* This defines the path to Android's ndk-build. */
+// This defines the path to Android's ndk-build.
+import org.apache.tools.ant.taskdefs.condition.Os
def ndkBuildPath = plugins.getPlugin('com.android.application').sdkHandler.getNdkFolder().absolutePath + File.separator + 'ndk-build'
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
ndkBuildPath +='.cmd'
}
-/* This task builds the native part */
+// This task builds the native part
+// To build with experimental proofing enabled, define FZ_ENABLE_GPRF,
+// as shown below, and put a copy of libgs.so in the
+// JNI folder before building.
+
task buildNative(type: Exec,description: 'Compile JNI source via NDK') {
println('executing buildNative')
- commandLine ndkBuildPath, '-C', file('.').absolutePath, ' FZ_ENABLE_GPRF=1'
- //'NDK_PROJECT_PATH=build','APP_BUILD_SCRIPT=src/main/jni/Android.mk'//force using appropriate Makefile
+// commandLine ndkBuildPath, '-C', file('.').absolutePath, ' FZ_ENABLE_GPRF=1'
+ commandLine ndkBuildPath, '-C', file('.').absolutePath
}
-/* This task cleans the native part */
+// This task cleans the native part
+
task cleanNative(type: Exec, description: 'Clean JNI object files') {
println('executing cleanNative')
commandLine ndkBuildPath, '-C', file('.').absolutePath, 'clean'
}
-/* cleaning should also include cleaning native */
+// cleaning should also include cleaning native
+
clean.dependsOn 'cleanNative'
-/* building should include native */
-tasks.withType(JavaCompile){
+// building should include native
+
+tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildNative
}
diff --git a/platform/android/viewer/jni/Android.mk b/platform/android/viewer/jni/Android.mk
index 0a1dbf38..27f481a8 100644
--- a/platform/android/viewer/jni/Android.mk
+++ b/platform/android/viewer/jni/Android.mk
@@ -30,8 +30,8 @@ ifdef NDK_PROFILER
LOCAL_CFLAGS += -pg -DNDK_PROFILER
LOCAL_STATIC_LIBRARIES += andprof
endif
-ifdef SUPPORT_GPROOF
-LOCAL_CFLAGS += -DSUPPORT_GPROOF
+ifdef FZ_ENABLE_GPRF
+LOCAL_CFLAGS += -DFZ_ENABLE_GPRF
endif
LOCAL_LDLIBS := -lm -llog -ljnigraphics
diff --git a/platform/android/viewer/jni/Core.mk b/platform/android/viewer/jni/Core.mk
index 7a0913b4..4f9a3136 100644
--- a/platform/android/viewer/jni/Core.mk
+++ b/platform/android/viewer/jni/Core.mk
@@ -1,6 +1,6 @@
LOCAL_PATH := $(call my-dir)
-ifdef SUPPORT_GPROOF
+ifdef FZ_ENABLE_GPRF
include $(CLEAR_VARS)
LOCAL_MODULE := gsso
LOCAL_SRC_FILES := libgs.so
@@ -19,8 +19,8 @@ ifdef NDK_PROFILER
LOCAL_CFLAGS += -pg -DNDK_PROFILER
endif
endif
-ifdef SUPPORT_GPROOF
-LOCAL_CFLAGS += -DSUPPORT_GPROOF
+ifdef FZ_ENABLE_GPRF
+LOCAL_CFLAGS += -DFZ_ENABLE_GPRF
endif
LOCAL_CFLAGS += -DAA_BITS=8
ifdef MEMENTO
@@ -69,7 +69,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(MY_ROOT)/source/html/*.c) \
$(wildcard $(MY_ROOT)/generated/*.c)
-ifdef SUPPORT_GPROOF
+ifdef FZ_ENABLE_GPRF
LOCAL_SHARED_LIBRARIES := gsso
endif
LOCAL_LDLIBS := -lm -llog -ljnigraphics
diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c
index 55c37e43..83560aad 100644
--- a/platform/android/viewer/jni/mupdf.c
+++ b/platform/android/viewer/jni/mupdf.c
@@ -2749,7 +2749,7 @@ static char *tmp_gproof_path(char *path)
JNIEXPORT jstring JNICALL
JNI_FN(MuPDFCore_startProofInternal)(JNIEnv * env, jobject thiz, int inResolution)
{
-#ifdef SUPPORT_GPROOF
+#ifdef FZ_ENABLE_GPRF
globals *glo = get_globals(env, thiz);
fz_context *ctx = glo->ctx;
char *tmp;
@@ -2790,7 +2790,7 @@ JNI_FN(MuPDFCore_startProofInternal)(JNIEnv * env, jobject thiz, int inResolutio
JNIEXPORT void JNICALL
JNI_FN(MuPDFCore_endProofInternal)(JNIEnv * env, jobject thiz, jstring jfilename)
{
-#ifdef SUPPORT_GPROOF
+#ifdef FZ_ENABLE_GPRF
globals *glo = get_globals(env, thiz);
fz_context *ctx = glo->ctx;
const char *tmp;
@@ -2812,7 +2812,7 @@ JNI_FN(MuPDFCore_endProofInternal)(JNIEnv * env, jobject thiz, jstring jfilename
JNIEXPORT jboolean JNICALL
JNI_FN(MuPDFCore_gprfSupportedInternal)(JNIEnv * env)
{
-#ifdef SUPPORT_GPROOF
+#ifdef FZ_ENABLE_GPRF
return JNI_TRUE;
#else
return JNI_FALSE;