Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to build with static libmupdf #12

Open
fstecker opened this issue Apr 11, 2024 · 1 comment
Open

Allow to build with static libmupdf #12

fstecker opened this issue Apr 11, 2024 · 1 comment

Comments

@fstecker
Copy link
Collaborator

fstecker commented Apr 11, 2024

@Sfinx reported in #6 (comment) that llpp doesn't build with the newest version of mupdf in its default configuration and suggested the following patch

diff --git a/build.bash b/build.bash
index 7830f6c..efdb9d0 100755
--- a/build.bash
+++ b/build.bash
@@ -275,7 +275,7 @@ for m in ml_gl ml_glarray ml_raw; do
 done

 libs="str.cma unix.cma"
-clibs="-ljbig2dec $(pkg-config --libs "${mudeps[@]}") -lmupdf -lpthread"
+clibs="-ljbig2dec $(pkg-config --libs "${mudeps[@]}") -lmupdf -lz -lmupdf-third -lpthread"
 if $darwin; then
     mcomp=$ccomp
     clibs+=" -framework Cocoa -framework OpenGL"

However, on my system building works without the patch, and breaks with it, as I have no libmupdf-third. It seems to me that the difference is whether libmupdf is compiled as a static library (which is the default for libmupdf, and then libmupdf-third is needed) or as a dynamic library (which seems to be the case eg. in Arch Linux, and then there is no libmupdf-third)

The build script should probably detect whether libmupdf is a static or dynamic library (or just whether libmupdf-third is present on the system) and accordingly add -lmupdf-third or not. I'm also still not sure what libmupdf-third actually contains.

@Sfinx
Copy link

Sfinx commented Apr 11, 2024

mupdf-third from mupdf git contains extract_* functions that are used in libmupdf.a(output-docx.o) file so you will have link errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants