From c892b917c3791a0c0b5428634c02bde00416652d Mon Sep 17 00:00:00 2001 From: sof <unknown> Date: Thu, 30 Oct 1997 22:45:08 +0000 Subject: [PATCH] [project @ 1997-10-30 22:45:08 by sof] New option: -W, suppress duplicate interface file warnings --- ghc/utils/mkdependHS/mkdependHS.prl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ghc/utils/mkdependHS/mkdependHS.prl b/ghc/utils/mkdependHS/mkdependHS.prl index db6b16779d18..ea28cfc1c41b 100644 --- a/ghc/utils/mkdependHS/mkdependHS.prl +++ b/ghc/utils/mkdependHS/mkdependHS.prl @@ -32,6 +32,7 @@ mkdependHS-specific options (not between --'s): -v Be verbose. -v -v Be very verbose. + -W No warnings -f blah Use "blah" as the makefile, rather than "makefile" or "Makefile". -o <osuf> Use <osuf> as the "object file" suffix ( default: o) @@ -54,8 +55,9 @@ mkdependHS-specific options (not between --'s): EOUSAGE -$Status = 0; # just used for exit() status -$Verbose = 0; # 1 => verbose, 2 => very verbose +$Status = 0; # just used for exit() status +$Verbose = 0; # 1 => verbose, 2 => very verbose +$Warnings = 1; # 1 => warn about duplicate interface files $Dashdashes_seen = 0; # Try to guess how to run gcc's CPP directly ------------- @@ -239,7 +241,7 @@ sub mangle_command_line_args { } elsif ( /^-D(.*)/ ) { # recognized wherever they occur push(@Defines, $_); - } elsif ( /^-i(.*)/ ) { + } elsif ( /^-i(.*)/ ) { # ditto $Import_dirs .= ":$1"; } elsif ( /^-I/ ) { $Include_dirs .= " $_"; @@ -248,6 +250,8 @@ sub mangle_command_line_args { } elsif ($Dashdashes_seen != 1) { # not between -- ... -- if ( /^-v$/ ) { $Verbose++; + } elsif ( /^-W$/ ) { + $Warnings = 0; } elsif ( /^-f(.*)/ ) { $Makefile = &grab_arg_arg('-f',$1); } elsif ( /^-o(.*)/ ) { @@ -318,7 +322,7 @@ sub preprocess_import_dirs { next unless /(.*)\.hi$/; $thing = $1; if ($ModuleIn{$thing} && $ModuleIn{$thing} ne $d) { - print STDERR "$Pgm: warning: $thing.hi appears in both $ModuleIn{$thing} and $d!\n"; + print STDERR "$Pgm: warning: $thing.hi appears in both $ModuleIn{$thing} and $d!\n" if ($Warnings); } else { $ModuleIn{$thing} = $d; } -- GitLab