summaryrefslogtreecommitdiff
path: root/utils/ccomp.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2006-05-09 16:00:36 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2006-05-09 16:00:36 +0000
commit536dfe0d7cc30260699a0fd53701244c29a77422 (patch)
tree4f8e736690b577faaa89989ac6c2952a31159f31 /utils/ccomp.ml
parentb479c352b31b2d251d4c6791fc824c8ec9f5f86e (diff)
downloadocaml-536dfe0d7cc30260699a0fd53701244c29a77422.tar.gz
Ajout option /link /subsystem:console pour Windows/msvc et meilleur traitement des options /link passees via -ccopt
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7405 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'utils/ccomp.ml')
-rw-r--r--utils/ccomp.ml30
1 files changed, 15 insertions, 15 deletions
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
index 966011e980..1d35dced76 100644
--- a/utils/ccomp.ml
+++ b/utils/ccomp.ml
@@ -47,19 +47,6 @@ let quote_files lst =
else s
let compile_file name =
- match Config.ccomp_type with
- | "mrc" ->
- let qname = Filename.quote name in
- let includes = (Clflags.std_include_dir ()) @ !Clflags.include_dirs
- in
- let args =
- Printf.sprintf " %s %s -i %s"
- (String.concat " " (List.rev_map Filename.quote !Clflags.ccopts))
- (String.concat "," (List.rev_map Filename.quote includes))
- qname
- in
- command ("mrc " ^ args ^ " -o " ^ qname ^ ".x")
- | "cc" | "msvc" ->
command
(Printf.sprintf
"%s -c %s %s %s %s"
@@ -69,14 +56,13 @@ let compile_file name =
(List.rev_map (fun dir -> "-I" ^ dir) !Clflags.include_dirs))
(Clflags.std_include_flag "-I")
(Filename.quote name))
- | _ -> assert false
let create_archive archive file_list =
Misc.remove_file archive;
let quoted_archive = Filename.quote archive in
match Config.ccomp_type with
"msvc" ->
- command(Printf.sprintf "link /lib /nologo /debugtype:cv /out:%s %s"
+ command(Printf.sprintf "link /lib /nologo /out:%s %s"
quoted_archive (quote_files file_list))
| _ ->
let r1 =
@@ -97,3 +83,17 @@ let expand_libname name =
with Not_found ->
libname
end
+
+(* Handling of msvc's /link options *)
+
+let make_link_options optlist =
+ let rec split linkopts otheropts = function
+ | [] -> String.concat " " otheropts
+ ^ " /link /subsystem:console "
+ ^ String.concat " " linkopts
+ | opt :: rem ->
+ if String.length opt >= 5 && String.sub opt 0 5 = "/link"
+ then split (String.sub opt 5 (String.length opt - 5) :: linkopts)
+ otheropts rem
+ else split linkopts (opt :: otheropts) rem
+ in split [] [] optlist