Cosmetics
[llpp.git] / tbs
blobf46857692bea0ec436aec0e85b382142181083ee
1 #!/bin/sh
3 #set -x
4 set -e
6 h=$(readlink -f $(dirname $0))
7 t=$(readlink -f ..)/tbs
8 d=MD5
10 export OCAMLRUNPARAM=b
12 if test $h = $PWD; then
13 mkdir -p build
14 cd build
17 if ! md5sum --status -c $d; then
18 md5sum $h/build.ml $h/tbs $t/tbs.cma >$d.tmp
19 ocamlc.opt -o build.cmo -c -g -I $t $h/build.ml
20 ocamlc.opt -g -thread -I $t unix.cma threads.cma tbs.cma build.cmo -o b
21 mv $d.tmp $d
24 mupdf=/home/malc/x/rcs/git/mupdf
25 ccopt="-std=c89 -Wall -Werror"
26 ccopt="$ccopt -I$mupdf/fitz -I$mupdf/pdf -I$mupdf/xps -I$mupdf/cbz"
27 ccopt="$ccopt $(freetype-config --cflags) -include ft2build.h"
28 targets="llpp"
29 libs="-lfitz"
30 libs="$libs -lopenjpeg -ljbig2dec -ljpeg -lz -lfreetype -lX11"
31 if test $(hostname) = "linmac"; then
32 cc=gcc-4.6.0
33 #ccopt="$ccopt -maltivec -O -D_GNU_SOURCE"
34 ccopt="$ccopt -maltivec -D_GNU_SOURCE -DOBSCURED_OPT"
35 else
36 cc=cc
37 ccopt="$ccopt -O -D_GNU_SOURCE -fPIC"
40 lpath=$mupdf/build/release
42 ./b -O src:$h -r -O ccopt:"$ccopt" -O cc:"$cc" \
43 -O "mupdflibpath:$lpath" \
44 -O "libs:$libs" \
45 $* $targets