aboutsummaryrefslogtreecommitdiff
path: root/configure.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2018-09-27 00:41:39 +0200
committerEmilio Jesus Gallego Arias2018-09-27 16:53:07 +0200
commit615c29be047eafac1ec1a9a853afe5a577873771 (patch)
tree00aa103a88de575c181755fc082519e26113ca58 /configure.ml
parent19f5b6a7d467f75b334e769ebe30cf6459c86855 (diff)
[configure] [dune] Don't force the Dune user to set envars.
In order to support sending the OPAM prefix to configure via Dune, we introduced a `COQ_CONFIGURE_PREFIX` variable. However, this had the pitfall that now the developer had to set it or else face a hanging build due to configure expecting user input. While we wait for a larger cleanup in `-prefix`, we introduce a `no-ask` option in `./configure` that will avoid this problem. If `-no-ask` is passed to `configure` no interactive question or display will be shown to the user.
Diffstat (limited to 'configure.ml')
-rw-r--r--configure.ml17
1 files changed, 14 insertions, 3 deletions
diff --git a/configure.ml b/configure.ml
index d010b44e54..da6a6f8cbf 100644
--- a/configure.ml
+++ b/configure.ml
@@ -242,6 +242,7 @@ type ide = Opt | Byte | No
type preferences = {
prefix : string option;
local : bool;
+ interactive : bool;
vmbyteflags : string option;
custom : bool option;
bindir : string option;
@@ -279,6 +280,7 @@ module Profiles = struct
let default = {
prefix = None;
local = false;
+ interactive = true;
vmbyteflags = None;
custom = None;
bindir = None;
@@ -331,6 +333,11 @@ end
let prefs = ref Profiles.default
+(* Support don't ask *)
+let cprintf x =
+ if !prefs.interactive
+ then cprintf x
+ else Printf.ifprintf stdout x
let get_bool = function
| "true" | "yes" | "y" | "all" -> true
@@ -366,6 +373,8 @@ let args_options = Arg.align [
"<dir> Set installation directory to <dir>";
"-local", arg_set (fun p local -> { p with local }),
" Set installation directory to the current source tree";
+ "-no-ask", arg_clear (fun p interactive -> { p with interactive }),
+ " Don't ask questions / print variables during configure [questions will be filled with defaults]";
"-vmbyteflags", arg_string_option (fun p vmbyteflags -> { p with vmbyteflags }),
"<flags> Comma-separated link flags for the VM of coqtop.byte";
"-custom", arg_set_option (fun p custom -> { p with custom }),
@@ -1043,7 +1052,9 @@ let do_one_instdir (var,msg,uservalue,selfcontainedlayout,unixlayout,locallayout
| None ->
begin
try Some (Sys.getenv "COQ_CONFIGURE_PREFIX")
- with Not_found -> None
+ with
+ | Not_found when !prefs.interactive -> None
+ | Not_found -> Some "_build/default/install"
end
| p -> p
in match uservalue, env_prefix with
@@ -1144,8 +1155,8 @@ let print_summary () =
pr "*Warning* To compile the system for a new architecture\n";
pr " don't forget to do a 'make clean' before './configure'.\n"
-let _ = print_summary ()
-
+let _ =
+ if !prefs.interactive then print_summary ()
(** * Build the dev/ocamldebug-coq file *)