Merge pull request #677 from rgrinberg/4.02.3-configurator-fixes

4.02.3 configurator fixes
This commit is contained in:
Rudi Grinberg 2018-04-06 10:23:27 +08:00 committed by GitHub
commit 41047e36d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,6 @@
(jbuild_version 1)
(executable
((name mk)))
(rule (with-stdout-to flags.sexp (run ./mk.exe -ocamlv ${ocaml_version})))

View File

@ -0,0 +1,25 @@
open Printf
let parse_version s =
Scanf.sscanf s "%d.%d.%d" (fun a b c -> a, b, c)
let () =
let usage =
sprintf "%s -ocamlv version" (Filename.basename Sys.executable_name) in
let ocaml_version = ref "" in
let anon _ =
raise (Arg.Bad "anonymous arguments aren't accepted") in
Arg.parse
[ "-ocamlv"
, Arg.String (fun s -> ocaml_version := s)
, "Version of ocaml being used"
] anon usage;
if !ocaml_version = "" then
raise (Arg.Bad "Provide version with -ocamlv")
else
let (x, y, _) = parse_version !ocaml_version in
if x >= 4 && y > 2 then (
printf "()\n"
) else (
printf "(-w -50)\n"
)

View File

@ -1,7 +1,7 @@
(library
((name configurator)
(flags (:standard -safe-string))
(libraries (stdune ocaml_config))
(flags (:standard -safe-string (:include flags/flags.sexp)))
(preprocess no_preprocessing)))
(jbuild_version 1)

View File

@ -1,5 +1,6 @@
module Filename = Filename
module String = String
module Char = Char
module Result = Result
type ('a, 'error) result = ('a, 'error) Result.t =

9
src/stdune/char.ml Normal file
View File

@ -0,0 +1,9 @@
module Char = Caml.Char
include struct
[@@@warning "-32-3"]
let uppercase_ascii = Char.uppercase
let lowercase_ascii = Char.lowercase
end
include Char