У меня не так много опыта в этом деле, так что подскажите как правильно сделать. Итак, нужно собрать
MuPDF, скачал архив с последней версией, вот выдержка из
README:
COMPILING
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 and libgl1-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_GLFW=no.
INSTALLING (UNIX)
Typing "make prefix=/usr/local install" will install the binaries, man-pages,
static libraries and header files on your system.
Мне нужен только набор консольных утилит, сам просмотрщик не нужен. Я так понимаю для этого дополнительно ничего устанавливать не надо, нужно лишь указать
HAVE_X11=no. Собственно в этом и заключаются трудности. Есть три файла - Makefile, Makethird и Makerules.
В
Makefile есть такие строчки:
ifeq "$(HAVE_X11)" "yes"
MUVIEW_X11 := $(OUT)/mupdf-x11
MUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
$(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR)
$(MUVIEW_X11) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
$(LINK_CMD) $(X11_LIBS)
В
Makethird такие:
# --- X11 ---
ifeq "$(HAVE_X11)" "yes"
X11_CFLAGS := $(SYS_X11_CFLAGS)
X11_LIBS := $(SYS_X11_LIBS)
endif
и в
Makerules такие:
# Linux uses pkg-config for system libraries.
else ifeq "$(OS)" "Linux"
HAVE_PTHREADS ?= yes
ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
HAVE_X11 = yes
SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext)
SYS_X11_LIBS = $(shell pkg-config --libs x11 xext)
endif
**********************************************************
# TODO: If crosscompiling, why not just call "make libs" instead of this exception?
ifeq "$(CROSSCOMPILE)" "yes"
HAVE_X11 ?= no
HAVE_GLFW ?= no
endif
в
Makerules есть еще такие строчки, но я так понимаю здесь можно оставить как есть:
# Windows (MINGW) build doesn't use system libraries.
ifeq "$(OS)" "MINGW"
WINDRES = windres
HAVE_X11 ?= no
HAVE_WIN32 = yes
CC=gcc
# Add flags required for Harfbuzz because of missing strdup
CFLAGS+= -U__STRICT_ANSI__
# Mac OS X doesn't have pkg-config so we hard code paths.
else ifeq "$(OS)" "MACOS"
HAVE_X11 ?= no
HAVE_PTHREADS ?= yes
Где конкретно нужно указывать
HAVE_X11=no? Можно ли просто задать этот параметр в команде, например так:
sudo make HAVE_X11=no prefix=/usr/local install