【学习笔记】Mupdf编译

Android平台

1.安装Cygwin,根据电脑平台选择下载程序

2.Cygwin安装 make和g++

3.运行Cygwin Terminal ,cd到mupdf下载目录

4.make generate

运行完毕,会有generated目录生成

5.通过Android Studio下载NDK

6.cmd中输入

E:UsersAdministratorAppDataLocal
dk21.1.6352462
dk-build.cmd NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=platform/java/Android.mk APP_PROJECT_DIR=build/android APP_PLATFORM=android-23  APP_OPTIM=release APP_ABI=all

7.最后在lib中就是编译好的so

Linux平台

Download
The latest development source is available directly from the git repository:

  1. git clone --recursive git://git.ghostscript.com/mupdf.git
    就这一步就卡在这里很久了,最终在梯子的帮助下下载完全了
git clone --recursive git://git.ghostscript.com/mupdf.git
正克隆到 'mupdf'...
remote: Counting objects: 70924, done.
remote: Compressing objects: 100% (14361/14361), done.
remote: Total 70924 (delta 54350), reused 69826 (delta 53547)
接收对象中: 100% (70924/70924), 89.37 MiB | 2.72 MiB/s, 完成.
处理 delta 中: 100% (54350/54350), 完成.
子模组 'thirdparty/curl'(git://git.ghostscript.com/thirdparty-curl.git)未对路径 'thirdparty/curl' 注册
子模组 'thirdparty/freeglut'(git://git.ghostscript.com/thirdparty-freeglut.git)未对路径 'thirdparty/freeglut' 注册
子模组 'thirdparty/freetype'(git://git.ghostscript.com/thirdparty-freetype2.git)未对路径 'thirdparty/freetype' 注册
子模组 'thirdparty/gumbo-parser'(git://git.ghostscript.com/thirdparty-gumbo-parser.git)未对路径 'thirdparty/gumbo-parser' 注册
子模组 'thirdparty/harfbuzz'(git://git.ghostscript.com/thirdparty-harfbuzz.git)未对路径 'thirdparty/harfbuzz' 注册
子模组 'thirdparty/jbig2dec'(git://git.ghostscript.com/jbig2dec.git)未对路径 'thirdparty/jbig2dec' 注册
子模组 'thirdparty/lcms2'(git://git.ghostscript.com/thirdparty-lcms2.git)未对路径 'thirdparty/lcms2' 注册
子模组 'thirdparty/jpeg'(git://git.ghostscript.com/thirdparty-libjpeg.git)未对路径 'thirdparty/libjpeg' 注册
子模组 'thirdparty/mujs'(git://git.ghostscript.com/mujs.git)未对路径 'thirdparty/mujs' 注册
子模组 'thirdparty/openjpeg'(git://git.ghostscript.com/thirdparty-openjpeg.git)未对路径 'thirdparty/openjpeg' 注册
子模组 'thirdparty/zlib'(git://git.ghostscript.com/thirdparty-zlib.git)未对路径 'thirdparty/zlib' 注册
正克隆到 '/home/yyc/work/mupdf/thirdparty/curl'...
remote: Counting objects: 147920, done.        
remote: Compressing objects: 100% (32533/32533), done.        
remote: Total 147920 (delta 116892), reused 146038 (delta 115038)        
接收对象中: 100% (147920/147920), 51.73 MiB | 1.52 MiB/s, 完成.
处理 delta 中: 100% (116892/116892), 完成.
正克隆到 '/home/yyc/work/mupdf/thirdparty/lcms2'...
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
fatal: 无法克隆 'git://git.ghostscript.com/thirdparty-lcms2.git' 到子模组路径 '/home/yyc/work/mupdf/thirdparty/lcms2'
克隆 'thirdparty/lcms2' 失败。按计划重试
正克隆到 '/home/yyc/work/mupdf/thirdparty/harfbuzz'...
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
fatal: 无法克隆 'git://git.ghostscript.com/thirdparty-harfbuzz.git' 到子模组路径 '/home/yyc/work/mupdf/thirdparty/harfbuzz'
克隆 'thirdparty/harfbuzz' 失败。按计划重试
正克隆到 '/home/yyc/work/mupdf/thirdparty/jbig2dec'...
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
fatal: 无法克隆 'git://git.ghostscript.com/jbig2dec.git' 到子模组路径 '/home/ooo/work/mupdf/thirdparty/jbig2dec'
克隆 'thirdparty/jbig2dec' 失败。按计划重试
正克隆到 '/home/ooo/work/mupdf/thirdparty/freeglut'...
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
fatal: 无法克隆 'git://git.ghostscript.com/thirdparty-freeglut.git' 到子模组路径 '/home/ooo/work/mupdf/thirdparty/freeglut'
克隆 'thirdparty/freeglut' 失败。按计划重试
正克隆到 '/home/ooo/work/mupdf/thirdparty/gumbo-parser'...
remote: Counting objects: 1900, done.        
remote: Compressing objects: 100% (677/677), done.        
remote: Total 1900 (delta 1186), reused 1900 (delta 1186)        
接收对象中: 100% (1900/1900), 3.85 MiB | 1.39 MiB/s, 完成.
处理 delta 中: 100% (1186/1186), 完成.
正克隆到 '/home/ooo/work/mupdf/thirdparty/harfbuzz'...
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
fatal: 无法克隆 'git://git.ghostscript.com/thirdparty-harfbuzz.git' 到子模组路径 '/home/ooo/work/mupdf/thirdparty/harfbuzz'
第二次尝试克隆 'thirdparty/harfbuzz' 失败,退出
正克隆到 '/home/ooo/work/mupdf/thirdparty/zlib'...
remote: Counting objects: 1254, done.        
remote: Compressing objects: 100% (423/423), done.        
remote: Total 1254 (delta 824), reused 1242 (delta 812)        
接收对象中: 100% (1254/1254), 1020.65 KiB | 724.00 KiB/s, 完成.
处理 delta 中: 100% (824/824), 完成.
正克隆到 '/home/ooo/work/mupdf/thirdparty/libjpeg'...
remote: Counting objects: 507, done.        
remote: Compressing objects: 100% (198/198), done.        
remote: Total 507 (delta 324), reused 475 (delta 306)        
接收对象中: 100% (507/507), 1.46 MiB | 795.00 KiB/s, 完成.
处理 delta 中: 100% (324/324), 完成.
正克隆到 '/home/ooo/work/mupdf/thirdparty/mujs'...
remote: Counting objects: 3089, done.        
remote: Compressing objects: 100% (1667/1667), done.        
remote: Total 3089 (delta 2310), reused 1833 (delta 1416)        
接收对象中: 100% (3089/3089), 632.89 KiB | 437.00 KiB/s, 完成.
处理 delta 中: 100% (2310/2310), 完成.
正克隆到 '/home/ooo/work/mupdf/thirdparty/openjpeg'...
remote: Counting objects: 2728, done.        
remote: Compressing objects: 100% (1609/1609), done.        
remote: Total 2728 (delta 1741), reused 1917 (delta 1074)        
接收对象中: 100% (2728/2728), 5.15 MiB | 1.34 MiB/s, 完成.
处理 delta 中: 100% (1741/1741), 完成.
正克隆到 '/home/ooo/work/mupdf/thirdparty/freetype'...
remote: Counting objects: 77919, done.        
remote: Compressing objects: 100% (17873/17873), done.        
remote: Total 77919 (delta 64599), reused 71955 (delta 59652)        
接收对象中: 100% (77919/77919), 19.09 MiB | 2.03 MiB/s, 完成.
处理 delta 中: 100% (64599/64599), 完成.
正克隆到 '/home/ooo/work/mupdf/thirdparty/lcms2'...
remote: Counting objects: 5552, done.        
remote: Compressing objects: 100% (3675/3675), done.        
remote: Total 5552 (delta 4143), reused 2452 (delta 1830)        
接收对象中: 100% (5552/5552), 68.48 MiB | 1.57 MiB/s, 完成.
处理 delta 中: 100% (4143/4143), 完成.

In the mupdf directory, update the third party libraries:

  1. git submodule update --init
git submodule update --init
正克隆到 '/home/ooo/work/mupdf/thirdparty/freeglut'...
正克隆到 '/home/ooo/work/mupdf/thirdparty/harfbuzz'...
正克隆到 '/home/ooo/work/mupdf/thirdparty/jbig2dec'...
子模组路径 'thirdparty/curl':检出 'f43c6fbb2dbdf68dfdd0f0c3399e3711a621614a'
子模组路径 'thirdparty/freeglut':检出 '9e964132a7d4117adde040291bba878af7fe90c6'
子模组路径 'thirdparty/freetype':检出 '53073ed7966e0fe648a96861a640fad0a4ef7aee'
子模组路径 'thirdparty/gumbo-parser':检出 '3973c58d759574f2899528d2b3379e17d66dbcad'
子模组路径 'thirdparty/harfbuzz':检出 '3a74ee528255cc027d84b204a87b5c25e47bff79'
子模组路径 'thirdparty/jbig2dec':检出 '429b6ab2e29b346f34da9156f423c98117fa5ae4'
子模组路径 'thirdparty/lcms2':检出 'a8e6365459383c25453c57025ca593cc93f8b51a'
子模组路径 'thirdparty/libjpeg':检出 '9a532f2d544f218c8a237ebb56d09e24161c196c'
子模组路径 'thirdparty/mujs':检出 '90aca80865e28a1b9be9bc5ef1118438f62e4f8f'

Compiling on Windows
On Windows there is a Visual Studio project file in platform/win32/mupdf.vcproj.

Compiling on Linux
If you are compiling from source you will need several third party libraries: freetype2, jbig2dec, libjpeg, openjpeg, and zlib. These libraries are contained in the source archive. If you are using git, they are included as git submodules.

You will also need the X11 headers and libraries if you're building on Linux. These can typically be found in the xorg-dev package. Alternatively, if you only want the command line tools, you can build with HAVE_X11=no.

The new OpenGL-based viewer also needs OpenGL headers and libraries. If you're building on Linux, install the mesa-common-dev, libgl1-mesa-dev packages, and libglu1-mesa-dev packages. You'll also need several X11 development packages: xorg-dev, libxcursor-dev, libxrandr-dev, and libxinerama-dev. To skip building the OpenGL viewer, build with HAVE_GLUT=no.

sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev xorg-dev libxrandr-dev libxinerama-dev g++

To install the viewer, command line tools, libraries, and header files on your system:

make prefix=/usr/local install

编译前一定要检查第三方库资源是不是下载全了
To install only the command line tools, libraries, and headers invoke make like this:

make HAVE_X11=no HAVE_GLUT=no prefix=/usr/local install

最后编译成功,编译系统UOS2.0 sp1专业版,amd64架构

Arm64架构银河麒麟

原文地址:https://www.cnblogs.com/nightnine/p/12768993.html