From c2cf20be79d5c91c757480a46a5576c023dae709 Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Sat, 31 Jan 2026 07:37:51 -0500 Subject: [PATCH 1/4] =?UTF-8?q?doc:=20libfoo.so=20=E2=86=92=20dllfoo.so?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ocaml_specific.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ocaml_specific.ml b/src/ocaml_specific.ml index bf5e1c22..6085c8d4 100644 --- a/src/ocaml_specific.ml +++ b/src/ocaml_specific.ml @@ -299,7 +299,7 @@ rule "ocaml C stubs: clib & (o|obj)* -> (a|lib) & (so|dll)" with the file paths listed (one per line) in libfoo.clib. \ To build a static library from libfoo.clib, you should \ request libfoo.a (or libfoo.lib on Windows), and to build \ - a dynamic library you should request libfoo.so (or libfoo.dll \ + a dynamic library you should request dllfoo.so (or dllfoo.dll \ on Windows). Finally, any file listed in the .clib \ with name 'bar/baz.o' will link 'bar/baz.obj' instead on Windows. \ This means that using the .o extension will give portable clib files, \ From 50a7358eb82a3bb30e2e28f6bc4b4b5f63e22067 Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Sat, 31 Jan 2026 07:38:21 -0500 Subject: [PATCH 2/4] add dllib() flag --- src/ocaml_specific.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ocaml_specific.ml b/src/ocaml_specific.ml index 6085c8d4..96c6e90c 100644 --- a/src/ocaml_specific.ml +++ b/src/ocaml_specific.ml @@ -1024,6 +1024,11 @@ begin ccflag ~lang ~phase ~flag))) end;; +List.iter + (fun flag -> pflag ["ocaml"; "byte"; flag] "dllib" + (fun param -> S [A "-dllib"; A param])) + ["compile"; "link"];; + begin let ocamlmklib_pflag ?doc_param flag = pflag ["ocamlmklib"] flag ?doc_param From 96722c02289a7e6f478d39a6efa1cdd82fb2dd84 Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Sat, 31 Jan 2026 16:13:27 -0500 Subject: [PATCH 3/4] doc: .mli compiles to .cmi and .cmt --- src/ocaml_specific.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ocaml_specific.ml b/src/ocaml_specific.ml index 96c6e90c..1ec809b4 100644 --- a/src/ocaml_specific.ml +++ b/src/ocaml_specific.ml @@ -93,8 +93,8 @@ rule "target files" else Seq (List.map link_command results) end;; -rule "ocaml: mli -> cmi" - ~prod:"%.cmi" +rule "ocaml: mli -> cmi & cmt" + ~prods:["%.cmi"; "%.cmt"] ~deps:["%.mli"; "%.mli.depends"] (Ocaml_compiler.compile_ocaml_interf "%.mli" "%.cmi");; From efac69e45d0d9af544c5ef2d9a47a72a66e24481 Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Sun, 1 Feb 2026 22:37:34 -0500 Subject: [PATCH 4/4] add tag for ocamlc -dllpath For ocamlmklib this is synonymous to the existing rpath tag. Ocamlc only has -dllpath --- src/ocaml_specific.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ocaml_specific.ml b/src/ocaml_specific.ml index 1ec809b4..b92c6487 100644 --- a/src/ocaml_specific.ml +++ b/src/ocaml_specific.ml @@ -1029,6 +1029,10 @@ List.iter (fun param -> S [A "-dllib"; A param])) ["compile"; "link"];; +pflag ["ocaml"; "byte"; "link"] "dllpath" + (fun param -> S [A "-dllpath"; A param]) +;; + begin let ocamlmklib_pflag ?doc_param flag = pflag ["ocamlmklib"] flag ?doc_param @@ -1036,6 +1040,7 @@ begin ocamlmklib_pflag "cclib"; ocamlmklib_pflag "ccopt"; ocamlmklib_pflag "rpath"; + ocamlmklib_pflag "dllpath"; ocamlmklib_pflag "ldopt"; end;;