aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-10-10 15:54:38 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-10-10 15:54:38 +0200
commitf790c6ac8b16f71aae4868cbcad87a39f50727e3 (patch)
tree026665b355bf3c2712c3148b8e459e85ee10199a /configure.ml
parent16f169b3c756aa3c5cbc38eb13412ba23ae2937d (diff)
parent1d8725b59309c2c9f870eb52a2daebe87ed9ad5b (diff)
Merge PR #540: [configure] Support for flambda flags.
Diffstat (limited to 'configure.ml')
-rw-r--r--configure.ml16
1 files changed, 12 insertions, 4 deletions
diff --git a/configure.ml b/configure.ml
index 3b6894bfc..a7acdf532 100644
--- a/configure.ml
+++ b/configure.ml
@@ -260,6 +260,7 @@ module Prefs = struct
let withdoc = ref false
let geoproof = ref false
let byteonly = ref false
+ let flambda_flags = ref []
let debug = ref true
let profile = ref false
let annotate = ref false
@@ -305,6 +306,9 @@ let args_options = Arg.align [
"-camlp5dir",
Arg.String (fun s -> Prefs.camlp5dir:=Some s),
"<dir> Specifies where is the Camlp5 library and tells to use it";
+ "-flambda-opts",
+ Arg.String (fun s -> Prefs.flambda_flags := string_split ' ' s),
+ "<flags> Specifies additional flags to be passed to the flambda optimizing compiler";
"-arch", arg_string_option Prefs.arch,
"<arch> Specifies the architecture";
"-natdynlink", arg_bool Prefs.natdynlink,
@@ -949,7 +953,6 @@ let config_runtime () =
let vmbyteflags = config_runtime ()
-
(** * Summary of the configuration *)
let print_summary () =
@@ -964,6 +967,7 @@ let print_summary () =
pr " OCaml version : %s\n" caml_version;
pr " OCaml binaries in : %s\n" camlbin;
pr " OCaml library in : %s\n" camllib;
+ pr " OCaml flambda flags : %s\n" (String.concat " " !Prefs.flambda_flags);
pr " %s version : %s\n" capitalized_camlpX camlpX_version;
pr " %s binaries in : %s\n" capitalized_camlpX camlpXbindir;
pr " %s library in : %s\n" capitalized_camlpX camlpXlibdir;
@@ -1013,7 +1017,6 @@ let write_dbg_wrapper f =
let _ = write_dbg_wrapper "dev/ocamldebug-coq"
-
(** * Build the config/coq_config.ml file *)
let write_configml f =
@@ -1024,8 +1027,9 @@ let write_configml f =
let pr_b = pr "let %s = %B\n" in
let pr_i = pr "let %s = %d\n" in
let pr_p s o = pr "let %s = %S\n" s
- (match o with Relative s -> s | Absolute s -> s)
- in
+ (match o with Relative s -> s | Absolute s -> s) in
+ let pr_l n l = pr "let %s = [%s]\n" n (String.concat ";" (List.map (fun s -> "\"" ^ s ^ "\"") l)) in
+ let pr_li n l = pr "let %s = [%s]\n" n (String.concat ";" (List.map string_of_int l)) in
pr "(* DO NOT EDIT THIS FILE: automatically generated by ../configure *)\n";
pr "(* Exact command that generated this file: *)\n";
pr "(* %s *)\n\n" (String.concat " " (Array.to_list Sys.argv));
@@ -1055,6 +1059,7 @@ let write_configml f =
pr_s "osdeplibs" osdeplibs;
pr_s "version" coq_version;
pr_s "caml_version" caml_version;
+ pr_li "caml_version_nums" caml_version_nums;
pr_s "date" short_date;
pr_s "compile_date" full_date;
pr_s "arch" arch;
@@ -1065,6 +1070,7 @@ let write_configml f =
pr "let gtk_platform = `%s\n" !idearchdef;
pr_b "has_natdynlink" hasnatdynlink;
pr_s "natdynlinkflag" natdynlinkflag;
+ pr_l "flambda_flags" !Prefs.flambda_flags;
pr_i "vo_magic_number" vo_magic;
pr_i "state_magic_number" state_magic;
pr "let with_geoproof = ref %B\n" !Prefs.geoproof;
@@ -1160,6 +1166,8 @@ let write_makefile f =
pr "CAMLFLAGS=%s %s\n" caml_flags coq_caml_flags;
pr "# User compilation flag\n";
pr "USERFLAGS=\n\n";
+ (* XXX make this configurable *)
+ pr "FLAMBDA_FLAGS=%s\n" (String.concat " " !Prefs.flambda_flags);
pr "# Flags for GCC\n";
pr "CFLAGS=%s\n\n" cflags;
pr "# Compilation debug flags\n";