diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/ccomp.ml | 5 | ||||
-rw-r--r-- | utils/config.mlbuild | 1 | ||||
-rw-r--r-- | utils/config.mli | 2 | ||||
-rw-r--r-- | utils/config.mlp | 1 | ||||
-rw-r--r-- | utils/warnings.ml | 47 | ||||
-rw-r--r-- | utils/warnings.mli | 13 |
6 files changed, 41 insertions, 28 deletions
diff --git a/utils/ccomp.ml b/utils/ccomp.ml index 881223ef9f..66525e5b9e 100644 --- a/utils/ccomp.ml +++ b/utils/ccomp.ml @@ -73,9 +73,10 @@ let create_archive archive file_list = command(Printf.sprintf "link /lib /nologo /out:%s %s" quoted_archive (quote_files file_list)) | _ -> + assert(String.length Config.ar > 0); let r1 = - command(Printf.sprintf "ar rc %s %s" - quoted_archive (quote_files file_list)) in + command(Printf.sprintf "%s rc %s %s" + Config.ar quoted_archive (quote_files file_list)) in if r1 <> 0 || String.length Config.ranlib = 0 then r1 else command(Config.ranlib ^ " " ^ quoted_archive) diff --git a/utils/config.mlbuild b/utils/config.mlbuild index 1598bee52c..367c204e7b 100644 --- a/utils/config.mlbuild +++ b/utils/config.mlbuild @@ -55,6 +55,7 @@ let native_c_compiler = sf "%s %s" C.nativecc C.nativecccompopts let native_c_libraries = C.nativecclibs let native_pack_linker = C.packld let ranlib = C.ranlibcmd +let ar = C.arcmd let cc_profile = C.cc_profile let mkdll = C.mkdll let mkexe = C.mkexe diff --git a/utils/config.mli b/utils/config.mli index 897edb6da2..78fe77c6af 100644 --- a/utils/config.mli +++ b/utils/config.mli @@ -46,6 +46,8 @@ val mkmaindll: string (* The linker command line to build main programs as dlls. *) val ranlib: string (* Command to randomize a library, or "" if not needed *) +val ar: string + (* Name of the ar command, or "" if not needed (MSVC) *) val cc_profile : string (* The command line option to the C compiler to enable profiling. *) diff --git a/utils/config.mlp b/utils/config.mlp index 1883cfa520..35e56e7513 100644 --- a/utils/config.mlp +++ b/utils/config.mlp @@ -44,6 +44,7 @@ let native_c_compiler = "%%NATIVECC%%" let native_c_libraries = "%%NATIVECCLIBS%%" let native_pack_linker = "%%PACKLD%%" let ranlib = "%%RANLIBCMD%%" +let ar = "%%ARCMD%%" let cc_profile = "%%CC_PROFILE%%" let mkdll = "%%MKDLL%%" let mkexe = "%%MKEXE%%" diff --git a/utils/warnings.ml b/utils/warnings.ml index 46a01e2440..1f99b63c82 100644 --- a/utils/warnings.ml +++ b/utils/warnings.ml @@ -50,12 +50,13 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) - | Unused_value_declaration of string (* 31 *) - | Unused_open of string (* 32 *) - | Unused_type_declaration of string (* 33 *) - | Unused_for_index of string (* 34 *) - | Unused_ancestor of string (* 35 *) - | Unused_constructor of string (* 36 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) + | Unused_open of string (* 33 *) + | Unused_type_declaration of string (* 34 *) + | Unused_for_index of string (* 35 *) + | Unused_ancestor of string (* 36 *) + | Unused_constructor of string (* 37 *) ;; (* If you remove a warning, leave a hole in the numbering. NEVER change @@ -95,15 +96,16 @@ let number = function | Wildcard_arg_to_constant_constr -> 28 | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 - | Unused_value_declaration _ -> 31 - | Unused_open _ -> 32 - | Unused_type_declaration _ -> 33 - | Unused_for_index _ -> 34 - | Unused_ancestor _ -> 35 - | Unused_constructor _ -> 36 + | Multiple_definition _ -> 31 + | Unused_value_declaration _ -> 32 + | Unused_open _ -> 33 + | Unused_type_declaration _ -> 34 + | Unused_for_index _ -> 35 + | Unused_ancestor _ -> 36 + | Unused_constructor _ -> 37 ;; -let last_warning_number = 36;; +let last_warning_number = 37;; (* Must be the max number returned by the [number] function. *) let letter = function @@ -198,7 +200,7 @@ let parse_opt flags s = let parse_options errflag s = parse_opt (if errflag then error else active) s;; (* If you change these, don't forget to change them in man/ocamlc.m *) -let defaults_w = "+a-4-6-7-9-27-29-31-32-33-34-35-36";; +let defaults_w = "+a-4-6-7-9-27-29-32-33-34-35-36-37";; let defaults_warn_error = "-a";; let () = parse_options false defaults_w;; @@ -272,6 +274,10 @@ let message = function | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 + | Multiple_definition(modname, file1, file2) -> + Printf.sprintf + "files %s and %s both define a module named %s" + file1 file2 modname | Unused_value_declaration v -> "unused value " ^ v ^ "." | Unused_open s -> "unused open " ^ s ^ "." | Unused_type_declaration s -> "unused type " ^ s ^ "." @@ -352,12 +358,13 @@ let descriptions = 29, "Unescaped end-of-line in a string constant (non-portable code)."; 30, "Two labels or constructors of the same name are defined in two\n\ \ mutually recursive types."; - 31, "Unused value declaration."; - 32, "Unused open statement."; - 33, "Unused type declaration."; - 34, "Unused for-loop index."; - 35, "Unused ancestor variable."; - 36, "Unused constructor."; + 31, "A module is linked twice in the same executable."; + 32, "Unused value declaration."; + 33, "Unused open statement."; + 34, "Unused type declaration."; + 35, "Unused for-loop index."; + 36, "Unused ancestor variable."; + 37, "Unused constructor."; ] ;; diff --git a/utils/warnings.mli b/utils/warnings.mli index 1c2c66a49e..99c153ffd6 100644 --- a/utils/warnings.mli +++ b/utils/warnings.mli @@ -45,12 +45,13 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) - | Unused_value_declaration of string (* 31 *) - | Unused_open of string (* 32 *) - | Unused_type_declaration of string (* 33 *) - | Unused_for_index of string (* 34 *) - | Unused_ancestor of string (* 35 *) - | Unused_constructor of string (* 36 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) + | Unused_open of string (* 33 *) + | Unused_type_declaration of string (* 34 *) + | Unused_for_index of string (* 35 *) + | Unused_ancestor of string (* 36 *) + | Unused_constructor of string (* 37 *) ;; val parse_options : bool -> string -> unit;; |