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
/archive
/mupdf-thirdparty-2012-08-14.
zip
21 mupdfrev
=6e7b3abc34267f351810bb7b01dafa9586cdd9c8
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 \
43 && $make lib $
(test "$1" = opt
&& echo libopt
) \
46 LIBDIR
=$root/lib
/ocaml \
47 DLLDIR
=$root/lib
/ocaml
/stublibs \
48 INSTALLDIR
=$root/lib
/ocaml
/lablGL
)
51 (cd $mudir && $make -j "$jobs" build
=release
)
57 sh
$srcpath/mkhelp.sh
$srcpath/keystoml.ml
$srcpath/KEYS
> help.ml
59 tp
=$root/$mudir/thirdparty
62 ccopt
="$ccopt -I $tp/jbig2dec"
63 ccopt
="$ccopt -I $tp/jpeg-8d"
64 ccopt
="$ccopt -I $tp/freetype-2.4.10/include"
65 ccopt
="$ccopt -I $tp/openjpeg-1.4/libopenjpeg"
66 ccopt
="$ccopt -I $tp/zlib-1.2.5"
67 ccopt
="$ccopt -I $root/$mudir/fitz -I $root/$mudir/pdf -I $root/$mudir/xps"
68 ccopt
="$ccopt -I $root/$mudir/cbz"
70 ccopt
="$ccopt -include $tp/freetype-2.4.10/include/ft2build.h -D_GNU_SOURCE"
72 cclib
="$cclib -L$root/$mudir/build/release"
74 cclib
="$cclib -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype -lpthread"
78 if test "$1" = "opt"; then
79 executable_p ocamlopt.opt
&& comp
=ocamlopt.opt || comp
=ocamlopt
83 -I $root/lib
/ocaml
/lablGL \
84 str.cmxa unix.cmxa lablgl.cmxa \
86 -cclib "$cclib -lpthread" \
93 executable_p ocamlc.opt
&& comp
=ocamlc.opt || comp
=ocamlc
96 $comp -custom -o llpp \
97 -I $root/lib
/ocaml
/lablGL \
98 str.cma unix.cma lablgl.cma \
108 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
109 $comp -c -o help.
$cmsuf help.ml
110 $comp -c -o wsi.cmi
$srcpath/wsi.mli
111 $comp -c -o wsi.
$cmsuf $srcpath/wsi.ml
112 $comp -c -o parser.
$cmsuf $srcpath/parser.ml
113 $comp -c -o main.
$cmsuf -I $root/lib
/ocaml
/lablGL
$srcpath/main.ml