Initial
[llpp.git] / misc / bootstrap.sh
blob36d104373057c621dfd5bf07b94d9b51d6a0bdc6
1 #!/bin/sh
2 set -e
4 executable_p() { command -v "$1" >/dev/null 2>&1; }
5 die() { echo "$1" >&2; exit 1; }
7 if executable_p wget; then dl() { wget -q $1 -O $2; }
8 elif executable_p curl; then dl() { curl $1 -o $2; }
9 else die "no program to fetch remote urls found"
12 mkdir -p bootstrap
13 prefix=$PWD/bootstrap
15 true && {
16 url=http://caml.inria.fr/pub/distrib/ocaml-4.06/ocaml-4.06.1.tar.xz
17 xz=$(basename $url)
18 test -e $xz || dl $url $xz
19 tar xf $xz
20 cd ${xz%.tar.xz}
21 ./configure -prefix $prefix
22 make -j4 world -s
23 make install
24 cd ..
27 cd ..
28 test -d mupdf || {
29 rmudir=$HOME/x/rcs/git/mupdf
30 if test -d $rmudir ; then
31 ref="--reference $rmudir"
32 else
33 ref=""
35 git clone --recursive $ref git://git.ghostscript.com/mupdf.git
36 cd mupdf
37 git checkout 4a7822d6750ecb6e0b63f4357738dc20ecaa58f6
38 git submodule update --recursive
39 cd -
40 make -C mupdf build=native -j4 libs
42 PATH=$prefix/bin:$PATH sh ./build.sh build-strap