Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -allow-unreleased-menhir #530

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ clightgen=false
install_coqdev=false
ignore_coq_version=false
ignore_ocaml_version=false
allow_unreleased_menhir=false
library_Flocq=local
library_MenhirLib=local

Expand Down Expand Up @@ -101,6 +102,7 @@ Options:
-install-coqdev Also install the Coq development (implied by -clightgen)
-ignore-coq-version Accept to use experimental or unsupported versions of Coq
-ignore-ocaml-version Accept to use experimental or unsupported versions of OCaml
-allow-unreleased-menhir Accept to use experimental / unreleased versions of Menhir
'

#
Expand Down Expand Up @@ -140,6 +142,8 @@ while : ; do
ignore_coq_version=true;;
-ignore-ocaml-version|--ignore-ocaml-version)
ignore_ocaml_version=true;;
-allow-unreleased-menhir|--allow-unreleased-menhir)
allow_unreleased_menhir=true;;
-install-coqdev|--install-coqdev|-install-coq-dev|--install-coq-dev)
install_coqdev=true;;
-use-external-Flocq|--use-external-Flocq)
Expand Down Expand Up @@ -560,7 +564,7 @@ fi

MENHIR_REQUIRED=20200624
echo "Testing Menhir... " | tr -d '\n'
menhir_ver=`menhir --version 2>/dev/null | sed -n -e 's/^.*version \([0-9]*\).*$/\1/p'`
menhir_ver=$(menhir --version 2>/dev/null | sed -n -E -e 's/^.*version (unreleased|[0-9]*).*$/\1/p')
case "$menhir_ver" in
20[0-9][0-9][0-9][0-9][0-9][0-9])
if test "$menhir_ver" -ge $MENHIR_REQUIRED; then
Expand All @@ -580,10 +584,29 @@ case "$menhir_ver" in
echo "Error: CompCert requires a version greater or equal to $MENHIR_REQUIRED."
missingtools=true
fi;;
unreleased)
echo "version $menhir_ver -- UNSUPPORTED"
echo "Warning: this version of Menhir is unsupported, proceed at your own risks."
menhir_dir=$(ocamlfind query menhirLib 2>/dev/null) || \
menhir_dir=$(menhir --suggest-menhirLib) || \
menhir_dir=""
menhir_dir=$(echo "$menhir_dir" | tr -d '\r' | tr '\\' '/')
if test ! -d "$menhir_dir"; then
echo "Error: cannot determine the location of the Menhir API library."
echo "This can be due to an incorrect Menhir package."
echo "Consider using the OPAM package for Menhir."
missingtools=true
fi;;
*)
echo "NOT FOUND"
echo "Error: make sure Menhir version $MENHIR_REQUIRED or later is installed."
missingtools=true;;
if test -z "$menhir_ver"; then
echo "NOT FOUND"
echo "Error: make sure Menhir version $MENHIR_REQUIRED or later is installed."
missingtools=true
else
echo "version $menhir_ver -- UNSUPPORTED"
echo "Error: CompCert requires a version greater or equal to $MENHIR_REQUIRED."
missingtools=true
fi;;
esac

echo "Testing GNU make... " | tr -d '\n'
Expand Down