|Version 7 (modified by 5 years ago) (diff),|
Setting Up Cygwin for building GHC
- Install Cygwin
- You must install enough Cygwin packages to support building GHC. This means selecting at least the following packages in the installation dialogue:
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".
- Now set the following user environment variables:
UNIX. If you don't do this you get very weird messages when you type
make, such as:
/c: /c: No such file or directory
c:/cygwin/bin/bash. When you invoke a shell in Emacs, this
SHELLis what you get.
HOMEto point to your home directory. This is where, for example,
bashwill look for your
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 for
sh). Notice the hardwired path! So you need to ensure that your
/bindirectory has at least
catin it. All these come in Cygwin's
bindirectory, which you probably have installed as
c:/cygwin/bin. By default Cygwin mounts "
c:/cygwin, so if you just take the defaults it'll all work ok. (You can discover where your Cygwin root directory
/is by typing
/binpoints to the Cygwin
bindirectory, there's no need to copy anything. If not, copy these binaries from the
cygwin/bindirectory (after fixing the
sh.exestuff mentioned in the previous bullet).