Skip to content
Snippets Groups Projects
Commit fbe03679 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[Makefile] Moves definitions of transitioning functions closer to their use

`configure` should not be bothered with defining macros for generating
`transitioning.ml`. This belongs to `Makefile.generating`
parent 922af4e1
No related branches found
No related tags found
No related merge requests found
...@@ -122,6 +122,18 @@ endif ...@@ -122,6 +122,18 @@ endif
GENERATED+= src/libraries/utils/json.ml src/libraries/stdlib/transitioning.ml GENERATED+= src/libraries/utils/json.ml src/libraries/stdlib/transitioning.ml
ifeq ($(HAS_OCAML403),yes)
STACK_FOLD=Stack.fold
else
STACK_FOLD=stack_fold
endif
ifeq ($(HAS_OCAML404),yes)
SPLIT_ON_CHAR=String.split_on_char
else
SPLIT_ON_CHAR=split_on_char
endif
src/libraries/stdlib/transitioning.ml: \ src/libraries/stdlib/transitioning.ml: \
src/libraries/stdlib/transitioning.ml.in \ src/libraries/stdlib/transitioning.ml.in \
Makefile.generating share/Makefile.config Makefile.generating share/Makefile.config
......
...@@ -113,29 +113,12 @@ case $OCAMLVERSION in ...@@ -113,29 +113,12 @@ case $OCAMLVERSION in
OCAML_ANNOT_OPTION="-bin-annot";; OCAML_ANNOT_OPTION="-bin-annot";;
esac esac
AC_SUBST(SPLIT_ON_CHAR)
AC_SUBST(STACK_FOLD)
case $OCAMLVERSION in
4.02.*)
SPLIT_ON_CHAR=split_on_char;
STACK_FOLD=stack_fold
;;
4.03.*)
SPLIT_ON_CHAR=split_on_char;
STACK_FOLD=Stack.fold
;;
*)
SPLIT_ON_CHAR=String.split_on_char;
STACK_FOLD=Stack.fold
;;
esac
AC_SUBST(OCAMLMAJORNB) AC_SUBST(OCAMLMAJORNB)
AC_SUBST(OCAMLMINORNB) AC_SUBST(OCAMLMINORNB)
AC_SUBST(OCAMLPATCHNB) AC_SUBST(OCAMLPATCHNB)
AC_SUBST(HAS_OCAML403) AC_SUBST(HAS_OCAML403)
AC_SUBST(HAS_OCAML404)
AC_SUBST(HAS_OCAML407) AC_SUBST(HAS_OCAML407)
OCAMLMAJORNB=$(echo $OCAMLVERSION | cut -f 1 -d .) OCAMLMAJORNB=$(echo $OCAMLVERSION | cut -f 1 -d .)
...@@ -150,13 +133,17 @@ else if test $OCAMLMINORNB -lt 3; then ...@@ -150,13 +133,17 @@ else if test $OCAMLMINORNB -lt 3; then
HAS_OCAML407=no; HAS_OCAML407=no;
else else
HAS_OCAML403=yes; HAS_OCAML403=yes;
if test $OCAMLMINORNB -lt 7; then if test $OCAMLMINORNB -lt 4; then
HAS_OCAML404=no;
HAS_OCAML407=no;
else if test $OCAMLMINORNB -lt 7; then
HAS_OCAML407=no; HAS_OCAML407=no;
else else
HAS_OCAML407=yes; HAS_OCAML407=yes;
fi; fi;
fi; fi; # 404
fi; fi; # 403
fi; # MAJORNB -gt 4
# Ocaml library path # Ocaml library path
AC_MSG_CHECKING(OCaml library path) AC_MSG_CHECKING(OCaml library path)
......
...@@ -84,6 +84,7 @@ OCAMLMINORNB ?=@OCAMLMINORNB@ ...@@ -84,6 +84,7 @@ OCAMLMINORNB ?=@OCAMLMINORNB@
OCAMLPATCHNB ?=@OCAMLPATCHNB@ OCAMLPATCHNB ?=@OCAMLPATCHNB@
HAS_OCAML403 ?=@HAS_OCAML403@ HAS_OCAML403 ?=@HAS_OCAML403@
HAS_OCAML404 ?=@HAS_OCAML404@
HAS_OCAML407 ?=@HAS_OCAML407@ HAS_OCAML407 ?=@HAS_OCAML407@
NATIVE_THREADS ?=@HAS_NATIVE_THREADS@ NATIVE_THREADS ?=@HAS_NATIVE_THREADS@
...@@ -92,11 +93,6 @@ PTESTSBEST ?=@PTESTSBEST@ ...@@ -92,11 +93,6 @@ PTESTSBEST ?=@PTESTSBEST@
DEVELOPMENT ?=@DEVELOPMENT@ DEVELOPMENT ?=@DEVELOPMENT@
# Compatibility across OCaml versions
SPLIT_ON_CHAR ?= @SPLIT_ON_CHAR@
STACK_FOLD ?= @STACK_FOLD@
############# #############
# Libraries # # Libraries #
############# #############
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment