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