David Elworthy <[EMAIL PROTECTED]> writes:

> When making ghc 2.09 from sources, I got a bug in the ghc driver script,
> while compiling hslibs/ghc/SocketPrim:
> 
> > Can't find label "again"--aborting at ../../ghc/driver/ghc line 2875.
> 
> This seems to be a perl 4 problem: switch to perl5 fixed it. I quote
> from the installation guide (ahem) "GHC should be Perl 4 friendly
> though".

I fixed this one shortly after the release.  Here's the patch:

*** ghc.lprl    1997/11/29 20:37:09     1.45
--- ghc.lprl    1997/12/04 15:01:06     1.46
***************
*** 2420,2425 ****
--- 2420,2444 ----
  }
  \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
***************
*** 2763,2769 ****
                            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
--- 2782,2787 ----
***************
*** 2771,2795 ****
                            # 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 'posix') {
!                               $syslib='ghc';
!                               goto again;
!                           } elsif ( $syslib eq 'ghc' && $TargetName =~ /-solaris2$/ 
) {
                                # needed for Berkeley socket/nwork stuff.
                                push(@SysLibrary, '-lnsl');
                            }
--- 2789,2799 ----
                            # the ghc system library as well.
                            # (ToDo: `nub' -syslib list)
                            #
!                           &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');
                            } 

-- 
Simon Marlow                                             [EMAIL PROTECTED]
University of Glasgow                       http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key

Reply via email to