lib/Tools/ocamlc
changeset 69261 a41f49148525
parent 69135 be20f5f6feb9
--- a/lib/Tools/ocamlc	Thu Nov 08 09:11:52 2018 +0100
+++ b/lib/Tools/ocamlc	Thu Nov 08 12:32:06 2018 +0100
@@ -4,4 +4,10 @@
 #
 # DESCRIPTION: invoke OCaml compiler within the Isabelle environment
 
-isabelle_opam config exec --switch "$ISABELLE_OCAML_VERSION" -- ocamlc "$@"
+if [ -d "$ISABELLE_OPAM_ROOT" -a -n "$ISABELLE_OCAMLC" ]
+then
+  isabelle_opam config exec --switch "$ISABELLE_OCAML_VERSION" -- ocamlc "$@"
+else
+  echo "Cannot execute ocamlc: missing Isabelle OCaml setup" >&2
+  exit 127
+fi