5 test $
(uname
-m) = "x86_64" && buildtype
=native || buildtype
=release
10 usage: $0 [-F] [-b build-type] [-O] [-n]
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
22 while getopts nFb
:O opt
; do
24 F
) fontconfig
=true
; cflags
="$cflags -DUSE_FONTCONFIG";;
25 b
) buildtype
="$OPTARG";;
33 test $fontconfig && pkgs
="$pkgs fontconfig" || true
36 expr >/dev
/null
"$0" : "/.*" && {
39 helpcmdl
=" -f $(dirname $path)/build.ninja"
46 builddir
=$
(cd $builddir >/dev
/null
$builddir && pwd -P)
48 libs
="$(pkg-config --libs $pkgs)"
51 lablgldir
="$(ocamlfind query lablgl)" ||
exit 1
52 lablglcflags
="-I $lablgldir"
54 lablglcflags
="-I +lablGL"
58 if test $
(uname
-m) = "x86_64"; then
59 cflags
="$cflags -fPIC"
61 if test $buildtype = "native"; then
62 echo "native build type does not work for non x86_64 targets"
66 srcdir
=$
(cd >/dev
/null $
(dirname $0) && pwd -P)
68 cflags=$cflags -O $(pkg-config --cflags $pkgs)
73 lablglcflags=$lablglcflags
75 test -e $srcdir/mupdf
/build
/$buildtype/libmujs.a
&& echo 'mujs=-lmujs'
79 command 2>&1 >/dev
/null
-v ocamlopt.opt
&& optsuf
=".opt" || optsuf
=""
80 echo "ocamlc=ocamlopt$optsuf"
81 echo "linksocclib=-cclib"
86 command 2>&1 >/dev
/null
-v ocamlc.opt
&& optsuf
=".opt" || optsuf
=""
87 echo "ocamlc=ocamlc$optsuf"
89 echo "customflag=-custom"
94 Configuration results are saved in $(pwd -P)/.config
95 To build - type: ninja$helpcmdl