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-03-07.
zip
21 mupdfrev
=22bbb6e6d3bcd01b164e91ecf500dc9d7305269e
24 test -d lablGL-1.04 ||
(wget
-nc $lablgl && tar -xzf lablgl-1.04.
tar.gz
)
26 if ! test -d $mudir; then
28 "http://git.ghostscript.com/?p=mupdf.git;a=snapshot;h=$mupdfrev;sf=tgz" \
29 -O mupdf-
$mupdfrev.tgz
&& tar -xzf mupdf-
$mupdfrev.tgz
32 test -d $mudir/thirdparty || \
33 (wget
-nc $mupdf3p && unzip -d $mudir $
(basename $mupdf3p))
36 command -v $1 >/dev
/null
2>&1
39 executable_p gmake
&& make=gmake ||
make=make
42 && sed 17d Makefile.config.linux.mdk
> Makefile.config \
46 LIBDIR
=$root/lib
/ocaml \
47 DLLDIR
=$root/lib
/ocaml
/stublibs \
48 INSTALLDIR
=$root/lib
/ocaml
/lablGL
)
50 (cd $mudir && $make -j "$jobs" build
=release
)
56 sh
$srcpath/mkhelp.sh
$srcpath/keystoml.ml
$srcpath/KEYS
> help.ml
58 tp
=$root/$mudir/thirdparty
61 ccopt
="$ccopt -I $tp/jbig2dec"
62 ccopt
="$ccopt -I $tp/jpeg-8d"
63 ccopt
="$ccopt -I $tp/freetype-2.4.8/include"
64 ccopt
="$ccopt -I $tp/openjpeg-1.4/libopenjpeg"
65 ccopt
="$ccopt -I $tp/zlib-1.2.5"
66 ccopt
="$ccopt -I $root/$mudir/fitz -I $root/$mudir/pdf -I $root/$mudir/xps"
67 ccopt
="$ccopt -I $root/$mudir/cbz"
69 ccopt
="$ccopt -include $tp/freetype-2.4.8/include/ft2build.h -D_GNU_SOURCE"
71 cclib
="$cclib -L$root/$mudir/build/release"
73 cclib
="$cclib -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype"
77 if test "$1" = "opt"; then
78 cclib
="$cclib -lpthread"
79 executable_p ocamlopt.opt
&& comp
=ocamlopt.opt || comp
=ocamlopt
80 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
81 $comp -c -o help.cmx
help.ml
82 $comp -c -o wsi.cmi
$srcpath/wsi.mli
83 $comp -c -o wsi.cmx
$srcpath/wsi.ml
84 $comp -c -o parser.cmx
$srcpath/parser.ml
85 $comp -c -o main.cmx
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
88 -I $root/lib
/ocaml
/lablGL \
89 str.cmxa unix.cmxa lablgl.cmxa \
97 executable_p ocamlc.opt
&& comp
=ocamlc.opt || comp
=ocamlc
98 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
99 $comp -c -o help.cmo
help.ml
100 $comp -c -o wsi.cmi
$srcpath/wsi.mli
101 $comp -c -o wsi.cmo
$srcpath/wsi.ml
102 $comp -c -o parser.cmo
$srcpath/parser.ml
103 $comp -c -o main.cmo
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
105 $comp -custom -o llpp \
106 -I $root/lib
/ocaml
/lablGL \
107 str.cma unix.cma lablgl.cma \