The binary distributions of GHC for Windows do not contain support for the readline library. This is needed in Kaya 0.2.7 and later. If you are building Kaya 0.2.6 or earlier on Windows you can ignore these steps.
These steps do not completely recompile GHC - they simply add the readline library to an existing distribution.
Compiling GHC's readline library on MinGW
- Download the GHC source from the Haskell download site into your MSys directory, and unpack it using
tar -xjf- make sure you download exactly the same version as the binary distribution you already have. - Make sure that your pdcurses library is installed correctly, and that
libpdcurses.ais copied tolibcurses.aandlibncurses.a - Go to the
libraries/readlinedirectory of the unpacked distribution, and make the following changes to theconfigurefile. (Yes, this would be better done by editingconfigure.acand re-running autoconf, but the MinGW system installed so far doesn't have a working autoconf.)For GHC 6.6
- Find the line
ac_cv_lib_curses_tputs=noand change no to yes. (Windows curses libraries don't have or need the tputs function.) - Find the line
ac_cv_lib_readline_rl_readline_version=noand change no to yes. (This function does not exist on Windows, but for some reason this isn't a problem).
For GHC 6.8
- Change
ac_cv_lib_curses_tputs=yestoac_cv_lib_curses_tputs=no - Change
ac_cv_func_rl_readline_version=notoac_cv_func_rl_readline_version=yes - Change
ac_cv_func_rl_begin_undo_group=notoac_cv_func_rl_begin_undo_group=yes
- Find the line
- Go back to the top directory of the unpacked distribution and run
./configure(no need to specify any options) - Edit the
rts/Makefilefile that has now been generated, finding the lineWAYS=$(GhcLibWays) $(GhcRTSWays). Remove$(GhcRTSWays)- it's not necessary for the readline library and saves a lot of time in compiling. - Run
make stage1and find something else to do for a few hours. - Go back to the
libraries/readlinedirectory, and runghc-pkg.exe update package.conf.inplace
Your GHC installation should now have a usable readline package. Do not delete or move the directories you have just created.