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
51c51
< DEFS = -DHAVE_CONFIG_H
---

> DEFS = -DHAVE_CONFIG_H -Dtimezonevar


diff nmh-1.2/sbr/discard.c nmh-1.2-aaa/sbr/discard.c
59c59
< 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
#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===

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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)
  •  

    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 07 Feb 2012 12:08:30 AM UTC kenh StatusNone => Fixed
        Open/ClosedOpen => Closed
    Mon 29 Dec 2008 10:33:28 PM UTC pm215 CategoryNone => Portability
    Sat 19 Aug 2006 11:54:46 PM UTC nycllama Carbon-CopyRemoved -email is unavailable- => -
    Sat 19 Aug 2006 11:52:50 PM UTC nycllama Carbon-Copy- => Added -email is unavailable-
    Fri 21 Apr 2006 06:02:05 PM UTC bezeau Carbon-Copy- => Added bezeau

    Back to the top


    Powered by Savane 3.3