Fix: compilo C different quand on compile en natif.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1627 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
a7ab31f37c
commit
3cf9325149
|
@ -474,7 +474,7 @@ let link objfiles =
|
|||
if Sys.file_exists c_file then raise(Error(File_exists c_file));
|
||||
try
|
||||
link_bytecode_as_c objfiles c_file;
|
||||
if Ccomp.compile_file c_file <> 0
|
||||
if Ccomp.compile_file_bytecode c_file <> 0
|
||||
then raise(Error Custom_runtime);
|
||||
remove_file c_file
|
||||
with x ->
|
||||
|
|
|
@ -153,4 +153,4 @@ let implementation sourcefile =
|
|||
raise x
|
||||
|
||||
let c_file name =
|
||||
if Ccomp.compile_file name <> 0 then exit 2
|
||||
if Ccomp.compile_file_bytecode name <> 0 then exit 2
|
||||
|
|
|
@ -140,4 +140,4 @@ let implementation sourcefile =
|
|||
remove_preprocessed inputfile
|
||||
|
||||
let c_file name =
|
||||
if Ccomp.compile_file name <> 0 then exit 2
|
||||
if Ccomp.compile_file_native name <> 0 then exit 2
|
||||
|
|
|
@ -21,7 +21,7 @@ let command cmdline =
|
|||
end;
|
||||
Sys.command cmdline
|
||||
|
||||
let compile_file name =
|
||||
let compile_file_bytecode name =
|
||||
command
|
||||
(Printf.sprintf
|
||||
"%s -c %s %s -I%s %s"
|
||||
|
@ -33,6 +33,18 @@ let compile_file name =
|
|||
Config.standard_library
|
||||
name)
|
||||
|
||||
let compile_file_native name =
|
||||
command
|
||||
(Printf.sprintf
|
||||
"%s -c %s %s -I%s %s"
|
||||
Config.native_c_compiler
|
||||
(String.concat " " (List.rev !Clflags.ccopts))
|
||||
(String.concat " "
|
||||
(List.map (fun dir -> "-I" ^ dir)
|
||||
(List.rev !Clflags.include_dirs)))
|
||||
Config.standard_library
|
||||
name)
|
||||
|
||||
let create_archive archive file_list =
|
||||
Misc.remove_file archive;
|
||||
match Config.system with
|
||||
|
|
|
@ -14,5 +14,6 @@
|
|||
(* Compiling C files and building C libraries *)
|
||||
|
||||
val command: string -> int
|
||||
val compile_file: string -> int
|
||||
val compile_file_bytecode: string -> int
|
||||
val compile_file_native: string -> int
|
||||
val create_archive: string -> string list -> int
|
||||
|
|
Loading…
Reference in New Issue