Use filt
[llpp.git] / tbs
blobb1ae23188675ec462a3ad8a41f4ca0fb702393bf
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
16 bdir=$PWD
18 if ! md5sum --status -c $d; then
19 md5sum $h/build.ml $h/tbs $t/tbs.cma >$d.tmp
20 (cd $TMPDIR; ocamlc.opt -o $bdir/build.cmo -c -g -I $t $h/build.ml)
21 ocamlc.opt -g -thread -I $t unix.cma threads.cma tbs.cma build.cmo -o b
22 mv $d.tmp $d
25 mupdf=/home/malc/x/rcs/git/mupdf
26 ccopt="-std=c89 -Wall -Werror"
27 ccopt="$ccopt -I$mupdf/include"
28 ccopt="$ccopt $(freetype-config --cflags) -include ft2build.h"
29 targets="llpp"
30 libs="-lmupdf"
31 libs="$libs -lopenjp2 -ljbig2dec -ljpeg -lz -lfreetype -lX11 -lcrypto"
32 if test $(hostname) = "linmac"; then
33 cc="clang"
34 #cc="gcc-4.9.0"
35 ccopt="$ccopt -maltivec -D_GNU_SOURCE -DOBSCURED_OPT -DFFP -DUSE_FONTCONFIG"
36 else
37 cc=cc
38 ccopt="$ccopt -O -D_GNU_SOURCE -fPIC"
41 lpath=$mupdf/build/native
42 #lpath=$mupdf/build/release
43 #lpath=$mupdf/build/debug
45 ./b -O src:$h -r -O ccopt:"$ccopt" -O cc:"$cc" \
46 -O "mupdflibpath:$lpath" \
47 -O "libs:$libs" \
48 $* $targets