From 1102741b448f5b433b1b36988d50dc911a0d0e28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Bobot?= <francois.bobot@cea.fr>
Date: Wed, 24 Jul 2019 13:24:27 +0200
Subject: [PATCH] Remove HAS_OCAML403 HAS_OCAML404 HAS_OCAML405

       because always true now
---
 Makefile                       |  7 ++-----
 Makefile.generating            | 24 ------------------------
 configure.in                   |  9 ---------
 share/Makefile.config.in       |  3 ---
 share/Makefile.plugin.template |  7 +------
 5 files changed, 3 insertions(+), 47 deletions(-)

diff --git a/Makefile b/Makefile
index d0e04ef544c..4acc04c9a44 100644
--- a/Makefile
+++ b/Makefile
@@ -1536,11 +1536,8 @@ STDLIB_FILES:=\
 	stack \
 	string \
 	sys \
-        weak
-
-ifeq ($(HAS_OCAML403),yes)
-  STDLIB_FILES+=ephemeron
-endif
+	weak \
+	ephemeron
 
 ifeq ($(HAS_OCAML407),no)
   STDLIB_FILES+=pervasives
diff --git a/Makefile.generating b/Makefile.generating
index ea525bf3630..12dd18b3f0a 100644
--- a/Makefile.generating
+++ b/Makefile.generating
@@ -126,30 +126,6 @@ endif
 
 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
-
-ifeq ($(HAS_OCAML405),yes)
-  NTH_OPT=List.nth_opt
-  FIND_OPT=List.find_opt
-  ASSOC_OPT=List.assoc_opt
-  ASSQ_OPT=List.assq_opt
-else
-  NTH_OPT=nth_opt
-  FIND_OPT=find_opt
-  ASSOC_OPT=assoc_opt
-  ASSQ_OPT=assq_opt
-endif
-
 ifeq ($(HAS_OCAML408),yes)
   DYNLINK_INIT=fun () -> ()
   FORMAT_STAG=stag
diff --git a/configure.in b/configure.in
index bb2c1b978c8..aeb14b7922d 100644
--- a/configure.in
+++ b/configure.in
@@ -117,9 +117,6 @@ AC_SUBST(OCAMLMAJORNB)
 AC_SUBST(OCAMLMINORNB)
 AC_SUBST(OCAMLPATCHNB)
 
-AC_SUBST(HAS_OCAML403)
-AC_SUBST(HAS_OCAML404)
-AC_SUBST(HAS_OCAML405)
 AC_SUBST(HAS_OCAML407)
 AC_SUBST(HAS_OCAML408)
 
@@ -128,15 +125,9 @@ OCAMLMINORNB=$(echo $OCAMLVERSION | cut -f 2 -d .)
 OCAMLPATCHNB=$(echo $OCAMLVERSION | cut -f 3 -d .)
 
 if test $OCAMLMAJORNB -gt 4; then
-  HAS_OCAML403=yes;
-  HAS_OCAML404=yes;
-  HAS_OCAML405=yes;
   HAS_OCAML407=yes;
   HAS_OCAML408=yes;
 else
-  HAS_OCAML403=yes;
-  HAS_OCAML404=yes;
-  HAS_OCAML405=yes;
   HAS_OCAML407=no;
   HAS_OCAML408=no;
   if test $OCAMLMINORNB -ge 7; then
diff --git a/share/Makefile.config.in b/share/Makefile.config.in
index f0bc8ae518d..6acbd529f84 100644
--- a/share/Makefile.config.in
+++ b/share/Makefile.config.in
@@ -85,9 +85,6 @@ OCAMLMAJORNB    ?=@OCAMLMAJORNB@
 OCAMLMINORNB    ?=@OCAMLMINORNB@
 OCAMLPATCHNB    ?=@OCAMLPATCHNB@
 
-HAS_OCAML403    ?=@HAS_OCAML403@
-HAS_OCAML404    ?=@HAS_OCAML404@
-HAS_OCAML405    ?=@HAS_OCAML405@
 HAS_OCAML407    ?=@HAS_OCAML407@
 HAS_OCAML408    ?=@HAS_OCAML408@
 
diff --git a/share/Makefile.plugin.template b/share/Makefile.plugin.template
index d9be7dfb479..63edcb5cf60 100644
--- a/share/Makefile.plugin.template
+++ b/share/Makefile.plugin.template
@@ -553,12 +553,7 @@ endif # PLUGIN_HAS_META
 @PLUGIN_NAME@_PLUGIN_MLI:= $(PLUGIN_DIR)/@PLUGIN_NAME@.mli
 @PLUGIN_NAME@_CHECK_PLUGIN_MLI:=$(PLUGIN_DIR)/@PLUGIN_NAME@.check_mli_exists
 
-# Prevents warning 58 in OCaml 4.03 for our plugins.
-ifeq ($(HAS_OCAML403),yes)
-  $(TARGET_CMI): BFLAGS:=$($(NAME_BFLAGS)) -opaque
-else
-  $(TARGET_CMI): BFLAGS:=$($(NAME_BFLAGS))
-endif
+$(TARGET_CMI): BFLAGS:=$($(NAME_BFLAGS)) -opaque
 
 $(TARGET_CMI): $(PLUGIN_CMO)
 
-- 
GitLab