Skip to content

Allow to build with static libmupdf #12

@fstecker

Description

@fstecker

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions