Fix: compilo C different quand on compile en natif.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1627 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 1997-06-23 14:36:30 +00:00
parent a7ab31f37c
commit 3cf9325149
5 changed files with 18 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

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