From c530b74e5e4c7bb8f44531a3ff21eecfa03d66f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= Date: Wed, 17 Jun 2020 09:42:56 +0200 Subject: [PATCH] tools/ocamlmktop.ml: make use of the configured extension of executalbes Before this commit, the name of the compiler to use (ocamlc or ocamlc.exe) was determined base on the OS type. This commit replaces this by a mere string concatenation of "ocamlc" and the configured extension for executable files. This introduces a dependency of tools/ocamlmktop on the compiler's configuration module. --- tools/.depend | 2 ++ tools/ocamlmktop.ml | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/.depend b/tools/.depend index 109cb1f3f..442ebd4f5 100644 --- a/tools/.depend +++ b/tools/.depend @@ -135,8 +135,10 @@ ocamlmklib.cmx : \ ocamlmklibconfig.cmo : ocamlmklibconfig.cmx : ocamlmktop.cmo : \ + ../utils/config.cmi \ ../utils/ccomp.cmi ocamlmktop.cmx : \ + ../utils/config.cmx \ ../utils/ccomp.cmx ocamloptp.cmo : \ ../driver/main_args.cmi diff --git a/tools/ocamlmktop.ml b/tools/ocamlmktop.ml index ab333966a..2b47ebb07 100644 --- a/tools/ocamlmktop.ml +++ b/tools/ocamlmktop.ml @@ -20,9 +20,8 @@ let _ = cmd.exe has special quoting rules (see 'cmd.exe /?' for details). Short version: if the string passed to cmd.exe starts with '"', the first and last '"' are removed *) - let ocamlc,extra_quote = - if Sys.win32 then "ocamlc.exe","\"" else "ocamlc","" - in + let ocamlc = "ocamlc" ^ Config.ext_exe in + let extra_quote = if Sys.win32 then "\"" else "" in let ocamlc = Filename.(quote (concat (dirname ocamlmktop) ocamlc)) in let cmdline = extra_quote ^ ocamlc ^ " -I +compiler-libs -linkall ocamlcommon.cma " ^