summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2008-12-03 18:09:09 +0000
committerDamien Doligez <damien.doligez-inria.fr>2008-12-03 18:09:09 +0000
commit1f95b175707ec490f8bf08c6c28f2dee203818cb (patch)
treef004cd5ba13d81b1182b65def6f3e20c6bda3798 /utils
parentc52e649d83e34967da0fd2a70faf5c91070c8a91 (diff)
downloadocaml-1f95b175707ec490f8bf08c6c28f2dee203818cb.tar.gz
merge changes from 3.10.2merged to 3.11.0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9153 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'utils')
-rw-r--r--utils/ccomp.ml22
-rw-r--r--utils/clflags.ml3
-rw-r--r--utils/clflags.mli2
3 files changed, 16 insertions, 11 deletions
diff --git a/utils/ccomp.ml b/utils/ccomp.ml
index 3cb192e318..fbbbdf10b3 100644
--- a/utils/ccomp.ml
+++ b/utils/ccomp.ml
@@ -24,7 +24,7 @@ let command cmdline =
let run_command cmdline = ignore(command cmdline)
-(* Build @responsefile to work around Windows limitations on
+(* Build @responsefile to work around Windows limitations on
command-line length *)
let build_diversion lst =
let (responsefile, oc) = Filename.open_temp_file "camlresp" "" in
@@ -54,7 +54,12 @@ let compile_file name =
command
(Printf.sprintf
"%s -c %s %s %s %s"
- !Clflags.c_compiler
+ (match !Clflags.c_compiler with
+ | Some cc -> cc
+ | None ->
+ if !Clflags.native_code
+ then Config.native_c_compiler
+ else Config.bytecomp_c_compiler)
(String.concat " " (List.rev !Clflags.ccopts))
(quote_prefixed "-I" (List.rev !Clflags.include_dirs))
(Clflags.std_include_flag "-I")
@@ -104,15 +109,16 @@ let call_linker mode output_name files extra =
extra
else
Printf.sprintf "%s -o %s %s %s %s %s %s %s"
- (match mode with
- | Exe -> Config.mkexe
- | Dll -> Config.mkdll
- | MainDll -> Config.mkmaindll
- | Partial -> assert false
+ (match !Clflags.c_compiler, mode with
+ | Some cc, _ -> cc
+ | None, Exe -> Config.mkexe
+ | None, Dll -> Config.mkdll
+ | None, MainDll -> Config.mkmaindll
+ | None, Partial -> assert false
)
(Filename.quote output_name)
(if !Clflags.gprofile then Config.cc_profile else "")
- (Clflags.std_include_flag "-I")
+ "" (*(Clflags.std_include_flag "-I")*)
(quote_prefixed "-L" !Config.load_path)
files
extra
diff --git a/utils/clflags.ml b/utils/clflags.ml
index 94494dac4a..38445235cf 100644
--- a/utils/clflags.ml
+++ b/utils/clflags.ml
@@ -46,7 +46,7 @@ and principal = ref false (* -principal *)
and recursive_types = ref false (* -rectypes *)
and make_runtime = ref false (* -make_runtime *)
and gprofile = ref false (* -p *)
-and c_compiler = ref Config.bytecomp_c_compiler (* -cc *)
+and c_compiler = ref (None: string option) (* -cc *)
and no_auto_link = ref false (* -noautolink *)
and dllpaths = ref ([] : string list) (* -dllpath *)
and make_package = ref false (* -pack *)
@@ -90,4 +90,3 @@ let std_include_dir () =
let shared = ref false (* -shared *)
let dlcode = ref true (* not -nodynlink *)
-
diff --git a/utils/clflags.mli b/utils/clflags.mli
index 8ba36210e1..af4ded9a6e 100644
--- a/utils/clflags.mli
+++ b/utils/clflags.mli
@@ -43,7 +43,7 @@ val principal : bool ref
val recursive_types : bool ref
val make_runtime : bool ref
val gprofile : bool ref
-val c_compiler : string ref
+val c_compiler : string option ref
val no_auto_link : bool ref
val dllpaths : string list ref
val make_package : bool ref