summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>1998-05-27 14:10:14 +0000
committerDaniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>1998-05-27 14:10:14 +0000
commit5a5d98b149ad4d6e39c50e1988e6dae4b6f9f4fc (patch)
tree097e7fe8210e99765e882b0d7ae4407e6283b347
parent0e7a0abdd7f2f9d5604453703f8ac14eca60b6f2 (diff)
Ajout option "-intf_suffix" pour spécifier le suffixe de l'interface
quand on compile l'implémentation. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1971 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--driver/main.ml3
-rw-r--r--driver/main_args.ml3
-rw-r--r--driver/main_args.mli1
-rw-r--r--driver/optmain.ml4
-rw-r--r--utils/config.mli3
-rw-r--r--utils/config.mlp2
6 files changed, 14 insertions, 2 deletions
diff --git a/driver/main.ml b/driver/main.ml
index 66f9ff885..ef0e9d8ae 100644
--- a/driver/main.ml
+++ b/driver/main.ml
@@ -27,7 +27,7 @@ let process_file name =
Compile.implementation name;
objfiles := (Filename.chop_extension name ^ ".cmo") :: !objfiles
end
- else if Filename.check_suffix name ".mli" then
+ else if Filename.check_suffix name !Config.interface_suffix then
Compile.interface name
else if Filename.check_suffix name ".cmo"
or Filename.check_suffix name ".cma" then
@@ -63,6 +63,7 @@ module Options = Main_args.Make_options (struct
let _I s = include_dirs := s :: !include_dirs
let _impl = process_implementation_file
let _intf = process_interface_file
+ let _intf_suffix s = Config.interface_suffix := s
let _linkall = set link_everything
let _make_runtime () =
custom_runtime := true; make_runtime := true; link_everything := true
diff --git a/driver/main_args.ml b/driver/main_args.ml
index bca830a93..5ecc17244 100644
--- a/driver/main_args.ml
+++ b/driver/main_args.ml
@@ -23,6 +23,7 @@ module Make_options (F :
val _I : string -> unit
val _impl : string -> unit
val _intf : string -> unit
+ val _intf_suffix : string -> unit
val _linkall : unit -> unit
val _make_runtime : unit -> unit
val _noassert : unit -> unit
@@ -54,6 +55,8 @@ struct
"<dir> Add <dir> to the list of include directories";
"-impl", Arg.String F._impl, "<file> Compile <file> as a .ml file";
"-intf", Arg.String F._intf, "<file> Compile <file> as a .mli file";
+ "-intf_suffix", Arg.String F._intf_suffix,
+ "<file> Suffix for interface file (default: .mli)";
"-linkall", Arg.Unit F._linkall, " Link all modules, even unused ones";
"-make_runtime", Arg.Unit F._make_runtime,
" Build a runtime system with given C objects and libraries";
diff --git a/driver/main_args.mli b/driver/main_args.mli
index ff7aaa81d..8cb7c9033 100644
--- a/driver/main_args.mli
+++ b/driver/main_args.mli
@@ -23,6 +23,7 @@ module Make_options (F :
val _I : string -> unit
val _impl : string -> unit
val _intf : string -> unit
+ val _intf_suffix : string -> unit
val _linkall : unit -> unit
val _make_runtime : unit -> unit
val _noassert : unit -> unit
diff --git a/driver/optmain.ml b/driver/optmain.ml
index 9ddf8601e..284626759 100644
--- a/driver/optmain.ml
+++ b/driver/optmain.ml
@@ -27,7 +27,7 @@ let process_file name =
Optcompile.implementation name;
objfiles := (Filename.chop_extension name ^ ".cmx") :: !objfiles
end
- else if Filename.check_suffix name ".mli" then
+ else if Filename.check_suffix name !Config.interface_suffix then
Optcompile.interface name
else if Filename.check_suffix name ".cmx"
or Filename.check_suffix name ".cmxa" then
@@ -72,6 +72,8 @@ let main () =
"<n> Set aggressiveness of inlining to <n>";
"-intf", Arg.String process_interface_file,
"<file> Compile <file> as a .mli file";
+ "-intf_suffix", Arg.String (fun s -> Config.interface_suffix := s),
+ "<file> Suffix for interface file (default: .mli)";
"-linkall", Arg.Set link_everything,
" Link all modules, even unused ones";
"-noassert", Arg.Set noassert, " Don't compile assertion checks";
diff --git a/utils/config.mli b/utils/config.mli
index 6d5aa4927..706ca53fc 100644
--- a/utils/config.mli
+++ b/utils/config.mli
@@ -35,6 +35,9 @@ val ranlib: string
val load_path: string list ref
(* Directories in the search path for .cmi and .cmo files *)
+val interface_suffix: string ref
+ (* Suffix for interface file names *)
+
val exec_magic_number: string
(* Magic number for bytecode executable files *)
val cmi_magic_number: string
diff --git a/utils/config.mlp b/utils/config.mlp
index 630111f40..1852b2dca 100644
--- a/utils/config.mlp
+++ b/utils/config.mlp
@@ -37,6 +37,8 @@ and ast_intf_magic_number = "Caml1999N005"
let load_path = ref ([] : string list)
+let interface_suffix = ref ".mli"
+
let max_tag = 248
let max_young_wosize = 256