aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Tassi2015-02-11 17:59:50 +0100
committerEnrico Tassi2015-02-11 18:03:17 +0100
commit4261cc40270ee8abfa8ced859a8fb0b209cc78a8 (patch)
tree77acb09b7d8174db2877ef1406bf7f9869fc343e
parent1eb1083a4e135fba5a69c48af55333453a6a17df (diff)
Win: use .exe extension for the ocaml compiler (Close 3572)
-rw-r--r--configure.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.ml b/configure.ml
index 559e7ea1a7..0c1d39127f 100644
--- a/configure.ml
+++ b/configure.ml
@@ -77,7 +77,12 @@ let read_lines_and_close fd =
type err = StdErr | StdOut | DevNull
+let exe = ref "" (* Will be set later on, when the suffix is known *)
+
let run ?(fatal=true) ?(err=StdErr) prog args =
+ let prog = (* Ensure prog ends with exe *)
+ if Str.string_match (Str.regexp ("^.*" ^ !exe ^ "$")) prog 0
+ then prog else (prog ^ !exe) in
let argv = Array.of_list (prog::args) in
try
let out_r,out_w = Unix.pipe () in
@@ -431,7 +436,7 @@ let arch = match !Prefs.arch with
let arch_win32 = (arch = "win32")
-let exe = if arch_win32 then ".exe" else ""
+let exe = exe := if arch_win32 then ".exe" else ""; !exe
let dll = if os_type_win32 then ".dll" else ".so"
(** * VCS