Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 592da5cbaf
Fetching contributors…

Cannot retrieve contributors at this time

executable file 119 lines (94 sloc) 2.554 kb
#! /bin/sh
# adapted from ocamlnet's configure
#######################################################################
# Helpers:
# Split $PATH into words:
oldifs="$IFS"
IFS=" :"
spacepath=`echo $PATH`
IFS="$oldifs"
get_path () {
for d in $spacepath; do
if test -x "$d/$1"; then
echo "$d/$1"
return
fi
done
}
ocamlc=`get_path ocamlc`
version="0.2"
exec_suffix=""
check_library () {
# $1: the name of the library (findlib)
ocamlfind query "$1" >/dev/null 2>/dev/null
return
return 1 # not found
}
check_libraryjs () {
# $1: the name of the library (findlib)
ocamlfindjs query "$1" >/dev/null 2>/dev/null
return
return 1 # not found
}
echo "Welcome to froc version $version" >&2
######################################################################
# Check ocamlfind
printf "%s" "Checking for findlib... "
if check_library stdlib; then
echo "found"
else
echo "not found"
echo "Download findlib from http://projects.camlcity.org/projects/findlib.html"
exit 1
fi
######################################################################
# Check that ocamljs is available:
printf "%s" "Checking for ocamljs... "
has_ocamljs=0
if check_libraryjs ocamljs; then
echo "found"
has_ocamljs=1
else
echo "not found, continuing"
echo "Download ocamljs from http://github.com/jaked/ocamljs/"
fi
######################################################################
# Check that delimcc is available:
printf "%s" "Checking for delimcc... "
has_delimcc=0
if check_library delimcc; then
echo "found"
has_delimcc=1
else
echo "not found, continuing"
echo "Download delimcc from http://okmij.org/ftp/continuations/"
fi
######################################################################
# Summary
pkglist="froc froc-syntax"
if [ $has_ocamljs -gt 0 ]; then
pkglist="$pkglist froc-dom"
fi
if [ $has_delimcc -gt 0 ]; then
pkglist="$pkglist froc-direct"
fi
######################################################################
# Write Makefile.conf
echo "Writing Makefile.conf"
cat <<_EOF_ >Makefile.conf
# Makefike.conf written by configure
# The froc version
VERSION = $version
# The packages to build in the right order:
PKGLIST = $pkglist
HAS_OCAMLJS = $has_ocamljs
HAS_DELIMCC = $has_delimcc
_EOF_
######################################################################
# Finish
echo
echo "You can now compile froc by invoking"
echo " make all"
echo "Finally, a"
echo " make install"
echo "will install the package(s)."
Jump to Line
Something went wrong with that request. Please try again.