1 # builds "hard" prerequisites and llpp
5 while getopts j
: opt
; do
9 printf "usage: $0 [-j N] [opt]\n";
13 shift $
(($OPTIND - 1))
19 lablgl
=http
://wwwfun.kurims.kyoto-u.ac.jp
/soft
/lsl
/dist
/lablgl-1.04.
tar.gz
20 mupdf3p
=http
://mupdf.com
/download
/mupdf-thirdparty-2012-01-27.
zip
21 mupdfrev
=bbfe635555dce16858403706e2031dd3bfa1a9f1
23 test -d lablGL-1.04 ||
(wget
-nc $lablgl && tar -xzf lablgl-1.04.
tar.gz
)
24 if ! test -f mupdf-
$mupdfrev.tgz
; then
26 "http://git.ghostscript.com/?p=mupdf.git;a=snapshot;h=$mupdfrev;sf=tgz" \
27 -O mupdf-
$mupdfrev.tgz
28 tar xfz mupdf-
$mupdfrev.tgz
31 test -d mupdf
/thirdparty || \
32 (wget
-nc $mupdf3p && unzip -d mupdf $
(basename $mupdf3p))
35 command -v $1 >/dev
/null
2>&1
38 executable_p gmake
&& make=gmake ||
make=make
41 && sed 17d Makefile.config.linux.mdk
> Makefile.config \
45 LIBDIR
=$root/lib
/ocaml \
46 DLLDIR
=$root/lib
/ocaml
/stublibs \
47 INSTALLDIR
=$root/lib
/ocaml
/lablGL
)
49 (cd mupdf
&& $make -j "$jobs" build
=release
)
55 sh
$srcpath/mkhelp.sh
$srcpath/keystoml.ml
$srcpath/KEYS
> help.ml
57 tp
=$root/mupdf
/thirdparty
60 ccopt
="$ccopt -I $tp/jbig2dec"
61 ccopt
="$ccopt -I $tp/jpeg-8d"
62 ccopt
="$ccopt -I $tp/freetype-2.4.8/include"
63 ccopt
="$ccopt -I $tp/openjpeg-1.4/libopenjpeg"
64 ccopt
="$ccopt -I $tp/zlib-1.2.5"
65 ccopt
="$ccopt -I $root/mupdf/fitz -I $root/mupdf/pdf -I $root/mupdf/xps"
66 ccopt
="$ccopt -I $root/mupdf/cbz"
68 ccopt
="$ccopt -include ft2build.h -D_GNU_SOURCE"
70 cclib
="$cclib -L$root/mupdf/build/release"
72 cclib
="$cclib -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype"
76 if test "$1" = "opt"; then
77 cclib
="$cclib -lpthread"
78 executable_p ocamlopt.opt
&& comp
=ocamlopt.opt || comp
=ocamlopt
79 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
80 $comp -c -o help.cmx
help.ml
81 $comp -c -o wsi.cmi
$srcpath/wsi.mli
82 $comp -c -o wsi.cmx
$srcpath/wsi.ml
83 $comp -c -o parser.cmx
$srcpath/parser.ml
84 $comp -c -o main.cmx
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
87 -I $root/lib
/ocaml
/lablGL \
88 str.cmxa unix.cmxa lablgl.cmxa \
96 executable_p ocamlc.opt
&& comp
=ocamlc.opt || comp
=ocamlc
97 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
98 $comp -c -o help.cmo
help.ml
99 $comp -c -o wsi.cmi
$srcpath/wsi.mli
100 $comp -c -o wsi.cmo
$srcpath/wsi.ml
101 $comp -c -o parser.cmo
$srcpath/parser.ml
102 $comp -c -o main.cmo
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
104 $comp -custom -o llpp \
105 -I $root/lib
/ocaml
/lablGL \
106 str.cma unix.cma lablgl.cma \