Change to the directory that contains bootstrap.sh
[llpp.git] / misc / bootstrap.sh
blob68e8f57a0daa17360e8e3fba656c6dbc2ef19a32
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 cd "$(dirname $0)"
13 mkdir -p bootstrap
14 prefix=$PWD/bootstrap
16 true && {
17 url=http://caml.inria.fr/pub/distrib/ocaml-4.06/ocaml-4.06.1.tar.xz
18 xz=$(basename $url)
19 test -e $xz || dl $url $xz
20 tar xf $xz
21 cd ${xz%.tar.xz}
22 ./configure -prefix $prefix
23 make -j4 world -s
24 make install
25 cd ..
28 cd ..
29 test -d mupdf || {
30 rmudir=$HOME/x/rcs/git/mupdf
31 if test -d $rmudir ; then
32 ref="--reference $rmudir"
33 else
34 ref=""
36 git clone --recursive $ref git://git.ghostscript.com/mupdf.git
37 cd mupdf
38 git checkout 4a7822d6750ecb6e0b63f4357738dc20ecaa58f6
39 git submodule update --recursive
40 cd -
41 make -C mupdf build=native -j4 libs
43 PATH=$prefix/bin:$PATH sh ./build.sh build-strap