10 usage: $0 [-F] [-b build-type] [-O] [-n] [mudir]
13 -b: MuPDF's build type [default native]
14 -O: use ocamlfind for lablGL discovery
15 -n: use native OCaml compiler (bytecode otherwise)
17 build-type = debug|release|native
18 mudir = path to MuPDF's git checkout
23 while getopts nFb
:O opt
; do
25 F
) fontconfig
=true
; cflags
="$cflags -DUSE_FONTCONFIG";;
26 b
) buildtype
="$OPTARG";;
35 test -e "$mupdf" || usage
"Don't know where to find MuPDF's git checkout" 1
37 pkgs
="freetype2 zlib openssl" # j(peg|big2dec)?
38 test $fontconfig && pkgs
="$pkgs fontconfig" || true
41 expr >/dev
/null
"$0" : "/.*" && {
44 helpcmdl
=" -f $(dirname $path)/build.ninja"
51 builddir
=$
(cd $builddir >/dev
/null
$builddir && pwd -P)
53 libs
="$(pkg-config --libs $pkgs) -ljpeg -ljbig2dec -lopenjpeg"
56 lablgldir
="$(ocamlfind query lablgl)" ||
exit 1
57 lablglcflags
="-I $lablgldir"
59 lablglcflags
="-I +lablGL"
63 cflags=$cflags -O $(pkg-config --cflags $pkgs)
65 srcdir=$(cd >/dev/null $(dirname $0) && pwd -P)
69 lablglcflags=$lablglcflags
71 test $
(uname
-m) = "x86_64" && echo 'cflags=$cflags -fPIC'
72 test -e $mupdf/build
/$buildtype/libmujs.a
&& echo 'mujs=-lmujs'
76 echo "ocamlc=ocamlopt.opt"
77 echo "linksocclib=-cclib"
82 echo "ocamlc=ocamlc.opt"
84 echo "customflag=-custom"
89 Configuration results are saved in $(pwd -P)/.config
90 To build - type: ninja$helpcmdl