From 335a3d971e9cc5d9f3365126f7a78a8d0c1007e3 Mon Sep 17 00:00:00 2001 From: letouzey Date: Mon, 6 Aug 2012 14:42:57 +0000 Subject: Win32: some quote fixes git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15688 85f007b7-540e-0410-9357-904b9bb8a0f7 --- scripts/coqmktop.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/coqmktop.ml b/scripts/coqmktop.ml index bd4dec2b6f..51c3fbb942 100644 --- a/scripts/coqmktop.ml +++ b/scripts/coqmktop.ml @@ -260,14 +260,14 @@ let main () = if !opt then begin (* native code *) if !top then failwith "no custom toplevel in native code !"; - let ocamloptexec = Filename.concat camlbin "ocamlopt" in + let ocamloptexec = Filename.quote (Filename.concat camlbin "ocamlopt") in ocamloptexec^" -linkall" end else (* bytecode (we shunt ocamlmktop script which fails on win32) *) let ocamlmktoplib = if is_ocaml4 then " ocamlcommon.cma ocamlbytecomp.cma ocamltoplevel.cma" else " toplevellib.cma" in - let ocamlcexec = Filename.concat camlbin "ocamlc" in + let ocamlcexec = Filename.quote (Filename.concat camlbin "ocamlc") in let ocamlccustom = Printf.sprintf "%s %s -linkall " ocamlcexec Coq_config.coqrunbyteflags in (if !top then ocamlccustom^ocamlmktoplib else ocamlccustom) @@ -290,6 +290,10 @@ let main () = let args = if !top then args @ [ "topstart.cmo" ] else args in (* Now, with the .cma, we MUST use the -linkall option *) let command = String.concat " " (prog::"-rectypes"::args) in + (* In Win32, when Sys.command (and hence cmd.exe) executes a command + that may contains many double-quote, we should double-quote the whole ! *) + let command = if Sys.os_type = "Win32" then "\""^command^"\"" else command + in if !echo then begin print_endline command; -- cgit v1.2.3