CompilingOnCygwin
Comment moved from elsewhere, please integrate or delete: ''"To compile darcs as a Cygwin program you need a version of GHC that can produce Cygwin executables. GHC used to support this at one point, but it doesn't work anymore. The person who gets this working will be considered a hero."''
Compiling darcs on cygwin
(Note: It is not necessary to compile darcs to get it to run on Cygwin. Simply make sure that official darcs binary for Win32 is in your Windows path, and Cygwin will find it when you try to use it.)
Here's how I managed to compile darcs on cygwin. Note that the resulting program is not a cygwin program but a windows program. In order to get a native cygwin program ghc needs to be ported to cygwin. While it is not impossible to port ghc to cygwin it will require some real work.
Prerequisites
First of all you will need ghc but I assume you have it already. I will also assume ghc is in your path. Mine is located at c:/ghc/ghc-6.2.2/bin/ghc.
Compiling zlib
- Download zlib. Put is in a directory without spaces in the name. I put mine in
c:/ghc/.
- - Important. Compile zlib with the gcc that ships with ghc,
not cygwin's native gcc.
cdinto the zlib directory and issue ``export CC=c:/ghc/ghc-6.2.2/gcc.exe
./configure make``
Compiling darcs
When compiling darcs we need to use the ghc's gcc and point it to the zlib we just compiled up. This is done as follows:
export CC=c:/ghc/ghc-6.2.2/gcc.exe
export CPPFLAGS=-Ic:/ghc/zlib-1.2.1
export LDFLAGS=-Lc:/ghc/zlib-1.2.1
autoconf
./configure --without-libcurl --target=mingw
make
Congratulations, you have now built your own darcs!
Missing stuff
This build is setup up to minimize the hassle. That means that a few things are left out such as libcurl. It should be possible to add that as well.
