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
=386c713b83f8788a80bb165431bf598b982385b3
22 mudir
=mupdf-$
(printf "%.7s" $mupdfrev)
23 mutgz
=mupdf-
$mupdfrev.tgz
24 muurl
="http://git.ghostscript.com/?p=mupdf.git;a=snapshot;h=$mupdfrev;sf=tgz"
26 test -d lablGL-1.04 ||
(wget
-nc $lablgl && tar -xzf lablgl-1.04.
tar.gz
)
28 test -e $mutgz || wget
-nc $muurl -O $mutgz
29 test -e $
(basename $mupdf3p) || wget
-nc $mupdf3p
30 test -d $mudir ||
tar -xzf $
(basename $mutgz)
31 test -d $mudir/thirdparty
/openjpeg-1.5
.0-patched || \
32 unzip -o -d $mudir $
(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 \
42 && $make -j 1 lib $
(test "$1" = opt
&& echo libopt
) \
43 && $make -j 1 install \
45 LIBDIR
=$root/lib
/ocaml \
46 DLLDIR
=$root/lib
/ocaml
/stublibs \
47 INSTALLDIR
=$root/lib
/ocaml
/lablGL
)
49 (cd $mudir && $make -j "$jobs" build
=release \
50 FREETYPE_DIR
=thirdparty
/freetype-2.4
.10 \
51 JBIG2DEC_DIR
=thirdparty
/jbig2dec \
52 JPEG_DIR
=thirdparty
/jpeg-9 \
53 OPENJPEG_DIR
=thirdparty
/openjpeg-1.5
.0-patched \
54 ZLIB_DIR
=thirdparty
/zlib-1.2
.7)
60 tp
=$root/$mudir/thirdparty
63 ccopt
="$ccopt -I $tp/jbig2dec"
64 ccopt
="$ccopt -I $tp/jpeg-8d"
65 ccopt
="$ccopt -I $tp/freetype-2.4.10/include"
66 ccopt
="$ccopt -I $tp/openjpeg-1.4/libopenjpeg"
67 ccopt
="$ccopt -I $tp/zlib-1.2.5"
68 ccopt
="$ccopt -I $root/$mudir/fitz -I $root/$mudir/pdf -I $root/$mudir/xps"
69 ccopt
="$ccopt -I $root/$mudir/cbz"
71 ccopt
="$ccopt -include $tp/freetype-2.4.10/include/ft2build.h -D_GNU_SOURCE"
73 cclib
="$cclib -L$root/$mudir/build/release"
75 cclib
="$cclib -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype -lpthread"
80 sh
$srcpath/mkhelp.sh
$srcpath/keystoml.ml
$srcpath/KEYS
> help.ml
82 if test "$1" = "opt"; then
83 executable_p ocamlopt.opt
&& comp
=ocamlopt.opt || comp
=ocamlopt
87 -I $root/lib
/ocaml
/lablGL \
88 str.cmxa unix.cmxa lablgl.cmxa \
97 executable_p ocamlc.opt
&& comp
=ocamlc.opt || comp
=ocamlc
100 $comp -custom -o llpp \
101 -I $root/lib
/ocaml
/lablGL \
102 str.cma unix.cma lablgl.cma \
112 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
113 $comp -c -o help.
$cmsuf help.ml
114 $comp -c -o wsi.cmi
$srcpath/wsi.mli
115 $comp -c -o wsi.
$cmsuf $srcpath/wsi.ml
116 $comp -c -o parser.
$cmsuf $srcpath/parser.ml
117 $comp -c -o main.
$cmsuf -I $root/lib
/ocaml
/lablGL
$srcpath/main.ml