Android平台
1.安裝Cygwin,根據電腦平台選擇下載程序
2.Cygwin安裝 make和g++
3.運行Cygwin Terminal ,cd到mupdf下載目錄
4.make generate
運行完畢,會有generated目錄生成
5.通過Android Studio下載NDK
6.cmd中輸入
E:\Users\Administrator\AppData\Local\ndk\21.1.6352462\ndk-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:
- git clone --recursive git://git.ghostscript.com/mupdf.git 或者直接去下載完整包https://mupdf.com/downloads/
就這一步就卡在這里很久了,最終在梯子的幫助下下載完全了
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:
- 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架構銀河麒麟