10 usage: $0 [-e] [-b build-type] [mudir]
13 -b: MuPDF's build type [default native]
15 build-type = debug|release|native
16 mudir = path to MuPDF's git checkout
21 while getopts eb
: opt
; do
23 e
) egl
="egl"; cflags
="-DUSE_EGL";;
24 b
) buildtype
="$OPTARG";;
32 usage
"Don't know where to find MuPDF's git checkout" 1
34 pkgs
="freetype2 fontconfig zlib openssl libopenjp2" # j(peg|big2dec)?
35 test -n "$egl" && pkgs
="$pkgs egl" || pkgs
="$pkgs x11"
38 expr "$0" : "/.*" >/dev
/null
&& {
41 helpcmdl
=" -f $(dirname $path)/build.ninja"
47 absbuilddir
=$
(cd >/dev
/null
$builddir && pwd -P)
49 (echo "cflags=$cflags $(pkg-config --cflags $pkgs)"
50 echo "lflags=$(pkg-config --libs $pkgs) -ljbig2dec -ljpeg -lz"
51 echo "srcdir=$(cd >/dev/null $(dirname $0) && pwd -P)"
52 echo "buildtype=$buildtype"
54 echo "builddir=$builddir"
55 echo "absbuilddir=$absbuilddir"
56 test $
(uname
-m) = "x86_64" && {
57 echo 'cflags=$cflags -fPIC'
61 echo "To build - type: ninja$helpcmdl"