Cygwin NCurses Quirks
Whilst trying to push GuCu, my Guile/NCurses library, into something more like a first beta, I tried getting it to run on both my boxen: one Slackware, one Windows with Cygwin. It has been a challenge.
First, NCurses 5.6 won't build as a DLL on Cygwin out of the box. The proscriptive first step, upgrading the automake/autoconf toolchain is a no-go, since NCurses uses a private fork of autoconf and neglects automake altogether. I thought for a second to figure it out myself, but, it looked difficult to debug.
So, retreating to the distributed Cygwin/NCurses 5.5, I find that it doesn't have the wide curses functions installed, so I commence the annoying job of separating GuCu into a wide and narrow version, which begins the automake/autoconf difficulty.
Then, I find that, on Cygwin, the wide character C types, wchar_t and wint_t, are not identical, but, actually are 16 bit and 32 bit respectively. I know that the standard says that they can differ, but, I never though someone would actually do that. Some of the NCurses functions are wchar_t and others are wint_t, so I had to go back to my hacked FFI, which treated them as identical.
On top of that, the distributed Ncurses 5.5 has a bug w.r.t to the handling of the acs_map array. (I'd noticed the bug before, when trying to build libRUIN, but, I mistakenly thought that it was RUIN's fault.) The work-around is pretty simple. Just throw this into any file using the ACS_ constants.
#ifdef CYGWIN_CURSES_BUG_FIX
/* work around bug in Cygwin's ancient NCurses */
extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void);
#define acs_map (_nc_acs_map())
#endif
And with that, make check is good to go. Distcheck fails hard, though, because of some mysterious texinfo.tex parsing problem that doesn't occur on GNU/Linux.
And here I thought I was just going to copy it over and "./configure && make".
Sigh.

0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home