android mupdf for MIPS and x86 arch

前端 未结 1 420
清歌不尽
清歌不尽 2021-02-06 16:32

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

相关标签:
1条回答
  • 2021-02-06 16:58

    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.

    0 讨论(0)
提交回复
热议问题