By (sadly) not using wsi.mli at all. ocamlc refuses to play ball when interface is not in the same directory with the implementation [1], and symlinking: causes cognitive dissonance is fragile in presence of PBMAC [1] misc/notes/cmi.sh describes the problem (removed by this commit)
Unified · Split
| @@ -51,7 +51,7 @@ $make -q -s || $make · 50 unmodified lines | |||
| 51 | oincs() { | 51 | oincs() { |
| 52 | local b=$1 incs | 52 | local b=$1 incs |
| 53 | case "${2#$outd/}" in | 53 | case "${2#$outd/}" in |
| 54 | $wsid/wsi.cm[io]|confstruct.cmo|help.cmo) incs="-I $b -I $b/$wsid";; | 54 | $wsid/wsi.cmo|confstruct.cmo|help.cmo) incs="-I $b -I $b/$wsid";; |
| 55 | glutils.cmo) incs="-I $b -I $b/lablGL";; | 55 | glutils.cmo) incs="-I $b -I $b/lablGL";; |
| 56 | uiutils.cmo|main.cmo) incs="-I $b -I $b/$wsid -I $b/lablGL";; | 56 | uiutils.cmo|main.cmo) incs="-I $b -I $b/$wsid -I $b/lablGL";; |
| 57 | ffi.cmo|help.cmi|parser.cmo) incs="-I $b";; | 57 | ffi.cmo|help.cmi|parser.cmo) incs="-I $b";; |
| @@ -1,12 +1,10 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | set -eu | 2 | set -eu |
| 3 | 3 | ||
| 4 | # On why wsi.mli is symlinked from the root to wsi/_platform_/wsi.mli | ||
| 5 | |||
| 6 | mkdir -p /tmp/cmi/{d,b/d} | 4 | mkdir -p /tmp/cmi/{d,b/d} |
| 7 | cd /tmp/cmi | 5 | cd /tmp/cmi |
| 8 | touch a.mli d/a.ml | 6 | touch a.mli d/a.ml |
| 9 | ocamlc -c -I b/ -o b/a.cmi a.mli | 7 | ocamlc -c -I b/ -o b/a.cmi a.mli |
| 10 | ocamlc -c -I b/ -o b/d/a.cmo d/a.ml | 8 | ocamlc -c -I b/ -o b/d/a.cmo d/a.ml |
| 11 | 9 | ||
| 12 | # after running this script a.cmi will be in b/ and in b/d | 10 | # after running this script a.cmi will be in b/ _AND_ in b/d |
| @@ -1 +0,0 @@ | |||
| 1 | ../wsi.mli | ||
| @@ -1,61 +0,0 @@ | |||
| 1 | type cursor = | ||
| 2 | | CURSOR_INHERIT | ||
| 3 | | CURSOR_INFO | ||
| 4 | | CURSOR_CYCLE | ||
| 5 | | CURSOR_FLEUR | ||
| 6 | | CURSOR_TEXT | ||
| 7 | |||
| 8 | type winstate = | ||
| 9 | | MaxVert | ||
| 10 | | MaxHorz | ||
| 11 | | Fullscreen | ||
| 12 | |||
| 13 | type visiblestate = | ||
| 14 | | Unobscured | ||
| 15 | | PartiallyObscured | ||
| 16 | | FullyObscured | ||
| 17 | |||
| 18 | class type t = | ||
| 19 | object | ||
| 20 | method display : unit | ||
| 21 | method map : bool -> unit | ||
| 22 | method expose : unit | ||
| 23 | method visible : visiblestate -> unit | ||
| 24 | method reshape : int -> int -> unit | ||
| 25 | method mouse : int -> bool -> int -> int -> int -> unit | ||
| 26 | method motion : int -> int -> unit | ||
| 27 | method pmotion : int -> int -> unit | ||
| 28 | method key : int -> int -> unit | ||
| 29 | method enter : int -> int -> unit | ||
| 30 | method leave : unit | ||
| 31 | method winstate : winstate list -> unit | ||
| 32 | method quit : 'a. 'a | ||
| 33 | method scroll : int -> int -> unit | ||
| 34 | method zoom : float -> int -> int -> unit | ||
| 35 | method opendoc : string -> unit | ||
| 36 | end | ||
| 37 | |||
| 38 | type keycode = int | ||
| 39 | val setcursor : cursor -> unit | ||
| 40 | val settitle : string -> unit | ||
| 41 | val swapb : unit -> unit | ||
| 42 | val readresp : Unix.file_descr -> unit | ||
| 43 | val init : t -> int -> int -> Unix.file_descr * int * int | ||
| 44 | val fullscreen : unit -> unit | ||
| 45 | val reshape : int -> int -> unit | ||
| 46 | val activatewin : unit -> unit | ||
| 47 | val mapwin : unit -> unit | ||
| 48 | val withalt : int -> bool | ||
| 49 | val withctrl : int -> bool | ||
| 50 | val withshift : int -> bool | ||
| 51 | val withmeta : int -> bool | ||
| 52 | val withnone : int -> bool | ||
| 53 | val metamask : int | ||
| 54 | val altmask : int | ||
| 55 | val shiftmask : int | ||
| 56 | val ctrlmask : int | ||
| 57 | val keyname : int -> string | ||
| 58 | val namekey : string -> int | ||
| 59 | val fontsizescale : int -> int | ||
| 60 | val ks2kt : int -> Keys.t | ||
| 61 | val cAp : string | ||
| @@ -1 +0,0 @@ | |||
| 1 | ../wsi.mli | ||