From ec72c8c913e98051acb74f17fadfd2d7f89d65f0 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Wed, 3 Aug 2011 13:32:51 +0200 Subject: [PATCH] add a script to install compiler libraries Ignore-this: 1be1715f4e0e3bbcb31cddaee9ff9ce6 darcs-hash:20110803113251-c41ad-48f30dafb6ad00e0549e2cece6f66a67767176d0 --- README | 18 +++++++++++++-- predist.sh | 2 ++ utils/install-compiler-libs.sh | 40 ++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100755 utils/install-compiler-libs.sh diff --git a/README b/README index a94191c..3c8e718 100644 --- a/README +++ b/README @@ -4,9 +4,23 @@ url: https://forge.ocamlcore.org/projects/utop/ * Requirements: - utop depends on the lambda-term package, which is available at: + utop depends on the following packages: - https://forge.ocamlcore.org/projects/lambda-term/ + * findlib (http://projects.camlcity.org/projects/findlib.html) + * react (http://erratique.ch/software/react) + * lwt (http://ocsigen.org/lwt/) + * camomile (http://camomile.sourceforge.net/) + * zed (http://forge.ocamlcore.org/projects/zed/) + * lambda-term (http://forge.ocamlcore.org/projects/lambda-term/) + + Lwt must be compiled with react support, configure it with: + + $ ./configure --enable-react + + utop also requires OCaml compiler libraries. If you are using + debian, they are available as the package ocaml-compiler-libs, if + you are using godi, they are installed by default. If you installed + ocaml by hand, you can run the script utils/install-compiler-libs.sh. * Installation: diff --git a/predist.sh b/predist.sh index 18e4f7b..9ceef43 100755 --- a/predist.sh +++ b/predist.sh @@ -6,5 +6,7 @@ # Add oasis stuff oasis setup +chmod +x utils/install-compiler-libs.sh + # Cleanup rm -f predist.sh boring dist.sh diff --git a/utils/install-compiler-libs.sh b/utils/install-compiler-libs.sh new file mode 100755 index 0000000..0c235df --- /dev/null +++ b/utils/install-compiler-libs.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# +# install-compiler-libs.sh +# ------------------------ +# Copyright : (c) 2011, Jeremie Dimino +# Licence : BSD3 +# +# This file is a part of utop. + +set -e + +if [ $# -ne 1 ]; then + echo "usage: $0 " + exit 2 +fi + +SOURCEPATH="$1" + +if [ ! -d "$SOURCEPATH/typing" -o ! -d "$SOURCEPATH/parsing" -o ! -d "$SOURCEPATH/utils" ]; then + echo "'$1' does not contain ocaml sources." + exit 1 +fi + +if [ ! -f "$SOURCEPATH/typing/types.cmi" -o ! -f "$SOURCEPATH/parsing/longident.cmi" ]; then + echo "ocaml sources in '$1' are not compiled." + exit 1 +fi + +STDLIBPATH=`ocamlc -where` +INSTALLPATH="$STDLIBPATH/compiler-libs" + +mkdir -p "$INSTALLPATH" + +for dir in typing parsing utils; do + echo "copying cmi files from '$SOURCEPATH/$dir' to '$INSTALLPATH/$dir'" + mkdir -p "$INSTALLPATH"/$dir + for file in "$SOURCEPATH"/$dir/*.cmi; do + cp "$file" "$INSTALLPATH"/$dir + done +done