
Building haskell's zlib library for win32 is not trivial since it relies on an external C library. Most of the required tools are shipped with the ghc binary distribution though. I finally bit the bullet and jumped through the build hoops to install it. My notes are attached below. The build could be nicer if it was more cabalized -- ie. have the cabal file directly reference the zlib-1.2.3 sources and headers.. Problems are possible reliance on particular versions, duplicating already installed code (although in this case its pretty small), and possibly figuring out how to perform the "configuration" process without a shell.... Any opinions on this approach? --- WIN32 BUILD INSTRUCTIONS ---- I built from cygwin. Probably a little easier if you have mingwin installed. I have ghc-6.6 installed in /c/ghc/ghc-6.6 (/c is a mount point for c:\ "mount c:\\ /c"). Fetch sources $ darcs get http://haskell.org/~duncan/zlib $ cd zlib $ wget http://www.zlib.net/zlib-1.2.3.tar.gz $ tar -xzf zlib-1.2.3.tar.gz Prefer ghc's gcc (mingwin) rather than cygwins. $ export PATH=/c/ghc/ghc-6.6:/c/ghc/ghc-6.6/bin:$PATH Build zlib C code $ ./configure --prefix=/c/ghc/ghc-6.6 --libdir=/c/ghc/ghc-6.6 $ make install build haskell zlib $ cd .. $ runhaskell Setup.py configure $ runhaskell Setup.hs build $ runhaskell Setup.hs install Tim Newsham http://www.thenewsh.com/~newsham/

When I tried this, I discovered that when building the zlib C code, I had to cd zlib-1.2.3 and that then of course makes the cd .. before building the haskell zlib right. (Not to mention the obvious typo of Setup.py for Setup.hs.) I also had to add -package fps to ghc-options in zlib.cabal, but then I've got ghc-6.4.1 and Cabal-1.1.3. -- Iain Alexander ia@stryx.demon.co.uk
participants (2)
-
Iain Alexander
-
Tim Newsham