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
=a1a37ae36043d8dba89cecfa345119ad32f81b9e
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 lib $
(test "$1" = opt
&& echo libopt
) \
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 sh
$srcpath/mkhelp.sh
$srcpath/keystoml.ml
$srcpath/KEYS
> help.ml
62 tp
=$root/$mudir/thirdparty
65 ccopt
="$ccopt -I $tp/jbig2dec"
66 ccopt
="$ccopt -I $tp/jpeg-8d"
67 ccopt
="$ccopt -I $tp/freetype-2.4.10/include"
68 ccopt
="$ccopt -I $tp/openjpeg-1.4/libopenjpeg"
69 ccopt
="$ccopt -I $tp/zlib-1.2.5"
70 ccopt
="$ccopt -I $root/$mudir/fitz -I $root/$mudir/pdf -I $root/$mudir/xps"
71 ccopt
="$ccopt -I $root/$mudir/cbz"
73 ccopt
="$ccopt -include $tp/freetype-2.4.10/include/ft2build.h -D_GNU_SOURCE"
75 cclib
="$cclib -L$root/$mudir/build/release"
77 cclib
="$cclib -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype -lpthread"
81 if test "$1" = "opt"; then
82 executable_p ocamlopt.opt
&& comp
=ocamlopt.opt || comp
=ocamlopt
86 -I $root/lib
/ocaml
/lablGL \
87 str.cmxa unix.cmxa lablgl.cmxa \
96 executable_p ocamlc.opt
&& comp
=ocamlc.opt || comp
=ocamlc
99 $comp -custom -o llpp \
100 -I $root/lib
/ocaml
/lablGL \
101 str.cma unix.cma lablgl.cma \
111 $comp -c -o link.o
-ccopt "$ccopt" $srcpath/link.c
112 $comp -c -o help.
$cmsuf help.ml
113 $comp -c -o wsi.cmi
$srcpath/wsi.mli
114 $comp -c -o wsi.
$cmsuf $srcpath/wsi.ml
115 $comp -c -o parser.
$cmsuf $srcpath/parser.ml
116 $comp -c -o main.
$cmsuf -I $root/lib
/ocaml
/lablGL
$srcpath/main.ml