1 # builds "hard" prerequisites and llpp
4 while getopts j
:f
: 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.05.
tar.gz
20 baseurl
="http://git.ghostscript.com/"
22 mupdfrev
=67ebe59a41f8b2deaf78dc916c5cd203d3fcc3a3
23 mudir
=mupdf-$
(printf "%.7s" $mupdfrev)
24 mutgz
=mupdf-
$mupdfrev.tgz
25 muurl
="${baseurl}?p=mupdf.git;a=snapshot;h=$mupdfrev;sf=tgz"
27 test -d lablgl-1.05 ||
(wget
-nc $lablgl && tar -xzf lablgl-1.05.
tar.gz
)
28 test -e $mutgz || wget
-nc $muurl -O $mutgz
29 test -d $mudir ||
tar -xzf $mutgz
33 d
=$m-$
(printf "%.7s" $r)
35 test $m = jbig2dec
&& p
=$m || p
=thirdparty
/$m
36 u
="${baseurl}?p=$p.git;a=snapshot;h=$r;sf=tgz"
37 test -e $t || wget
-nc $u -O $t
38 test -e $mudir/thirdparty
/$m/README ||
39 (rm -fr $mudir/thirdparty
/$m && tar -xzf $t && mv $d $mudir/thirdparty
/$m)
43 grep -v -E "$filt" <<-EOF | fetch
44 2ef0a19842ae1172bec153225328aaaeaf130a18 freetype
45 d02b3649334e59e862b37c70d7d0fa9e086a524c jbig2dec
46 219d59dcfd0e6ce8a3d8c5510e29237f0b5078ed jpeg
47 0970aed6e3990f8df7ef1b70cc22d024439b46d2 openjpeg
48 c16b1b18ddaaf090caf321af831bccac6381a381 zlib
52 command -v $1 >/dev
/null
2>&1
55 executable_p gmake
&& make=gmake ||
make=make
58 && sed 17d Makefile.config.linux.mdk
> Makefile.config \
59 && $make lib $
(test "$1" = opt
&& echo libopt
) \
62 LIBDIR
=$root/lib
/ocaml \
63 DLLDIR
=$root/lib
/ocaml
/stublibs \
64 INSTALLDIR
=$root/lib
/ocaml
/lablGL
)
66 (cd $mudir && $make $jobs build
=release
)
72 tp
=$root/$mudir/thirdparty
75 ccopt
="$ccopt -I $tp/jbig2dec"
76 ccopt
="$ccopt -I $tp/jpeg"
77 ccopt
="$ccopt -I $tp/freetype/include"
78 ccopt
="$ccopt -I $tp/openjpeg/libopenjpeg"
79 ccopt
="$ccopt -I $tp/zlib"
80 ccopt
="$ccopt -I $root/$mudir/include"
82 ccopt
="$ccopt -include $tp/freetype/include/ft2build.h -D_GNU_SOURCE"
84 cclib
="$cclib -L$root/$mudir/build/release"
85 cclib
="$cclib -lmupdf -lmupdf-js-none"
86 cclib
="$cclib -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype -lpthread -lcrypto"
91 sh
$srcpath/mkhelp.sh
$srcpath/keystoml.ml
$srcpath/KEYS
> help.ml
93 if test "$1" = "opt"; then
94 executable_p ocamlopt.opt
&& comp
=ocamlopt.opt || comp
=ocamlopt
98 -I $root/lib
/ocaml
/lablGL \
99 str.cmxa unix.cmxa lablgl.cmxa \
109 executable_p ocamlc.opt
&& comp
=ocamlc.opt || comp
=ocamlc
112 $comp -custom -o llpp \
113 -I $root/lib
/ocaml
/lablGL \
114 str.cma unix.cma lablgl.cma \
125 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
126 $comp -c -o help.
$cmsuf help.ml
127 $comp -c -o utils.
$cmsuf $srcpath/utils.ml
128 $comp -c -o wsi.cmi
$srcpath/wsi.mli
129 $comp -c -o wsi.
$cmsuf $srcpath/wsi.ml
130 $comp -c -o parser.
$cmsuf $srcpath/parser.ml
131 $comp -c -o main.
$cmsuf -I $root/lib
/ocaml
/lablGL
$srcpath/main.ml