diff --git a/Changes b/Changes index 97e02790b..e8f9f746a 100644 --- a/Changes +++ b/Changes @@ -49,6 +49,8 @@ Toplevel and debugger: OCamlbuild: - PR#6712: Ignore common VCS directories (Peter Zotov) +- explicit "linkpkg" and "dontlink(foo)" flags + (Peter Zotov, Gabriel Scherer) Bug fixes: - PR#5836, PR#6684: printing lazy values in ocamldebug may segfault diff --git a/ocamlbuild/ocaml_specific.ml b/ocamlbuild/ocaml_specific.ml index 32f2fa57f..72de3ebbe 100644 --- a/ocamlbuild/ocaml_specific.ml +++ b/ocamlbuild/ocaml_specific.ml @@ -560,6 +560,14 @@ let () = flag ["ocaml"; "link"; "program"] & A"-linkpkg"; flag ["ocaml"; "link"; "toplevel"] & A"-linkpkg"; + (* "program" will make sure that -linkpkg is passed when compiling + whole-programs (.byte and .native); but it is occasionally + useful to pass -linkpkg when building archives for example + (.cma and .cmxa); the "linkpkg" flag allows user to request it + explicitly. *) + flag ["ocaml"; "link"; "linkpkg"] & A"-linkpkg"; + pflag ["ocaml"; "link"] "dontlink" (fun pkg -> S[A"-dontlink"; A pkg]); + let all_tags = [ ["ocaml"; "byte"; "compile"]; ["ocaml"; "native"; "compile"];