4

im currently using MuPDF in my android application, when i built it from source (based on ReadMe.txt) it's only generate .so file for armeabi and armeabi-v7a but not x86 and MIPS, when i run the app on arm arch devices (Samsung Galaxy Tab 7), it looks good. But not in mips arch. my question is how i can generate x86 and MIPS shared object file? if any other solution, i will appreciate it...

PS: i'm using android ndk r8d, i tried to change with android-ndk-r6b but i got same problem.

abhie
  • 124
  • 1
  • 10

1 Answers1

7

If you look in android/jni/Application.mk within the mupdf source you will see a line:

APP_ABI = armeabi armeabi-v7a

You can make this:

APP_ABI = armeabi armeabi-v7a x86 mips

or even:

APP_ABI = all

to enable the other architectures.

This will cause problems currently as android/jni/Core.mk and android/jni/Core2.mk files define -DARCH_ARM and -DARCH_THUMB (as at the time they were written, Android only supported ARM processors). This needs a bit of magic with the preprocessor:

ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DARCH_ARM -DARCH_THUMB -DARCH_ARM_CAN_LOAD_UNALIGNED
ifdef NDK_PROFILER
LOCAL_CFLAGS += -pg -DNDK_PROFILER -O2
endif
endif
LOCAL_CFLAGS += -DAA_BITS=8

I will get fixes put in for these - watch our git repo over the next couple of days. EDIT: Fix is now committed.

Robin Watts
  • 727
  • 1
  • 4
  • 10
  • 1
    yes i get latest source, but i get error :: C:/android-ndk-r8d/toolchains/x86-4.6/prebuilt/windows/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld.exe: ./obj/local/x86/objs/mupdf/mupdf.o: in function Java_com_artifex_mupdfdemo_MuPDFCore_openFile:jni/mupdf.c:296: error: undefined reference to 'sigsetjmp'. how i do fix that? – abhie Feb 28 '13 at 03:16
  • having same issue, did you find a fix? – craigrs84 Dec 15 '14 at 21:49
  • The lack of sigsetjmp is a bug in that particular NDK release. Use r8e and you'll be fine, I think. – Robin Watts Nov 24 '15 at 17:46