Remove stray grep
[llpp.git] / buildall.sh
blob97ae6821dadafd72f7f70d0e8268c5c49161c357
1 # builds "hard" prerequisites and llpp
2 set -e
4 use_sumatrapdf_patched_mupdf=true
6 mkdir -p 3rdp
7 cd 3rdp
9 root=$(pwd)
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 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
24 else
25 wget $mupdf && tar xf $(basename $mupdf)
29 mkdir -p $root/bin
30 mkdir -p $root/lib
31 mkdir -p $root/include
33 (cd openjpeg \
34 && make dist \
35 && cp dist/*.h $root/include/ \
36 && cp dist/*.a $root/lib/)
38 (cd jbig2dec \
39 && (test -f Makefile || (test -f configure || sh autogen.sh --prefix=$root \
40 && ./configure --prefix=$root)) \
41 && make install && rm -f $root/lib/*.so*)
43 (cd lablgl \
44 && cat Makefile.config.linux.mdk > Makefile.config \
45 && make glut glutopt \
46 && make install \
47 BINDIR=$root/bin \
48 LIBDIR=$root/lib/ocaml \
49 DLLDIR=$root/lib/ocaml/stublibs \
50 INSTALLDIR=$root/lib/ocaml/lablGL)
52 export CPATH=$CPATH:$root/include:$root/mupdf/mupdf:$root/mupdf/fitz
53 export LIBRARY_PATH=$LIBRARY_PATH:$root/lib:$root/mupdf/build/release
55 (cd mupdf && make build=release)
57 cd ..
59 srcpath=$(dirname $0)
61 cclib="-lmupdf -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype"
62 ocamlc -c -o link.o -ccopt -O $srcpath/link.c
63 ocamlc -c -o main.cmo -I $root/lib/ocaml/lablGL $srcpath/main.ml
65 ocamlc -custom -o llpp \
66 -I $root/lib/ocaml/lablGL \
67 str.cma unix.cma lablgl.cma lablglut.cma \
68 link.o \
69 -cclib "$cclib" \
70 main.cmo