-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: generate shims for "stdlib", using dune configurator; fix warnings
warn-error was a mistake
- Loading branch information
Showing
5 changed files
with
54 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
(executable | ||
(name mkshims) | ||
(modules mkshims) | ||
(libraries dune.configurator)) | ||
|
||
(rule | ||
(targets GenShims_.ml) | ||
(deps ./mkshims.exe) | ||
(action (run ./mkshims.exe))) | ||
|
||
(rule | ||
(targets flambda.flags) | ||
(deps (file mkflags.ml)) | ||
(mode fallback) | ||
(action | ||
(run ocaml ./mkflags.ml)) | ||
) | ||
(action (run ocaml ./mkflags.ml))) | ||
|
||
(library | ||
(name gen) | ||
(public_name gen) | ||
(wrapped false) | ||
(modules Gen GenLabels GenM GenClone GenMList GenM_intf Gen_intf GenLabels_intf) | ||
(flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -nolabels) | ||
(modules Gen GenLabels GenM GenClone GenMList GenM_intf Gen_intf GenLabels_intf GenShims_) | ||
(flags :standard -warn-error -a+8 -safe-string -nolabels) | ||
(ocamlopt_flags :standard (:include flambda.flags)) | ||
(libraries bytes) | ||
(inline_tests (backend qtest.lib)) | ||
) | ||
(inline_tests (backend qtest.lib))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module C = Configurator.V1 | ||
|
||
let write_file f s = | ||
let out = open_out f in | ||
output_string out s; flush out; close_out out | ||
|
||
let shims_pre_407 = "module Stdlib = Pervasives" | ||
|
||
let shims_post_407 = "module Stdlib = Stdlib" | ||
|
||
let () = | ||
C.main ~name:"mkshims" (fun c -> | ||
let version = C.ocaml_config_var_exn c "version" in | ||
let major, minor = Scanf.sscanf version "%u.%u" (fun maj min -> maj, min) in | ||
write_file "GenShims_.ml" (if (major, minor) >= (4,7) then shims_post_407 else shims_pre_407); | ||
) |