[project @ 1998-01-11 11:35:56 by simonm]
[ghc-hetmet.git] / ghc / driver / ghc.lprl
index 8a88231..ef32980 100644 (file)
@@ -272,12 +272,14 @@ warnings that you get all the time are
        
        -fwarn-overlapping-patterns
        -fwarn-missing-methods
+       -fwarn-duplicate-exports
 
 these are turned off by -Wnot.
 
 \begin{code}
 @StandardWarnings = ('-fwarn-overlapping-patterns', 
-                    '-fwarn-missing-methods');
+                    '-fwarn-missing-methods',
+                    '-fwarn-duplicate-exports');
 @MinusWOpts              = (@StandardWarnings, 
                     '-fwarn-incomplete-patterns', 
                     '-fwarn-unused-names');
@@ -578,7 +580,9 @@ if (  $Status == 0 && $Only_generate_deps ) {
     push (@MkDependHS_flags, "-s$BuildTag") if $BuildTag;
     push (@MkDependHS_flags, "-D__HASKELL1__=$Haskell1Version");
     # They're not (currently) needed, but we need to quote any -#include options
-    map(s/-#include.*$/'$&'/g, @Cmd_opts);
+    foreach (@Cmd_opts) {
+       s/-#include.*$/'$&'/g;
+    };
     local($to_do) = "$MkDependHS @MkDependHS_flags -- @Cmd_opts -- @Input_file" ;
     &run_something($to_do, 'Haskell dependencies');
     exit $Status;
@@ -2416,6 +2420,25 @@ sub add_Hsc_flags {
 }
 \end{code}
 
+\begin{code}
+sub add_syslib {
+    local($syslib) = @_;
+    
+    unshift(@SysImport_dir,
+           ${INSTALLING} ? "$InstSysLibDir/$syslib/imports"
+                         : "$TopPwd/hslibs/$syslib/src");
+
+    push(@SysLibrary_dir,
+        ${INSTALLING} ? ("$InstSysLibDir")
+                       : ("$TopPwd/hslibs/$syslib",
+                         "$TopPwd/hslibs/$syslib/cbits"));
+
+    push(@SysLibrary, "-lHS$syslib");
+    push(@SysLibrary, "-lHS${syslib}_cbits")
+          unless $syslib eq 'contrib'; #HACK! it has no cbits
+}
+\end{code}
+
 Source files may have {-# OPTIONS ... #-} pragmas at the top, containing
 command line options we want to append to collection of commands specified
 directly. @check_for_source_options@ looks at the top of a de-lit'ified Haskell
@@ -2759,7 +2782,6 @@ arg: while($_ = $Args[0]) {
                            print STDERR "$Pgm: no such system library (-syslib): $syslib\n",
                              $Status++ unless $syslib =~ /^(hbc|ghc|posix|contrib)$/;
 
-                           again:
                            #
                            # The posix library is a `special' in that it relies on
                            # the ghc system library (packed strings). Wielding our
@@ -2767,24 +2789,13 @@ arg: while($_ = $Args[0]) {
                            # the ghc system library as well.
                            # (ToDo: `nub' -syslib list)
                            #
-                           unshift(@SysImport_dir,
-                               ${INSTALLING}
-                               ? "$InstSysLibDir/$syslib/imports"
-                               : "$TopPwd/hslibs/$syslib/src");
-                       
-                           push(@SysLibrary_dir,
-                                ${INSTALLING}
-                                ? ("$InstSysLibDir")
-                                : ("$TopPwd/hslibs/$syslib"
-                                  ,"$TopPwd/hslibs/$syslib/cbits"));
-
-                           push(@SysLibrary, "-lHS$syslib");
-                           push(@SysLibrary, "-lHS${syslib}_cbits")
-                             unless $syslib eq 'contrib'; #HACK! it has no cbits
-
-                           if ( $syslib eq 'posiz') {
-                               $syslib='ghc';
-                               goto again;
+                           &add_syslib($syslib);
+                           if ( $syslib eq 'posix' ) {
+                               &add_syslib('ghc');
+                           } elsif ( $syslib eq 'ghc' && 
+                                     $TargetName =~ /-solaris2$/ ) {
+                               # needed for Berkeley socket/nwork stuff.
+                               push(@SysLibrary, '-lnsl');
                            }
                            next arg; };
 
@@ -2962,7 +2973,10 @@ arg: while($_ = $Args[0]) {
     /^-fshow-import-specs/
                    && do { push(@HsC_flags, $_); next arg; };
 
-    /^-fwarn-(.*)$/      && do { push(@HsC_flags, $_);   next arg; };
+    /^-fsignatures-required/      
+                   && do { push(@HsC_flags, $_); next arg; };
+
+    /^-fwarn-(.*)$/      && do { push(@HsC_flags, $_); next arg; };
 
     /^-fno-(.*)$/   && do { push(@HsC_antiflags, "-f$1");
                            &squashHscFlag("-f$1");
@@ -2970,7 +2984,7 @@ arg: while($_ = $Args[0]) {
 
     /^-W$/         && do { push(@HsC_flags, @MinusWOpts); next arg; };
     /^-Wall$/      && do { push(@HsC_flags, @MinusWallOpts); next arg; };
-    /^-Wnot$/       && do { foreach (@Hsc_flags) {
+    /^(-Wnot|w)$/   && do { foreach (@Hsc_flags) {
                                /^-fwarn-(.*)$/ && do { $_=''; };
                            };
                            push(@HsC_antiflags, @StandardWarnings);