2018-12-01 13:14:24 +01:00
|
|
|
diff --git a/build.bash b/build.bash
|
2019-09-12 10:13:36 +02:00
|
|
|
index 7c278b6..41494c5 100755
|
2018-12-01 13:14:24 +01:00
|
|
|
--- a/build.bash
|
|
|
|
+++ b/build.bash
|
|
|
|
@@ -29,7 +29,6 @@ srcd="$(dirname $0)"
|
|
|
|
mudir=$outd/mupdf
|
|
|
|
muinc="-I $mudir/include -I $mudir/thirdparty/freetype/include"
|
|
|
|
|
|
|
|
-test -d "$mudir" || die muPDF not found, consult $(dirname $0)/BUILDING
|
|
|
|
|
|
|
|
mkdir -p $outd/{$wsid,lablGL}
|
|
|
|
:>$outd/ordered
|
|
|
|
@@ -39,12 +38,6 @@ isfresh() { test -r "$1.past" && . "$1.past" && test "$k" = "$2"; }
|
2019-09-12 10:13:36 +02:00
|
|
|
mbt=${mbt:-native}
|
2018-12-01 13:14:24 +01:00
|
|
|
mulibs="$mudir/build/$mbt/libmupdf.a" # $mudir/build/$mbt/libmupdf-third.a
|
|
|
|
|
2019-09-12 10:13:36 +02:00
|
|
|
-keycmd="(cd $mudir && make -q build=$mbt libs && echo); digest $mulibs"
|
2018-12-01 13:14:24 +01:00
|
|
|
-isfresh "$mulibs" "$(eval $keycmd)" || (
|
|
|
|
- make -C "$mudir" build=$mbt -j $mjobs libs
|
2020-06-06 13:33:00 +02:00
|
|
|
- eval $keycmd >$mudir/build/$mbt/libmupdf.a.past
|
2018-12-01 13:14:24 +01:00
|
|
|
-) && vecho "fresh mupdf"
|
|
|
|
-
|
|
|
|
oincs() {
|
|
|
|
local i=
|
|
|
|
local incs1=
|
2020-06-06 13:33:00 +02:00
|
|
|
@@ -89,34 +82,6 @@ mflags() {
|
2018-12-01 13:14:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
overs="$(ocamlc -vnum 2>/dev/null)" || overs=""
|
2020-06-06 13:33:00 +02:00
|
|
|
-test "$overs" = "4.10.0" || {
|
|
|
|
- url=https://caml.inria.fr/pub/distrib/ocaml-4.10/ocaml-4.10.0.tar.xz
|
2018-12-01 13:14:24 +01:00
|
|
|
- txz=$outd/$(basename $url)
|
2020-06-06 13:33:00 +02:00
|
|
|
- keycmd="printf $url; digest $txz;"
|
|
|
|
- isfresh $txz "$(eval $keycmd)" || {
|
2018-12-01 13:14:24 +01:00
|
|
|
- executable_p() { command -v "$1" >/dev/null 2>&1; }
|
|
|
|
- if executable_p wget; then dl() { wget -q "$1" -O "$2"; }
|
|
|
|
- elif executable_p curl; then dl() { curl -L "$1" -o "$2"; }
|
|
|
|
- else die "no program to fetch remote urls found"
|
|
|
|
- fi
|
|
|
|
- dl $url $txz
|
2020-06-06 13:33:00 +02:00
|
|
|
- eval $keycmd >$txz.past
|
2018-12-01 13:14:24 +01:00
|
|
|
- } && vecho "fresh $txz"
|
|
|
|
- absprefix=$(cd $outd &>/dev/null; pwd -P)
|
|
|
|
- export PATH=$absprefix/bin:$PATH
|
2020-06-06 13:33:00 +02:00
|
|
|
- ocamlc=$absprefix/bin/ocamlc
|
|
|
|
- keycmd="printf $url; digest $ocamlc;"
|
|
|
|
- isfresh $ocamlc "$(eval $keycmd)" || (
|
2018-12-01 13:14:24 +01:00
|
|
|
- tar xf $txz -C $outd
|
|
|
|
- bn=$(basename $url)
|
|
|
|
- cd $outd/${bn%.tar.xz}
|
2020-06-06 13:33:00 +02:00
|
|
|
- ./configure --disable-ocamldoc --enable-debugger=no --prefix=$absprefix
|
2018-12-01 13:14:24 +01:00
|
|
|
- make -j $mjobs world
|
|
|
|
- make install
|
2020-06-06 13:33:00 +02:00
|
|
|
- eval $keycmd >$absprefix/bin/ocamlc.past
|
2018-12-01 13:14:24 +01:00
|
|
|
- ) && vecho "fresh ocamlc"
|
|
|
|
- overs=$(ocamlc -vnum 2>/dev/null)
|
|
|
|
-}
|
|
|
|
|
2020-06-06 13:33:00 +02:00
|
|
|
ccomp=${LLPP_CC-$(ocamlc -config | grep "^c_compiler: " | \
|
|
|
|
{ read _ c; echo $c; })}
|
|
|
|
@@ -230,7 +195,7 @@ bobjc() {
|
2018-12-01 13:14:24 +01:00
|
|
|
} && vecho "fresh $o"
|
|
|
|
}
|
|
|
|
|
|
|
|
-ver=$(cd $srcd && git describe --tags --dirty) || ver=unknown
|
|
|
|
+ver=@version@
|
|
|
|
|
|
|
|
cmd="(. $srcd/genconfstr.sh >$outd/confstruct.ml)"
|
|
|
|
keycmd="digest $srcd/genconfstr.sh $outd/confstruct.ml"
|
2020-06-06 13:33:00 +02:00
|
|
|
@@ -284,7 +249,7 @@ for m in ml_gl ml_glarray ml_raw; do
|
2018-12-01 13:14:24 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
libs="str.cma unix.cma"
|
|
|
|
-clibs="-L$mudir/build/$mbt -lmupdf -lmupdf-third -lpthread"
|
|
|
|
+clibs="-lmupdf -lfreetype -lpthread"
|
|
|
|
if $darwin; then
|
|
|
|
mcomp=$(ocamlc -config | grep bytecomp_c_co | { read _ c; echo $c; })
|
|
|
|
clibs="$clibs -framework Cocoa -framework OpenGL"
|