aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ml
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2016-06-27 23:49:09 +0200
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-10-10 10:47:31 +0200
commit406717ce786a70e64b9043db45dd5a2add68f817 (patch)
treef37eeae1efcc765045ff1851cb79518cb23bf4e1 /configure.ml
parentf927df44202034fa8cf73f72af876ae1e4ca05ba (diff)
[configure] Support for flambda flags.
We add a new option to configure `-flambda-opts` to allow passing custom flags to flambda. Example: ``` ./configure -flambda-opts "-O3 -unbox-closures" ```
Diffstat (limited to 'configure.ml')
-rw-r--r--configure.ml13
1 files changed, 10 insertions, 3 deletions
diff --git a/configure.ml b/configure.ml
index fc2233f78..3ba1986c0 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,7 +1027,8 @@ 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)
+ (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
pr "(* DO NOT EDIT THIS FILE: automatically generated by ../configure *)\n";
pr "(* Exact command that generated this file: *)\n";
@@ -1065,6 +1069,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 +1165,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";