From e8d8e039f6addf0165582a4e40ecb9a7dfd71c80 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Sat, 29 Nov 1997 20:37:09 +0000
Subject: [PATCH] [project @ 1997-11-29 20:37:09 by sof] Append -lnsl when
 using -syslib ghc on Solaris2 boxes (BSD nwork support.); -w as synonym for
 -Wnot; pass -fsignatures-required through to compiler proper.

---
 ghc/driver/ghc.lprl | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/ghc/driver/ghc.lprl b/ghc/driver/ghc.lprl
index a79525f4b07a..42a91ebc6b5b 100644
--- a/ghc/driver/ghc.lprl
+++ b/ghc/driver/ghc.lprl
@@ -2789,6 +2789,9 @@ arg: while($_ = $Args[0]) {
 			    if ( $syslib eq 'posix') {
 				$syslib='ghc';
 				goto again;
+			    } elsif ( $syslib eq 'ghc' && $TargetName =~ /-solaris2$/ ) {
+				# needed for Berkeley socket/nwork stuff.
+				push(@SysLibrary, '-lnsl');
 			    }
 			    next arg; };
 
@@ -2966,7 +2969,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");
@@ -2974,7 +2980,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);
-- 
GitLab