1 (***********************************************************************)
4 (* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
6 (* Copyright 2007 Institut National de Recherche en Informatique et *)
7 (* en Automatique. All rights reserved. This file is distributed *)
8 (* under the terms of the Q Public License version 1.0. *)
10 (***********************************************************************)
13 (* Original author: Nicolas Pouillard *)
19 open Pathname.Operators
23 let pp_l = List.print
String.print
25 let tags_of_pathname p
=
26 Configuration.tags_of_filename
(Pathname.to_string p
)
28 ++("extension:"^
Pathname.get_extension p
)
29 let flags_of_pathname p
= Configuration.flags_of_filename
(Pathname.to_string p
)
31 let opt_print elt ppf
=
33 | Some x
-> fprintf ppf
"@[<2>Some@ %a@]" elt x
34 | None
-> pp_print_string ppf
"None"
36 let path_and_context_of_string s
=
37 if Pathname.is_implicit s
then
38 let b = Pathname.basename s
in
39 let d = Pathname.dirname s
in
40 if d <> Pathname.current_dir_name
then
41 let () = Pathname.define_context
d [d] in
44 let include_dirs = Pathname.include_dirs_of
d in
45 List.map
(fun include_dir
-> include_dir
/b) include_dirs