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.
master
Sébastien Hinderer 2020-06-17 09:42:56 +02:00
parent 758ab7d1a6
commit c530b74e5e
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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 " ^