aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2020-07-07 14:08:24 +0200
committerGitHub <noreply@github.com>2020-07-07 14:08:24 +0200
commit9af28924713d14d833dcaf95cd3338ef68fbfc97 (patch)
tree4be68320227ebe6acb4a11a3397596ee118de3e5 /configure
parent3b1f3dd57d8c10c1c29f67f0f745e3263d9d3daf (diff)
downloadcompcert-9af28924713d14d833dcaf95cd3338ef68fbfc97.tar.gz
compcert-9af28924713d14d833dcaf95cd3338ef68fbfc97.zip
Bytecode-only build (#243)
If ocamlopt (the native-code OCaml compiler) is not available, fall back to building with ocamlc (the bytecode OCaml compiler). Fixes: #359
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 14 insertions, 3 deletions
diff --git a/configure b/configure
index 432bacff..d38deeec 100755
--- a/configure
+++ b/configure
@@ -547,7 +547,7 @@ case "$coq_ver" in
esac
echo "Testing OCaml... " | tr -d '\n'
-ocaml_ver=`ocamlopt -version 2>/dev/null`
+ocaml_ver=`ocamlc -version 2>/dev/null`
case "$ocaml_ver" in
4.00.*|4.01.*| 4.02.*|4.03.*|4.04.*)
echo "version $ocaml_ver -- UNSUPPORTED"
@@ -565,9 +565,19 @@ case "$ocaml_ver" in
missingtools=true;;
esac
+echo "Testing OCaml native-code compiler..." | tr -d '\n'
+ocamlopt_ver=`ocamlopt -version 2>/dev/null`
+if test "$ocamlopt_ver" = "$ocaml_ver"; then
+ echo "yes"
+ ocaml_native_comp=true
+else
+ echo "no, will build to bytecode only"
+ ocaml_native_comp=false
+fi
+
echo "Testing OCaml .opt compilers... " | tr -d '\n'
-ocaml_opt_ver=`ocamlopt.opt -version 2>/dev/null`
-if test "$ocaml_opt_ver" = "$ocaml_ver"; then
+ocamlopt_opt_ver=`ocamlopt.opt -version 2>/dev/null`
+if test "$ocamlopt_opt_ver" = "$ocaml_ver"; then
echo "yes"
ocaml_opt_comp=true
else
@@ -680,6 +690,7 @@ LIBDIR=$libdir
MANDIR=$sharedir/man
SHAREDIR=$sharedir
COQDEVDIR=$coqdevdir
+OCAML_NATIVE_COMP=$ocaml_native_comp
OCAML_OPT_COMP=$ocaml_opt_comp
MENHIR_DIR=$menhir_dir
COMPFLAGS=-bin-annot