aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ml
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2018-02-22 19:08:45 +0100
committerGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2018-03-05 13:19:18 +0100
commiteefa2cf42a9fe0f9b2fe608fa01002e9a65e7e3f (patch)
treedff70a10b6f6309a5fb70491ee02252a4f0fc610 /configure.ml
parent8d2a0d56f01c907cc0a335fb19d78ee9b8c0c43d (diff)
configure: profiles (sets of flags)
Diffstat (limited to 'configure.ml')
-rw-r--r--configure.ml30
1 files changed, 27 insertions, 3 deletions
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 =
+ "<profile> 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 _ -> ()),
"<dir> Specifies path to 'ocaml' for running configure script";
+ "-profile", arg_profile,
+ Profiles.doc
]
let parse_args () =