diff options
| author | Alain Frisch <alain@frisch.fr> | 2014-08-07 09:46:34 +0000 |
|---|---|---|
| committer | Alain Frisch <alain@frisch.fr> | 2014-08-07 09:46:34 +0000 |
| commit | 047e09748c91e1d8f80b51edfc33de76fbfc57da (patch) | |
| tree | 82123e647183306f57d41efcfee9edecafcb169b /tools | |
| parent | cc9cbfc75575499e51473984b88327e19e642a00 (diff) | |
| download | ocaml-047e09748c91e1d8f80b51edfc33de76fbfc57da.tar.gz | |
Cherry-pick 15062,15063,15064 from 4.02 (#6497).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/Makefile.shared | 2 | ||||
| -rw-r--r-- | tools/ocamlcp.ml | 1 | ||||
| -rw-r--r-- | tools/ocamldep.ml | 9 |
3 files changed, 7 insertions, 5 deletions
diff --git a/tools/Makefile.shared b/tools/Makefile.shared index c4c903030e..251743449f 100644 --- a/tools/Makefile.shared +++ b/tools/Makefile.shared @@ -39,7 +39,7 @@ CAMLDEP_OBJ=depend.cmo ocamldep.cmo CAMLDEP_IMPORTS=misc.cmo config.cmo clflags.cmo terminfo.cmo \ warnings.cmo location.cmo longident.cmo \ syntaxerr.cmo ast_helper.cmo parser.cmo lexer.cmo parse.cmo \ - ccomp.cmo pparse.cmo compenv.cmo + ccomp.cmo ast_mapper.cmo pparse.cmo compenv.cmo ocamldep: depend.cmi $(CAMLDEP_OBJ) $(CAMLC) $(LINKFLAGS) -compat-32 -o ocamldep $(CAMLDEP_IMPORTS) $(CAMLDEP_OBJ) diff --git a/tools/ocamlcp.ml b/tools/ocamlcp.ml index 5c90c8d0f0..75adcb82ef 100644 --- a/tools/ocamlcp.ml +++ b/tools/ocamlcp.ml @@ -54,6 +54,7 @@ module Options = Main_args.Make_bytecomp_options (struct let _dllib = option_with_arg "-dllib" let _dllpath = option_with_arg "-dllpath" let _dtypes = option "-dtypes" + let _for_pack = option_with_arg "-for-pack" let _g = option "-g" let _i = option "-i" let _I s = option_with_arg "-I" s diff --git a/tools/ocamldep.ml b/tools/ocamldep.ml index c623ff73d3..59fecc412c 100644 --- a/tools/ocamldep.ml +++ b/tools/ocamldep.ml @@ -18,7 +18,6 @@ let ppf = Format.err_formatter type file_kind = ML | MLI;; -let include_dirs = ref [] let load_path = ref ([] : (string * string array) list) let ml_synonyms = ref [".ml"] let mli_synonyms = ref [".mli"] @@ -213,13 +212,15 @@ let report_err exn = Location.report_error err | None -> raise x +let tool_name = "ocamldep" + let read_parse_and_extract parse_function extract_function magic source_file = Depend.free_structure_names := Depend.StringSet.empty; try let input_file = Pparse.preprocess source_file in begin try let ast = - Pparse.file Format.err_formatter input_file parse_function magic in + Pparse.file ~tool_name Format.err_formatter input_file parse_function magic in extract_function Depend.StringSet.empty ast; Pparse.remove_preprocessed input_file; !Depend.free_structure_names @@ -295,7 +296,7 @@ let file_dependencies_as kind source_file = load_path := []; List.iter add_to_load_path ( (!Compenv.last_include_dirs @ - !include_dirs @ + !Clflags.include_dirs @ !Compenv.first_include_dirs )); Location.input_name := source_file; @@ -411,7 +412,7 @@ let _ = " Show absolute filenames in error messages"; "-all", Arg.Set all_dependencies, " Generate dependencies on all files"; - "-I", Arg.String (fun s -> include_dirs := s :: !include_dirs), + "-I", Arg.String (fun s -> Clflags.include_dirs := s :: !Clflags.include_dirs), "<dir> Add <dir> to the list of include directories"; "-impl", Arg.String (file_dependencies_as ML), "<f> Process <f> as a .ml file"; |
