1 # builds "hard" prerequisites and llpp
5 while getopts j
: opt
; do
9 printf "usage: $0 [-j N] [opt]\n";
19 lablgl
=http
://wwwfun.kurims.kyoto-u.ac.jp
/soft
/lsl
/dist
/lablgl-1.04.
tar.gz
20 mupdf
=git
://git.ghostscript.com
/mupdf.git
21 mupdf3p
=http
://mupdf.com
/download
/mupdf-thirdparty-2012-01-27.
zip
22 mupdfrev
=c732cd69db005902289829867a71e0d271809aba
24 test -d lablGL-1.04 ||
(wget
-nc $lablgl && tar -xzf lablgl-1.04.
tar.gz
)
25 if ! test -f mupdf-
$mupdfrev.tgz
; then
27 "http://git.ghostscript.com/?p=mupdf.git;a=snapshot;h=$mupdfrev;sf=tgz" \
28 -O mupdf-
$mupdfrev.tgz
29 tar xfz mupdf-
$mupdfrev.tgz
32 test -d mupdf
/thirdparty || \
33 (wget
-nc $mupdf3p && unzip -d mupdf $
(basename $mupdf3p))
35 make=$
(gmake
-v >/dev
/null
2>&1 && echo gmake ||
echo make)
39 XLIBS = -lX11' Makefile.config.linux.mdk
> Makefile.config \
43 LIBDIR
=$root/lib
/ocaml \
44 DLLDIR
=$root/lib
/ocaml
/stublibs \
45 INSTALLDIR
=$root/lib
/ocaml
/lablGL
)
47 (cd mupdf
&& $make -j "$jobs" build
=release
)
53 sh
$srcpath/mkhelp.sh
$srcpath/keystoml.ml
$srcpath/KEYS
> help.ml
55 tp
=$root/mupdf
/thirdparty
58 ccopt
="$ccopt -I $tp/jbig2dec"
59 ccopt
="$ccopt -I $tp/jpeg-8d"
60 ccopt
="$ccopt -I $tp/freetype-2.4.8/include"
61 ccopt
="$ccopt -I $tp/openjpeg-1.4/libopenjpeg"
62 ccopt
="$ccopt -I $tp/zlib-1.2.5"
63 ccopt
="$ccopt -I $root/mupdf/fitz -I $root/mupdf/pdf -I $root/mupdf/xps"
64 ccopt
="$ccopt -I $root/mupdf/cbz"
66 ccopt
="$ccopt -include ft2build.h -D_GNU_SOURCE"
68 cclib
="$cclib -L$root/mupdf/build/release"
70 cclib
="$cclib -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype"
74 if test "$1" = "opt"; then
75 cclib
="$cclib -lpthread"
76 test -x $
(type -p ocamlopt.opt
) && comp
=ocamlopt.opt || comp
=ocamlopt
77 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
78 $comp -c -o help.cmx
help.ml
79 $comp -c -o wsi.cmi
$srcpath/wsi.mli
80 $comp -c -o wsi.cmx
$srcpath/wsi.ml
81 $comp -c -o parser.cmx
$srcpath/parser.ml
82 $comp -c -o main.cmx
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
85 -I $root/lib
/ocaml
/lablGL \
86 str.cmxa unix.cmxa lablgl.cmxa \
94 test -x $
(type -p ocamlc.opt
) && comp
=ocamlc.opt || comp
=ocamlc
95 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
96 $comp -c -o help.cmo
help.ml
97 $comp -c -o wsi.cmi
$srcpath/wsi.mli
98 $comp -c -o wsi.cmo
$srcpath/wsi.ml
99 $comp -c -o parser.cmo
$srcpath/parser.ml
100 $comp -c -o main.cmo
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
102 $comp -custom -o llpp \
103 -I $root/lib
/ocaml
/lablGL \
104 str.cma unix.cma lablgl.cma \