Mon 19 Dec 2005 05:51:46 PM UTC, original submission:
If you try to build nmh under cygwin it fails to compile:
gcc -c -DHAVE_CONFIG_H -I.. -I. -I.. -Wall -O2 discard.c
discard.c: In function `discard':
discard.c:59: warning: implicit declaration of function `fpurge'
gcc -c -DHAVE_CONFIG_H -I.. -I. -I.. -Wall -O2 done.c
gcc -c -DHAVE_CONFIG_H -I.. -I. -I.. -Wall -O2 dtime.c
dtime.c:33: error: `timezone' redeclared as different kind of symbol
/usr/include/time.h:117: error: previous declaration of `timezone'
This is because dtime.c declares 'extern long timezone' but the cygwin header files make it either a #define or a function. I suspect cygwin's technically not POSIX compliant, but applications really shouldn't be declaring header file stuff themselves like this.
http://www.mail-archive.com/nmh-workers@mhost.com/msg00618.html reveals that somebody has looked at this in the past:
===begin quote from Stephen Bailey===
Here's the list of things I did to make nmh 1.0.4+ work on Cygwin, (using POP):
Have to modify:
zotnet/tws/{dtimep,dtime}.c to fix conflict with cygwin timezone and daylight definitions. I edited line 28 and beyond to become:
#ifdef _CYGWIN_
#define timezone _timezone
#else
extern int daylight;
extern long timezone;
#endif
extern char *tzname[];
uip/{flist,folder,show} commands to chuck the ``.exe'' suffix. In show, did something like:
#ifdef _CYGWIN32_
{
char *dotexe = strstr(invo_name, ".exe");
if (dotexe) {
dotexe[0] = '\0';
}
}
#endif
sbr/discard.c to remove mention of fpurge from line 55
sbr/ruserpass.c to ignore .netrc file mode (see line 108)
uip/Makefile.in: to remove slocal and spost
use install instead of ln (for flists, folders, prev, next) make sure that the directory where nmh is installed AND where your mail is kept are binmode
Let me know if you need more specific info.
The code changes can all easily be #ifdef _CYGWIN32_ ed, and you could submit a patch to keep them carried along with new versions of nmh. However, I fully admit that I don't understand the configuration infrastructure, so I'm not sure how to conditionalize the Makefile for uip. Somebody else could probably figure this out pretty easily.
So far, I've only seen one bug, which I haven't bother to track down. Sometimes forw crashes. It seems to depend upon what directory you are in. If it crashes, I usually just change working directories (eg cd /tmp) and run it again. I did poke through the code a little bit and it died early in one of the filesystem/directory related `system calls', but I didn't go any further. It might be a Cygwin bug.
===end quote===
|