Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change mirage tool to apply Entropy_unix functor
- Loading branch information
Showing
1 changed file
with
7 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,10 +436,12 @@ module Entropy = struct | |
let name _ = | ||
"entropy" | ||
|
||
let module_name () = | ||
let module_name () = "Entropy" | ||
|
||
let construction () = | ||
match !mode with | ||
| `Unix -> "Entropy_unix" | ||
| `Xen -> "Entropy_xen" | ||
| `Unix -> "Entropy_unix.Make (OS.Time)" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
samoht
Member
|
||
| `Xen -> "Entropy_xen" | ||
|
||
let packages () = | ||
match !mode with | ||
|
@@ -449,6 +451,8 @@ module Entropy = struct | |
let libraries = packages | ||
|
||
let configure t = | ||
append_main "module %s = %s" (module_name t) (construction t) ; | ||
newline_main () ; | ||
append_main "let %s () =" (name t); | ||
append_main " %s.connect ()" (module_name t); | ||
newline_main () | ||
|
I wasn't sure how to properly depend on another signature (i.e. how to parameterize on whatever actually provides
TIME
) but the signature is apparently fulfilled only byOS.Time
.Probably hackish, willing to improve.