building ghc from source

Derek Elkins ddarius@hotpop.com
Sat, 24 May 2003 08:32:39 -0400


On Sat, 24 May 2003 14:25:14 +0200
Sven Panne <Sven.Panne@informatik.uni-muenchen.de> wrote:

> johago@web.de wrote:
>  > [...] According to Mike Thomas' and Derek Elkins' posts, I also
>  > enabled HAVE_O_BINARY in config.h.
> 
> Huh? I didn't follow this thread very closely, but this sounds like a
> bug in GHC's aclocal.m4 (macro FPTOOLS_O_BINARY) which should be
> fixed. What does configure say in the line starting with:
> 
>     checking whether we can open files in binary mode...
> 
>  > [...] Unfortunately, module GHC.Posix doesn't exist. [...]
> 
> Could you try changing
> 
>     import GHC.Posix( FDType( RegularFile ) )
> 
> into
> 
>     import System.Posix.Internals( FDType( RegularFile ) )
> 
> in Win32Spawn.hs? This would be much easier. Just a guess...
> 
> Cheers,
>     S.

And likely unless it has been changed in the last day or so, you'll run
into an error building StdDIS.(l)hs in hslibs/win32.  One solution is to
import GHC.ForeignPtr (newConcForeignPtr) and replace all uses of
newForeignPtr with newConcForeignPtr (a better solution would probably
be to use whatever is appropriate for newForeignPtr, I'd have to reread
the FFI spec to see what that is, perhaps nullFunPtr works (guessing
blindly))