#!/bin/sh

## This micro-configure shell script is here only to
## launch the real configuration via ocaml
configure=./tools/configure/configure.exe

## Check that dune is available, provide an error message otherwise
if ! command -v dune > /dev/null
then
    1>&2 echo "Dune could not be found, please ensure you have a working OCaml enviroment"
    exit 1
fi

if [ "x$1" = 'x-release' ]; then
  shift 1
  dune_release='--profile=release'
else
  dune_release=''
fi

dune exec $dune_release --root . -- $configure "$@"
