From 01354123b9df5d3cbb9d43298eea94ddda30acdf Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 24 Jun 2016 12:25:30 +0200 Subject: Deactivate options target dependend. Options only available for gnu systems or arm target arch are no longer displayed in the help and cannot be selected any longer. Bug 19197 --- driver/Frontend.ml | 97 +++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 48 deletions(-) (limited to 'driver/Frontend.ml') diff --git a/driver/Frontend.ml b/driver/Frontend.ml index 44ad1700..00387a05 100644 --- a/driver/Frontend.ml +++ b/driver/Frontend.ml @@ -82,36 +82,18 @@ let parse_c_file sourcename ifile = (* Add gnu preprocessor list *) let gnu_prepro_opt_key key s = - if gnu_option s then - prepro_options := s::key::!prepro_options + prepro_options := s::key::!prepro_options (* Add gnu preprocessor option *) let gnu_prepro_opt s = - if gnu_option s then - prepro_options := s::!prepro_options + prepro_options := s::!prepro_options (* Add gnu preprocessor option s and the implict -E *) let gnu_prepro_opt_e s = - if gnu_option s then begin - prepro_options := s :: !prepro_options; - option_E := true - end + prepro_options := s :: !prepro_options; + option_E := true -let prepro_actions = [ - (* Preprocessing options *) - Exact "-I", String(fun s -> prepro_options := s :: "-I" :: !prepro_options; - assembler_options := s :: "-I" :: !assembler_options); - Prefix "-I", Self(fun s -> prepro_options := s :: !prepro_options; - assembler_options := s :: !assembler_options); - Exact "-D", String(fun s -> prepro_options := s :: "-D" :: !prepro_options); - Prefix "-D", Self(fun s -> prepro_options := s :: !prepro_options); - Exact "-U", String(fun s -> prepro_options := s :: "-U" :: !prepro_options); - Prefix "-U", Self(fun s -> prepro_options := s :: !prepro_options); - Prefix "-Wp,", Self (fun s -> - prepro_options := List.rev_append (explode_comma_option s) !prepro_options); - Exact "-Xpreprocessor", String (fun s -> - prepro_options := s :: !prepro_options); - Exact "-include", String (fun s -> prepro_options := s :: "-include" :: !prepro_options); +let gnu_prepro_actions = [ Exact "-M", Self gnu_prepro_opt_e; Exact "-MM", Self gnu_prepro_opt_e; Exact "-MF", String (gnu_prepro_opt_key "-MF"); @@ -128,36 +110,55 @@ let prepro_actions = [ Exact "-C", Self gnu_prepro_opt; Exact "-CC", Self gnu_prepro_opt;] -let prepro_help = "Preprocessing options:\n\ -\ -I Add to search path for #include files\n\ -\ -include Process as if #include \"\" appears at the first\n\ -\ line of the primary source file.\n\ -\ -D= Define preprocessor symbol\n\ -\ -U Undefine preprocessor symbol\n\ -\ -Wp, Pass option to the preprocessor\n\ -\ -Xpreprocessor Pass option to the preprocessor\n\ -\ -M (GCC only) Ouput a rule suitable for make describing the\n\ +let prepro_actions = [ + (* Preprocessing options *) + Exact "-I", String(fun s -> prepro_options := s :: "-I" :: !prepro_options; + assembler_options := s :: "-I" :: !assembler_options); + Prefix "-I", Self(fun s -> prepro_options := s :: !prepro_options; + assembler_options := s :: !assembler_options); + Exact "-D", String(fun s -> prepro_options := s :: "-D" :: !prepro_options); + Prefix "-D", Self(fun s -> prepro_options := s :: !prepro_options); + Exact "-U", String(fun s -> prepro_options := s :: "-U" :: !prepro_options); + Prefix "-U", Self(fun s -> prepro_options := s :: !prepro_options); + Prefix "-Wp,", Self (fun s -> + prepro_options := List.rev_append (explode_comma_option s) !prepro_options); + Exact "-Xpreprocessor", String (fun s -> + prepro_options := s :: !prepro_options); + Exact "-include", String (fun s -> prepro_options := s :: "-include" :: !prepro_options);] + @ (if Configuration.system <> "diab" then gnu_prepro_actions else []) + +let gnu_prepro_help = +"\ -M Ouput a rule suitable for make describing the\n\ \ dependencies of the main source file\n\ -\ -MM (GCC only) Like -M but do not mention system header files\n\ -\ -MF (GCC only) Specifies file as output file for -M or -MM\n\ -\ -MG (GCC only) Assumes missing header files are generated for -M\n\ -\ -MP (GCC only) Add a phony target for each dependency other than\n\ +\ -MM Like -M but do not mention system header files\n\ +\ -MF Specifies file as output file for -M or -MM\n\ +\ -MG Assumes missing header files are generated for -M\n\ +\ -MP Add a phony target for each dependency other than\n\ \ the main file\n\ -\ -MT (GCC only) Change the target of the rule emitted by dependency\n\ +\ -MT Change the target of the rule emitted by dependency\n\ \ generation\n\ -\ -MQ (GCC only) Like -MT but quotes \n\ -\ -nostdinc (GCC only) Do not search the standard system directories for\n\ +\ -MQ Like -MT but quotes \n\ +\ -nostdinc Do not search the standard system directories for\n\ \ header files\n\ -\ -imacros (GCC only) Like -include but throws output produced by\n\ +\ -imacros Like -include but throws output produced by\n\ \ preprocessing of away\n\ -\ -idirafter (GCC only) Search for header files after all directories\n\ +\ -idirafter Search for header files after all directories\n\ \ specified with -I and the standard system directories\n\ -\ -isystem (GCC only) Search for header files after all directories\n\ -\ +\ -isystem Search for header files after all directories\n\ \ specified by -I but before the standard system directories\n\ -\ -iquote (GCC only) Like -isystem but only for headers included with\n\ -\ quotes\n\ -\ -P (GCC only) Do not generate linemarkers\n\ -\ -C (GCC only) Do not discard comments\n\ -\ -CC (GCC only) Do not discard comments, including during macro\n\ +\ -iquote Like -isystem but only for headers included with\n\ +\ quotes\n\ +\ -P Do not generate linemarkers\n\ +\ -C Do not discard comments\n\ +\ -CC Do not discard comments, including during macro\n\ \ expansion\n" + +let prepro_help = "Preprocessing options:\n\ +\ -I Add to search path for #include files\n\ +\ -include Process as if #include \"\" appears at the first\n\ +\ line of the primary source file.\n\ +\ -D= Define preprocessor symbol\n\ +\ -U Undefine preprocessor symbol\n\ +\ -Wp, Pass option to the preprocessor\n\ +\ -Xpreprocessor Pass option to the preprocessor\n" + ^ (if Configuration.system <> "diab" then gnu_prepro_help else "") -- cgit