From a3c8cd0170e599b4cb1fdb63a17edd1b52bb207b Mon Sep 17 00:00:00 2001 From: Wojciech Meyer Date: Dec 22 2012 01:34:21 +0000 Subject: Fix PR#5752. Patch by Grégoire Sutre! git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13154 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- diff --git a/ocamlbuild/ocaml_compiler.ml b/ocamlbuild/ocaml_compiler.ml index 8e65f00..218842f 100644 --- a/ocamlbuild/ocaml_compiler.ml +++ b/ocamlbuild/ocaml_compiler.ml @@ -145,6 +145,12 @@ let rec prepare_link tag cmx extensions build = (if Pathname.exists (ml-.-"depends") then path_dependencies_of ml else []) (if Pathname.exists (mli-.-"depends") then path_dependencies_of mli else []) in + let modules = + if (modules = []) && (Pathname.exists (ml^"pack")) then + List.map (fun s -> (`mandatory, s)) (string_list_of_file (ml^"pack")) + else + modules + in if modules <> [] && not (Hashtbl.mem cache_prepare_link key) then let () = Hashtbl.add cache_prepare_link key true in let modules' = List.map (fun (_, x) -> expand_module include_dirs x extensions) modules in