Commit 482bc19b authored by Julien Lopez's avatar Julien Lopez

Configuration script for opam added, use:

	./opam_config.sh [OCaml version]
to switch to an OCaml version and install the necessary opam
packages to compile CDuce.
parent 9008666b
......@@ -189,13 +189,7 @@ Then using OPAM you need to install and configure the correct compiler and
modules needed to build cduce. Ocamlfind will take care of installing the
cduce libraries and make them available.
opam switch 3.12.1
eval `opam config env`
opam install ocamlnet
opam install pxp
opam install ocurl
opam install ocaml-expat
./opam_config.sh 3.12.1
./configure --mliface=ocaml --prefix=$LOCALSWDIR
make
......
#!/bin/sh
VERBOSE="false"
WITHOCAML="false"
OCAMLFOLDER="ocaml"
ROOT=$PWD
usage ()
{
echo "$0 [--verbose|-v] [--mliface=DIR] ocamlversion"
echo "Example: $0 --verbose --mliface=ocaml 4.01.0"
}
if test $# -lt 1; then usage; exit 1; fi
while [ true ]; do
if test $1 = "-v" || test $1 = "--verbose"; then VERBOSE="true";
elif echo $1 | grep -qs "\-\-mliface=*"; then
WITHOCAML="true"; OCAMLFOLDER=`echo $1 | cut -d '=' -f 2`;
else break; fi;
shift;
done
echo -n "Switching to version $1 of OCaml..."
if test $VERBOSE = "false"; then
opam switch $1 > /dev/null 2>&1
else
opam switch $1
fi
if test $? -ne 0; then
echo "failed. This version doesn't seem to exist."; exit 2;
fi
echo "done."
if test $VERBOSE = "false"; then
eval `opam config env` > /dev/null 2>&1
else
eval `opam config env`
fi
#if test $? -ne 0; then
echo "Warning: Could not complete the configuration of opam, type:"
echo "eval \`opam config env\`";
#fi
echo "Installing mandatory packages to compile CDuce."
opam install pcre-ocaml
opam install ocamlnet
opam install pxp
opam install ocurl
opam install ocaml-expat
if $WITHOCAML = "true"; then
if test -d $OCAMLFOLDER; then
cd $OCAMLFOLDER; git checkout
else
echo "Couldn't find $OCAMLFOLDER. The interface will not be built."
fi
fi
......@@ -40,7 +40,4 @@ clean:
$(RM) oUnit-* a/c.ml a/c.cdo a/c.cmi a/c.cmo
for i in $(OUNIT_TESTS); do $(RM) `echo $$i/$$i $$i/$$i.ml $$i/$$i.c[dm][oxi] $$i/$${i}test.cm[io]`; done
check:
./check.sh
.PHONY: a cdsdl cdmysql eval cdnum
#!/bin/sh
ROOTDIR=$HOME/cduce
TESTDIR=$ROOTDIR/tests/ocaml
TESTNOW=__testnow__
TESTREF=__testref__
ERRNOW=__errnow__
ERRREF=__errref__
TMPCDUCE=__tmpcduce__
echo -n "Building actual version..."
opam switch 4.01.0 > /dev/null 2> /dev/null
eval `opam config env`
cd $ROOTDIR/ocaml
git checkout 4.01.0 > /dev/null 2> /dev/null
cd $ROOTDIR
make clean > /dev/null 2> /dev/null
git checkout ocamlinterface > /dev/null 2> /dev/null
./configure --mliface=ocaml > /dev/null 2> /dev/null
make > /dev/null 2> /dev/null
cd $TESTDIR
make clean > /dev/null 2> /dev/null
make > $TESTNOW 2> $ERRNOW
echo "done."
echo -n "Building ref version..."
opam switch 3.12.1 > /dev/null 2> /dev/null
eval `opam config env`
cd $ROOTDIR/ocaml
git checkout 3.12.1 > /dev/null 2> /dev/null
cd $ROOTDIR
make clean > /dev/null 2> /dev/null
git checkout e9ffdf1ac5d9a57006378d96357ee28fe4b791f7 > /dev/null 2> /dev/null
./configure --mliface=ocaml > /dev/null 2> /dev/null
make > /dev/null 2> /dev/null
cd $TESTDIR
make clean > /dev/null 2> /dev/null
make > $TESTREF 2> $ERRREF
echo "done."
diff $TESTNOW $TESTREF
if [ $? -eq 0 ]; then
diff $ERRNOW $ERRREF
if [ $? -eq 0 ]; then
echo "Success!"
else
echo "Fail"
fi
else
echo "Fail"
fi
rm -f $TESTNOW $TESTREF $ERRNOW $ERRREF
git checkout ocamlinterface > /dev/null 2> /dev/null
cd $ROOTDIR/ocaml
git checkout 4.01.0 > /dev/null 2> /dev/null
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment