4 let includes = ref StringSet.empty
6 let register_include dir =
7 if not (StringSet.mem dir !includes) then begin
8 includes := StringSet.add dir !includes;
10 (List.map (fun s -> dir ^ "/" ^ s )
11 (Array.to_list (Pathname.readdir dir)))
14 let set_flags tag_list action_list =
16 List.iter (fun (fl, fu) ->
23 (fun s -> register_include s; S [A"-ppopt"; A "-I"; A"-ppopt"; A s]);
24 "macro_define", (fun s -> S [A"-ppopt"; A ("-D"^s)]);
27 let () = dispatch begin
30 set_flags [["ocaml";"compile"]; ["ocaml";"ocamldep"] ] macro_flags;
31 flag [ "ocaml"; "compile"; "debug" ] (S[ A"-g"; A"-ppopt"; A"-DDEBUG"]);
32 flag [ "ocaml"; "link"; "debug" ] (A"-g");
33 flag [ "ocaml"; "compile"; "profile"] (S[A"-ppopt"; A"-DPROFILE"]);
34 flag [ "ocaml"; "compile"; "profile"; "native"] (A"-p");
35 flag [ "ocaml"; "link"; "profile"; "native"] (A"-p");
36 pflag [ "ocaml"; "compile"; "native" ] "inline" (fun i -> (S[ A"-inline"; A i ]));
37 pflag [ "ocaml"; "compile" ] "unsafe" (fun s -> (if s = "true" then S[A"-ppopt";A "-unsafe"] else N));