Merge pull request #677 from rgrinberg/4.02.3-configurator-fixes
4.02.3 configurator fixes
This commit is contained in:
commit
41047e36d1
|
@ -0,0 +1,6 @@
|
|||
(jbuild_version 1)
|
||||
|
||||
(executable
|
||||
((name mk)))
|
||||
|
||||
(rule (with-stdout-to flags.sexp (run ./mk.exe -ocamlv ${ocaml_version})))
|
|
@ -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"
|
||||
)
|
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
module Filename = Filename
|
||||
module String = String
|
||||
module Char = Char
|
||||
module Result = Result
|
||||
|
||||
type ('a, 'error) result = ('a, 'error) Result.t =
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue