The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #10406 from kit-ty-kate/fix-ocamldep-help

Fix ocamldep -help

authored by

Gabriel Scherer and committed by
GitHub
ea2b1653 49528a69

+62 -55
+2 -2
Changes
··· 350 350 351 351 ### Build system: 352 352 353 - - #10289: Do not print option documentation in usage messages. 354 - (Pavlo Khrystenko, review by Gabriel Scherer) 353 + - #10289, #10406: Do not print option documentation in usage messages. 354 + (Pavlo Khrystenko, review by Gabriel Scherer, fix by Kate Deplaix) 355 355 356 356 - #9191, #10091, #10182: take the LDFLAGS variable into account, except on 357 357 flexlink-using systems.
+60 -53
driver/makedepend.ml
··· 591 591 let dep_args_rev : dep_arg list ref = ref [] in 592 592 let add_dep_arg f s = dep_args_rev := (f s) :: !dep_args_rev in 593 593 Clflags.classic := false; 594 - Compenv.readenv ppf Before_args; 595 - Clflags.reset_arguments (); (* reset arguments from ocamlc/ocamlopt *) 596 - Clflags.add_arguments __LOC__ [ 597 - "-absname", Arg.Set Clflags.absname, 594 + try 595 + Compenv.readenv ppf Before_args; 596 + Clflags.reset_arguments (); (* reset arguments from ocamlc/ocamlopt *) 597 + Clflags.add_arguments __LOC__ [ 598 + "-absname", Arg.Set Clflags.absname, 598 599 " Show absolute filenames in error messages"; 599 - "-all", Arg.Set all_dependencies, 600 + "-all", Arg.Set all_dependencies, 600 601 " Generate dependencies on all files"; 601 - "-allow-approx", Arg.Set allow_approximation, 602 + "-allow-approx", Arg.Set allow_approximation, 602 603 " Fallback to a lexer-based approximation on unparsable files"; 603 - "-as-map", Arg.Set Clflags.transparent_modules, 604 - " Omit delayed dependencies for module aliases (-no-alias-deps -w -49)"; 605 - (* "compiler uses -no-alias-deps, and no module is coerced"; *) 606 - "-debug-map", Arg.Set debug, 604 + "-as-map", Arg.Set Clflags.transparent_modules, 605 + " Omit delayed dependencies for module aliases (-no-alias-deps -w -49)"; 606 + (* "compiler uses -no-alias-deps, and no module is coerced"; *) 607 + "-debug-map", Arg.Set debug, 607 608 " Dump the delayed dependency map for each map file"; 608 - "-I", Arg.String (add_to_list Clflags.include_dirs), 609 + "-I", Arg.String (add_to_list Clflags.include_dirs), 609 610 "<dir> Add <dir> to the list of include directories"; 610 - "-nocwd", Arg.Set nocwd, 611 + "-nocwd", Arg.Set nocwd, 611 612 " Do not add current working directory to \ 612 613 the list of include directories"; 613 - "-impl", Arg.String (add_dep_arg (fun f -> Src (f, Some ML))), 614 + "-impl", Arg.String (add_dep_arg (fun f -> Src (f, Some ML))), 614 615 "<f> Process <f> as a .ml file"; 615 - "-intf", Arg.String (add_dep_arg (fun f -> Src (f, Some MLI))), 616 + "-intf", Arg.String (add_dep_arg (fun f -> Src (f, Some MLI))), 616 617 "<f> Process <f> as a .mli file"; 617 - "-map", Arg.String (add_dep_arg (fun f -> Map f)), 618 + "-map", Arg.String (add_dep_arg (fun f -> Map f)), 618 619 "<f> Read <f> and propagate delayed dependencies to following files"; 619 - "-ml-synonym", Arg.String(add_to_synonym_list ml_synonyms), 620 + "-ml-synonym", Arg.String(add_to_synonym_list ml_synonyms), 620 621 "<e> Consider <e> as a synonym of the .ml extension"; 621 - "-mli-synonym", Arg.String(add_to_synonym_list mli_synonyms), 622 + "-mli-synonym", Arg.String(add_to_synonym_list mli_synonyms), 622 623 "<e> Consider <e> as a synonym of the .mli extension"; 623 - "-modules", Arg.Set raw_dependencies, 624 + "-modules", Arg.Set raw_dependencies, 624 625 " Print module dependencies in raw form (not suitable for make)"; 625 - "-native", Arg.Set native_only, 626 + "-native", Arg.Set native_only, 626 627 " Generate dependencies for native-code only (no .cmo files)"; 627 - "-bytecode", Arg.Set bytecode_only, 628 + "-bytecode", Arg.Set bytecode_only, 628 629 " Generate dependencies for bytecode-code only (no .cmx files)"; 629 - "-one-line", Arg.Set one_line, 630 + "-one-line", Arg.Set one_line, 630 631 " Output one line per file, regardless of the length"; 631 - "-open", Arg.String (add_to_list Clflags.open_modules), 632 + "-open", Arg.String (add_to_list Clflags.open_modules), 632 633 "<module> Opens the module <module> before typing"; 633 - "-plugin", Arg.String(fun _p -> Clflags.plugin := true), 634 - "<plugin> (no longer supported)"; 635 - "-pp", Arg.String(fun s -> Clflags.preprocessor := Some s), 636 - "<cmd> Pipe sources through preprocessor <cmd>"; 637 - "-ppx", Arg.String (add_to_list Compenv.first_ppx), 638 - "<cmd> Pipe abstract syntax trees through preprocessor <cmd>"; 639 - "-shared", Arg.Set shared, 640 - " Generate dependencies for native plugin files (.cmxs targets)"; 641 - "-slash", Arg.Set Clflags.force_slash, 642 - " (Windows) Use forward slash / instead of backslash \\ in file paths"; 643 - "-sort", Arg.Set sort_files, 634 + "-plugin", Arg.String(fun _p -> Clflags.plugin := true), 635 + "<plugin> (no longer supported)"; 636 + "-pp", Arg.String(fun s -> Clflags.preprocessor := Some s), 637 + "<cmd> Pipe sources through preprocessor <cmd>"; 638 + "-ppx", Arg.String (add_to_list Compenv.first_ppx), 639 + "<cmd> Pipe abstract syntax trees through preprocessor <cmd>"; 640 + "-shared", Arg.Set shared, 641 + " Generate dependencies for native plugin files (.cmxs targets)"; 642 + "-slash", Arg.Set Clflags.force_slash, 643 + " (Windows) Use forward slash / instead of backslash \\ in file paths"; 644 + "-sort", Arg.Set sort_files, 644 645 " Sort files according to their dependencies"; 645 - "-version", Arg.Unit print_version, 646 - " Print version and exit"; 647 - "-vnum", Arg.Unit print_version_num, 648 - " Print version number and exit"; 649 - "-args", Arg.Expand Arg.read_arg, 650 - "<file> Read additional newline separated command line arguments \n\ 651 - \ from <file>"; 652 - "-args0", Arg.Expand Arg.read_arg0, 653 - "<file> Read additional NUL separated command line arguments from \n\ 654 - \ <file>" 655 - ]; 656 - let program = Filename.basename Sys.argv.(0) in 657 - Compenv.parse_arguments (ref argv) 646 + "-version", Arg.Unit print_version, 647 + " Print version and exit"; 648 + "-vnum", Arg.Unit print_version_num, 649 + " Print version number and exit"; 650 + "-args", Arg.Expand Arg.read_arg, 651 + "<file> Read additional newline separated command line arguments \n\ 652 + \ from <file>"; 653 + "-args0", Arg.Expand Arg.read_arg0, 654 + "<file> Read additional NUL separated command line arguments from \n\ 655 + \ <file>" 656 + ]; 657 + let program = Filename.basename Sys.argv.(0) in 658 + Compenv.parse_arguments (ref argv) 658 659 (add_dep_arg (fun f -> Src (f, None))) program; 659 - process_dep_args (List.rev !dep_args_rev); 660 - Compenv.readenv ppf Before_link; 661 - if !sort_files then sort_files_by_dependencies !files 662 - else List.iter print_file_dependencies (List.sort compare !files); 663 - exit (if Error_occurred.get () then 2 else 0) 660 + process_dep_args (List.rev !dep_args_rev); 661 + Compenv.readenv ppf Before_link; 662 + if !sort_files then sort_files_by_dependencies !files 663 + else List.iter print_file_dependencies (List.sort compare !files); 664 + (if Error_occurred.get () then 2 else 0) 665 + with 666 + | Compenv.Exit_with_status n -> 667 + n 668 + | exn -> 669 + Location.report_exception ppf exn; 670 + 2 664 671 665 672 666 673 let main () = 667 - run_main Sys.argv 674 + exit (run_main Sys.argv) 668 675 669 676 let main_from_option () = 670 677 if Sys.argv.(1) <> "-depend" then begin ··· 676 683 Array.concat [ [| Sys.argv.(0) ^ " -depend" |]; 677 684 Array.sub Sys.argv 2 (Array.length Sys.argv - 2) ] in 678 685 Sys.argv.(0) <- args.(0); 679 - run_main args 686 + exit (run_main args)