From: Stephane Glondu Date: Mon, 17 Jun 2024 08:00:06 +0200 Subject: Fix build with OCaml 5.x --- Makefile | 2 +- setup.ml | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index ccbf9cf..988c65f 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ # OASIS_START # DO NOT EDIT (digest: bc1e05bfc8b39b664f29dae8dbd3ebbb) -SETUP = ocaml setup.ml +SETUP = ocaml -I +camlp-streams camlp_streams.cma setup.ml build: setup.data $(SETUP) -build $(BUILDFLAGS) diff --git a/setup.ml b/setup.ml index 025b420..077aa1b 100644 --- a/setup.ml +++ b/setup.ml @@ -229,7 +229,7 @@ module OASISString = struct let replace_chars f s = let buf = Bytes.make (String.length s) 'X' in for i = 0 to String.length s - 1 do - buf.[i] <- f s.[i] + Bytes.set buf i (f s.[i]) done; Bytes.to_string buf @@ -262,7 +262,7 @@ module OASISUtils = struct let compare_csl s1 s2 = - String.compare (String.lowercase s1) (String.lowercase s2) + String.compare (String.lowercase_ascii s1) (String.lowercase_ascii s2) module HashStringCsl = Hashtbl.Make @@ -270,10 +270,10 @@ module OASISUtils = struct type t = string let equal s1 s2 = - (String.lowercase s1) = (String.lowercase s2) + (String.lowercase_ascii s1) = (String.lowercase_ascii s2) let hash s = - Hashtbl.hash (String.lowercase s) + Hashtbl.hash (String.lowercase_ascii s) end) let varname_of_string ?(hyphen='_') s = @@ -303,7 +303,7 @@ module OASISUtils = struct else buf in - String.lowercase buf + String.lowercase_ascii buf end let varname_concat ?(hyphen='_') p s = @@ -400,7 +400,7 @@ module PropList = struct order = Queue.create (); name_norm = (if case_insensitive then - String.lowercase + String.lowercase_ascii else fun s -> s); } @@ -1918,7 +1918,7 @@ module OASISFindlib = struct in let library_name_of_findlib_name = - Lazy.lazy_from_fun + Lazy.from_fun (fun () -> (* Revert findlib_name_of_library_name. *) MapString.fold @@ -2576,7 +2576,7 @@ module BaseEnv = struct ([], None) (List.sort (fun (o1, _) (o2, _) -> - Pervasives.compare o2 o1) + Stdlib.compare o2 o1) lst) in match res, errors with @@ -5153,10 +5153,10 @@ module InternalInstallPlugin = struct (Filename.concat path) [modul^".mli"; modul^".ml"; - String.uncapitalize modul^".mli"; - String.capitalize modul^".mli"; - String.uncapitalize modul^".ml"; - String.capitalize modul^".ml"]) + String.uncapitalize_ascii modul^".mli"; + String.capitalize_ascii modul^".mli"; + String.uncapitalize_ascii modul^".ml"; + String.capitalize_ascii modul^".ml"]) :: acc with Not_found -> begin @@ -5492,6 +5492,8 @@ module OCamlbuildCommon = struct let fix_args args extra_argv = List.flatten [ + ["-pkg"; "camlp-streams"]; + if (os_type ()) = "Win32" then [ "-classic-display";