2007-02-07 01:40:59 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
######################################
|
|
|
|
######### Copied from build/install.sh
|
|
|
|
######################################
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd `dirname $0`/..
|
|
|
|
|
2007-02-11 23:59:44 -08:00
|
|
|
. config/config.sh
|
2007-02-07 01:40:59 -08:00
|
|
|
|
|
|
|
not_installed=$PWD/_build/not_installed
|
|
|
|
|
2007-02-12 02:28:12 -08:00
|
|
|
rm -f "$not_installed"
|
2007-02-07 01:40:59 -08:00
|
|
|
|
|
|
|
wontinstall() {
|
2007-02-12 02:28:12 -08:00
|
|
|
echo "$1" >> "$not_installed"
|
2007-02-07 01:40:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
installbin() {
|
|
|
|
if [ -f "$1" ]; then
|
2007-02-12 02:28:12 -08:00
|
|
|
echo " install binary $2"
|
|
|
|
cp -f "$1" "$2"
|
|
|
|
[ -x "$2" ] || chmod +x "$2"
|
2007-02-07 01:40:59 -08:00
|
|
|
else
|
2007-02-12 02:28:12 -08:00
|
|
|
wontinstall "$1"
|
2007-02-07 01:40:59 -08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
installbestbin() {
|
|
|
|
if [ -f "$1" ]; then
|
|
|
|
echo " install binary $3 (with `basename $1`)"
|
2007-02-12 02:28:12 -08:00
|
|
|
cp -f "$1" "$3"
|
2007-02-07 01:40:59 -08:00
|
|
|
else
|
|
|
|
if [ -f "$2" ]; then
|
|
|
|
echo " install binary $3 (with `basename $2`)"
|
2007-02-12 02:28:12 -08:00
|
|
|
cp -f "$2" "$3"
|
2007-02-07 01:40:59 -08:00
|
|
|
else
|
|
|
|
echo "None of $1, $2 exists"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
fi
|
2007-02-12 02:28:12 -08:00
|
|
|
[ -x "$3" ] || chmod +x "$3"
|
2007-02-07 01:40:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
installlib() {
|
|
|
|
if [ -f "$1" ]; then
|
2007-02-12 02:28:12 -08:00
|
|
|
dest="$2/`basename $1`"
|
2007-02-07 01:40:59 -08:00
|
|
|
echo " install library $dest"
|
2007-02-12 02:28:12 -08:00
|
|
|
cp -f "$1" "$2"
|
|
|
|
ranlib "$dest"
|
2007-02-07 01:40:59 -08:00
|
|
|
else
|
2007-02-12 02:28:12 -08:00
|
|
|
wontinstall "$1"
|
2007-02-07 01:40:59 -08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
installdir() {
|
|
|
|
args=""
|
|
|
|
while [ $# -gt 1 ]; do
|
|
|
|
if [ -f "$1" ]; then
|
|
|
|
args="$args $1"
|
|
|
|
else
|
2007-02-12 02:28:12 -08:00
|
|
|
wontinstall "$1"
|
2007-02-07 01:40:59 -08:00
|
|
|
fi
|
|
|
|
shift
|
|
|
|
done
|
2007-02-12 02:28:12 -08:00
|
|
|
last="$1"
|
2007-02-07 01:40:59 -08:00
|
|
|
for file in $args; do
|
|
|
|
echo " install $last/`basename $file`"
|
2007-02-12 02:28:12 -08:00
|
|
|
cp -f "$file" "$last"
|
2007-02-07 01:40:59 -08:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
installlibdir() {
|
|
|
|
args=""
|
|
|
|
while [ $# -gt 1 ]; do
|
|
|
|
args="$args $1"
|
|
|
|
shift
|
|
|
|
done
|
2007-02-12 02:28:12 -08:00
|
|
|
last="$1"
|
2007-02-07 01:40:59 -08:00
|
|
|
for file in $args; do
|
2007-02-12 02:28:12 -08:00
|
|
|
installlib "$file" "$last"
|
2007-02-07 01:40:59 -08:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir -p $BINDIR
|
|
|
|
mkdir -p $LIBDIR
|
|
|
|
mkdir -p $LIBDIR/camlp4
|
|
|
|
mkdir -p $LIBDIR/ocamlbuild
|
|
|
|
mkdir -p $STUBLIBDIR
|
2007-02-12 02:28:12 -08:00
|
|
|
mkdir -p $MANDIR/man1
|
|
|
|
mkdir -p $MANDIR/man3
|
|
|
|
mkdir -p $MANDIR/man$MANEXT
|
2007-02-07 01:40:59 -08:00
|
|
|
|
|
|
|
cd _build
|
|
|
|
|
|
|
|
echo "Installing camlp4..."
|
|
|
|
installbin camlp4/camlp4prof.byte$EXE $BINDIR/camlp4prof$EXE
|
|
|
|
installbin camlp4/mkcamlp4.byte$EXE $BINDIR/mkcamlp4$EXE
|
|
|
|
installbin camlp4/camlp4.byte$EXE $BINDIR/camlp4$EXE
|
|
|
|
installbin camlp4/camlp4o.byte$EXE $BINDIR/camlp4o$EXE
|
|
|
|
installbin camlp4/camlp4of.byte$EXE $BINDIR/camlp4of$EXE
|
|
|
|
installbin camlp4/camlp4oof.byte$EXE $BINDIR/camlp4oof$EXE
|
|
|
|
installbin camlp4/camlp4orf.byte$EXE $BINDIR/camlp4orf$EXE
|
|
|
|
installbin camlp4/camlp4r.byte$EXE $BINDIR/camlp4r$EXE
|
|
|
|
installbin camlp4/camlp4rf.byte$EXE $BINDIR/camlp4rf$EXE
|
|
|
|
installbin camlp4/camlp4o.native$EXE $BINDIR/camlp4o.opt$EXE
|
|
|
|
installbin camlp4/camlp4of.native$EXE $BINDIR/camlp4of.opt$EXE
|
|
|
|
installbin camlp4/camlp4oof.native$EXE $BINDIR/camlp4oof.opt$EXE
|
|
|
|
installbin camlp4/camlp4orf.native$EXE $BINDIR/camlp4orf.opt$EXE
|
|
|
|
installbin camlp4/camlp4r.native$EXE $BINDIR/camlp4r.opt$EXE
|
|
|
|
installbin camlp4/camlp4rf.native$EXE $BINDIR/camlp4rf.opt$EXE
|
|
|
|
|
|
|
|
cd camlp4
|
|
|
|
CAMLP4DIR=$LIBDIR/camlp4
|
|
|
|
for dir in Camlp4Parsers Camlp4Printers Camlp4Filters Camlp4Top; do
|
|
|
|
echo "Installing $dir..."
|
|
|
|
mkdir -p $CAMLP4DIR/$dir
|
2007-02-12 02:28:12 -08:00
|
|
|
installdir \
|
|
|
|
$dir/*.cm* \
|
|
|
|
$dir/*.$O \
|
|
|
|
$dir/*.p.$O \
|
|
|
|
$CAMLP4DIR/$dir
|
2007-02-07 01:40:59 -08:00
|
|
|
done
|
|
|
|
installdir \
|
|
|
|
camlp4lib.{cma,cmxa} Camlp4.cmi \
|
|
|
|
{camlp4o,camlp4of,camlp4oof,camlp4orf,camlp4r,camlp4rf}.cma \
|
|
|
|
Camlp4Bin.{cm[iox],$O,p.$O} Camlp4Top.cm[io] \
|
|
|
|
$CAMLP4DIR
|
|
|
|
installlibdir camlp4lib.{$A,p.$A} $CAMLP4DIR
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo "Installing ocamlbuild..."
|
|
|
|
|
|
|
|
installbin ocamlbuild/ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE
|
|
|
|
installbin ocamlbuild/ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE
|
|
|
|
installbestbin ocamlbuild/ocamlbuild.native$EXE ocamlbuild/ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
|
|
|
|
|
|
|
|
installlibdir \
|
|
|
|
ocamlbuild/ocamlbuildlib.{$A,p.$A} \
|
|
|
|
$LIBDIR/ocamlbuild
|
|
|
|
|
|
|
|
installdir \
|
|
|
|
ocamlbuild/ocamlbuildlib{,.p}.cmxa \
|
|
|
|
ocamlbuild/ocamlbuildlib.cma \
|
|
|
|
ocamlbuild/ocamlbuild_plugin.cmi \
|
|
|
|
ocamlbuild/ocamlbuild_pack.cmi \
|
|
|
|
ocamlbuild/ocamlbuild.cmo \
|
|
|
|
ocamlbuild/ocamlbuild{,.p}.{cmx,$O} \
|
|
|
|
$LIBDIR/ocamlbuild
|
2007-02-07 09:08:48 -08:00
|
|
|
|
|
|
|
installdir \
|
|
|
|
../ocamlbuild/man/ocamlbuild.1 \
|
|
|
|
$MANDIR/man1
|