bugThe nmh Mail Handling System - Bugs: bug #15247, doesn't compile under cygwin


bug #15247: doesn't compile under cygwin

Submitted by:  None
Submitted on:  Mon Dec 19 17:51:46 2005  
Votes:  1  
Category: PortabilitySeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: NoneOpen/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Tue Feb 7 00:08:30 2012, comment #2:

Yikes ... this bug report is like 7 years old, but I am trying to go through the database and clear out old ones.

The current sources available in git now compile under cygwin, so I believe this has been fixed.

Ken Hornstein <kenh>
Project Administrator
Sat Aug 19 23:52:50 2006, comment #1:

I successfully compiled nmh under cygwin with the following 2 small manual changes:

diff nmh-1.2/Makefile nmh-1.2-aaa/Makefile

> DEFS = -DHAVE_CONFIG_H -Dtimezonevar

diff nmh-1.2/sbr/discard.c nmh-1.2-aaa/sbr/discard.c
< fpurge (io);

> /* fpurge (io); */

Admittedly the second one is quite a hack. Still testing nmh on cygwin, but no issues so far (not much use yet).

Tony Acero <nycllama>
Mon Dec 19 17:51:46 2005, 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
extern int daylight;
extern long timezone;
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';
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===



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by kenh (Posted a comment)
  • -unavailable- added by pm215 (Updated the item)

    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Feb 7 00:08:30 2012kenhStatusNone=>Fixed
    Mon Dec 29 22:33:28 2008pm215CategoryNone=>Portability
    Sat Aug 19 23:54:46 2006nycllamaCarbon-CopyRemoved -unavailable-=>-
    Sat Aug 19 23:52:50 2006nycllamaCarbon-Copy-=>Added -unavailable-
    Fri Apr 21 18:02:05 2006bezeauCarbon-Copy-=>Added bezeau

    Back to the top

    Powered by Savane 3.1-cleanup