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 19 Dec 2005 05:51:46 PM UTC  
Votes:  1  
Category:  Portability Severity:  3 - Normal
Priority:  5 - Normal Status:  Fixed
Assigned to:  None Open/Closed:  Closed

Add a New Comment (Rich Markup)

You are not logged in

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


Tue 07 Feb 2012 12:08:30 AM UTC, 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 19 Aug 2006 11:52:50 PM UTC, 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 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
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 Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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



    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-02-07 kenh StatusNone => Fixed
        Open/ClosedOpen => Closed
    2008-12-29 pm215 CategoryNone => Portability
    2006-08-19 nycllama Carbon-CopyRemoved -email is unavailable- => -
    2006-08-19 nycllama Carbon-Copy- => Added aaa@alumni.uchicago.edu
    2006-04-21 bezeau Carbon-Copy- => Added bezeau

    Back to the top

    Powered by Savane 3.5