From eefa2cf42a9fe0f9b2fe608fa01002e9a65e7e3f Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 22 Feb 2018 19:08:45 +0100 Subject: configure: profiles (sets of flags) --- configure.ml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'configure.ml') diff --git a/configure.ml b/configure.ml index 058109482..5d9722a4f 100644 --- a/configure.ml +++ b/configure.ml @@ -271,7 +271,9 @@ type preferences = { warn_error : bool; } -let default_preferences = { +module Profiles = struct + +let default = { prefix = None; local = false; vmbyteflags = None; @@ -307,7 +309,25 @@ let default_preferences = { warn_error = false; } -let prefs = ref default_preferences +let devel state = { state with + local = true; + bin_annot = true; + annot = true; + warn_error = true; +} +let devel_doc = "-local -annot -bin-annot -warn-error" + +let get = function + | "devel" -> devel + | s -> raise (Arg.Bad ("profile name expected instead of "^s)) + +let doc = + " Sets a bunch of flags. Supported profiles: + devel = " ^ devel_doc + +end + +let prefs = ref Profiles.default let get_bool = function @@ -335,6 +355,8 @@ let arg_clear_option f = Arg.Unit (fun () -> prefs := f !prefs (Some false)) let arg_ide f = Arg.String (fun s -> prefs := f !prefs (Some (get_ide s))) +let arg_profile = Arg.String (fun s -> prefs := Profiles.get s !prefs) + (* TODO : earlier any option -foo was also available as --foo *) let args_options = Arg.align [ @@ -388,7 +410,7 @@ let args_options = Arg.align [ " Compiles only bytecode version of Coq"; "-nodebug", arg_clear (fun p debug -> { p with debug }), " Do not add debugging information in the Coq executables"; - "-profile", arg_set (fun p profile -> { p with profile }), + "-profiling", arg_set (fun p profile -> { p with profile }), " Add profiling information in the Coq executables"; "-annotate", Arg.Unit (fun () -> printf "*Warning* -annotate is deprecated. Please use -annot or -bin-annot instead.\n"), " Deprecated. Please use -annot or -bin-annot instead"; @@ -410,6 +432,8 @@ let args_options = Arg.align [ " Make OCaml warnings into errors"; "-camldir", Arg.String (fun _ -> ()), " Specifies path to 'ocaml' for running configure script"; + "-profile", arg_profile, + Profiles.doc ] let parse_args () = -- cgit v1.2.3