1 # builds "hard" prerequisites and llpp
4 use_sumatrapdf_patched_mupdf
=true
11 openjpeg
=http
://openjpeg.googlecode.com
/svn
/trunk
/
12 jbig2dec
=git
://git.ghostscript.com
/jbig2dec.git
13 lablgl
=:pserver
:anoncvs@camlcvs.inria.fr
:/caml
14 mupdf
=http
://mupdf.com
/download
/snapshots
/mupdf-r1300.
tar.gz
15 sumatrapdf
=http
://sumatrapdf.googlecode.com
/svn
/trunk
17 test -d openjpeg || svn
-r r608 checkout
$openjpeg openjpeg
18 test -d jbig2dec || git clone
$jbig2dec jbig2dec
19 test -d lablgl || cvs
-d $lablgl co
-d lablgl bazar-ocaml
/lablGL
21 if ! test -d mupdf
; then
22 if $use_sumatrapdf_patched_mupdf; then
23 svn checkout
$sumatrapdf/mupdf mupdf
25 wget
$mupdf && tar xf $
(basename $mupdf)
31 mkdir
-p $root/include
35 && cp dist
/*.h
$root/include
/ \
36 && cp dist
/*.a
$root/lib
/)
39 && make -f Makefile.unix
install prefix
=$root && rm -f $root/lib
/*.so
*)
42 && cat Makefile.config.linux.mdk
> Makefile.config \
43 && make glut glutopt \
46 LIBDIR
=$root/lib
/ocaml \
47 DLLDIR
=$root/lib
/ocaml
/stublibs \
48 INSTALLDIR
=$root/lib
/ocaml
/lablGL
)
50 export CPATH
=$CPATH:$root/include
:$root/mupdf
/mupdf
:$root/mupdf
/fitz
51 export LIBRARY_PATH
=$LIBRARY_PATH:$root/lib
:$root/mupdf
/build
/release
53 (cd mupdf
&& make build
=release
)
59 if test "$1" = "opt"; then
60 cclib
="-lmupdf -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype -lpthread"
61 ocamlopt
-c -o link.o
-ccopt -O $srcpath/link.c
62 ocamlopt
-c -o main.cmo
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
65 -I $root/lib
/ocaml
/lablGL \
66 str.cmxa unix.cmxa lablgl.cmxa lablglut.cmxa \
71 cclib
="-lmupdf -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype"
72 ocamlc
-c -o link.o
-ccopt -O $srcpath/link.c
73 ocamlc
-c -o main.cmo
-I $root/lib
/ocaml
/lablGL
$srcpath/main.ml
75 ocamlc
-custom -o llpp \
76 -I $root/lib
/ocaml
/lablGL \
77 str.cma unix.cma lablgl.cma lablglut.cma \