Revert "PR#6475: accept -o in ocamlc when compiling C files"
This reverts commit 1d8e590c54
.
Conflicts:
Changes
bytecomp/bytelink.ml
driver/optcompile.ml
ocamlbuild/ocaml_specific.ml
ocamlbuild/testsuite/internal.ml
utils/ccomp.ml
master
parent
f95fb8bbb0
commit
1c28b231ef
|
@ -593,7 +593,7 @@ let link ppf objfiles output_name =
|
|||
link_bytecode_as_c ppf tolink c_file;
|
||||
if not (Filename.check_suffix output_name ".c") then begin
|
||||
temps := c_file :: !temps;
|
||||
if Ccomp.compile_file ~output_name:(Some obj_file) c_file <> 0 then
|
||||
if Ccomp.compile_file c_file <> 0 then
|
||||
raise(Error Custom_runtime);
|
||||
if not (Filename.check_suffix output_name Config.ext_obj) ||
|
||||
!Clflags.output_complete_object then begin
|
||||
|
|
|
@ -107,4 +107,4 @@ let implementation ppf sourcefile outputprefix =
|
|||
|
||||
let c_file name =
|
||||
Location.input_name := name;
|
||||
if Ccomp.compile_file ~output_name:!Clflags.output_name name <> 0 then exit 2
|
||||
if Ccomp.compile_file name <> 0 then exit 2
|
||||
|
|
|
@ -141,5 +141,4 @@ let implementation ppf sourcefile outputprefix ~backend =
|
|||
raise x
|
||||
|
||||
let c_file name =
|
||||
let output_name = !Clflags.output_name in
|
||||
if Ccomp.compile_file ~output_name name <> 0 then exit 2
|
||||
if Ccomp.compile_file name <> 0 then exit 2
|
||||
|
|
|
@ -75,17 +75,13 @@ let compile_file ~output_name name =
|
|||
let exit =
|
||||
command
|
||||
(Printf.sprintf
|
||||
"%s%s -c %s %s %s %s %s%s"
|
||||
"%s -c %s %s %s %s %s%s"
|
||||
(match !Clflags.c_compiler with
|
||||
| Some cc -> cc
|
||||
| None ->
|
||||
if !Clflags.native_code
|
||||
then Config.native_c_compiler
|
||||
else Config.bytecomp_c_compiler)
|
||||
(match output_name, Config.ccomp_type with
|
||||
| Some n, "msvc" -> " /Fo" ^ Filename.quote n
|
||||
| Some n, _ -> " -o " ^ Filename.quote n
|
||||
| None, _ -> "")
|
||||
(if !Clflags.debug && Config.ccomp_type <> "msvc" then "-g" else "")
|
||||
(String.concat " " (List.rev !Clflags.all_ccopts))
|
||||
(quote_prefixed "-I" (List.rev !Clflags.include_dirs))
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
val command: string -> int
|
||||
val run_command: string -> unit
|
||||
val compile_file: output_name:string option -> string -> int
|
||||
val compile_file: string -> int
|
||||
val create_archive: string -> string list -> int
|
||||
val expand_libname: string -> string
|
||||
val quote_files: string list -> string
|
||||
|
|
Loading…
Reference in New Issue