Setting Up Cygwin for building GHC (unsupported)
We no longer support Cygwin. This page is here only for historical reasons.
-
Install Cygwin
-
You must install enough Cygwin packages to support building GHC. This means selecting at least the following packages in the installation dialogue:
openssh
,autoconf
,binutils
,gcc
,make
. To see these packages, click on the "View" button in the "Select Packages" stage of Cygwin's installation dialogue, until the view says "Full". Note: Don't use the cygwin git (you'll get various failures, e.g. fork failures, with Windows Vista or Windows 7). Use http://code.google.com/p/msysgit/ instead. -
Now set the following user environment variables:
-
Add
c:/cygwin/bin
andc:/cygwin/usr/bin
to yourPATH
-
Set
MAKE_MODE
toUNIX
. If you don't do this you get very weird messages when you typemake
, such as:/c: /c: No such file or directory
-
Set
SHELL
toc:/cygwin/bin/bash
. When you invoke a shell in Emacs, thisSHELL
is what you get. -
Set
HOME
to point to your home directory. This is where, for example,bash
will look for your.bashrc
file. Dittoemacs
looking for.emacsrc
Here are some things to be aware of when using Cygwin:
-
Cygwin implements a symbolic link as a text file with some magical text in it. So other programs that don't use Cygwin's I/O libraries won't recognise such files as symlinks. In particular, programs compiled by GHC are meant to be runnable without having Cygwin, so they don't use the Cygwin library, so they don't recognise symlinks.
-
Some script files used in the make system start with "
#!/bin/perl
", (and similarly forsh
). Notice the hardwired path! So you need to ensure that your/bin
directory has at leastsh
,perl
, andcat
in it. All these come in Cygwin'sbin
directory, which you probably have installed asc:/cygwin/bin
. By default Cygwin mounts "/
" asc:/cygwin
, so if you just take the defaults it'll all work ok. (You can discover where your Cygwin root directory/
is by typingmount
.) Provided/bin
points to the Cygwinbin
directory, there's no need to copy anything. If not, copy these binaries from thecygwin/bin
directory (after fixing thesh.exe
stuff mentioned in the previous bullet).