This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fetchmail is available on Cygwin


diff -upr /gnu/sendmail-8.11.1/cf/cf/Makefile sendmail-8.11.1/cf/cf/Makefile
--- /gnu/sendmail-8.11.1/cf/cf/Makefile	Wed Aug  9 18:14:39 2000
+++ sendmail-8.11.1/cf/cf/Makefile	Sun Dec 31 15:47:28 2000
@@ -25,7 +25,7 @@ RM=	rm -f
 	$(CHMOD) $(ROMODE) $@
 
 GENERIC=generic-bsd4.4.cf generic-hpux9.cf generic-hpux10.cf \
-		generic-linux.cf \
+		generic-linux.cf generic-cygwin.cf \
 		generic-osf1.cf generic-solaris2.cf \
 		generic-sunos4.1.cf generic-ultrix4.cf
 BERKELEY=cs-hpux9.cf cs-osf1.cf cs-solaris2.cf \
diff -upr /gnu/sendmail-8.11.1/devtools/bin/Build sendmail-8.11.1/devtools/bin/Build
--- /gnu/sendmail-8.11.1/devtools/bin/Build	Fri Jul 14 07:30:15 2000
+++ sendmail-8.11.1/devtools/bin/Build	Sun Dec 31 14:40:32 2000
@@ -385,6 +385,8 @@ in
 		;;
   IRIX*)	rel=`echo $rel | sed -e 's/-.*$//'`;;
   NeXT)		mkdir="mkdirs";;
+  WINNT*)       os=CYGWIN
+		rel=`uname -r | cut -d"(" -f1`;;
 esac
 
 # get "base part" of operating system release
diff -upr /gnu/sendmail-8.11.1/libsmutil/errstring.c sendmail-8.11.1/libsmutil/errstring.c
--- /gnu/sendmail-8.11.1/libsmutil/errstring.c	Sat May 27 08:38:28 2000
+++ sendmail-8.11.1/libsmutil/errstring.c	Sun Dec 31 14:47:28 2000
@@ -35,8 +35,13 @@ errstring(errnum)
 	int errnum;
 {
 #if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
-	extern char *sys_errlist[];
-	extern int sys_nerr;
+#ifdef __CYGWIN__
+#define sys_nerr _sys_nerr
+#define sys_errlist _sys_errlist
+#else
+        extern char *sys_errlist[];
+        extern int sys_nerr;
+#endif	
 #endif /* !HASSTRERROR && !defined(ERRLIST_PREDEFINED) */
 
 	/*
diff -upr /gnu/sendmail-8.11.1/libsmutil/snprintf.c sendmail-8.11.1/libsmutil/snprintf.c
--- /gnu/sendmail-8.11.1/libsmutil/snprintf.c	Sun Sep 17 19:04:24 2000
+++ sendmail-8.11.1/libsmutil/snprintf.c	Sun Dec 31 14:46:59 2000
@@ -119,8 +119,13 @@ sm_dopr( buffer, format, args )
        int len;
        int zpad;
 #if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
-	extern char *sys_errlist[];
-	extern int sys_nerr;
+#ifdef __CYGWIN__
+#define sys_nerr _sys_nerr
+#define sys_errlist _sys_errlist
+#else
+        extern char *sys_errlist[];
+        extern int sys_nerr;
+#endif	
 #endif /* !HASSTRERROR && !defined(ERRLIST_PREDEFINED) */
 
 
diff -upr /gnu/sendmail-8.11.1/mail.local/mail.local.c sendmail-8.11.1/mail.local/mail.local.c
--- /gnu/sendmail-8.11.1/mail.local/mail.local.c	Fri Sep 22 18:30:09 2000
+++ sendmail-8.11.1/mail.local/mail.local.c	Sun Dec 31 15:31:26 2000
@@ -149,6 +149,18 @@ extern size_t	strlcat __P((char *, const
 # endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
 
 /*
+** Cygwin
+*/
+
+#ifdef __CYGWIN__
+# define HASSNPRINTF    1
+# define USE_LOCKF	1
+# define USE_SETEUID	1
+# define USE_VSYSLOG	0
+# define _PATH_MAILDIR	"/usr/spool/mail"
+#endif
+
+/*
  * If you don't have flock, you could try using lockf instead.
  */
 
@@ -208,7 +220,9 @@ extern FILE	*fdopen __P((int, const char
 # if !HASSNPRINTF
 extern int	snprintf __P((char *, size_t, const char *, ...));
 #  ifndef _CRAY
+#ifndef __CYGWIN__
 extern int	vsnprintf __P((char *, size_t, const char *, ...));
+#endif
 #  endif /* ! _CRAY */
 # endif /* !HASSNPRINTF */
 
@@ -1087,12 +1101,14 @@ tryagain:
 	}
 
 	/* change UID for quota checks */
+#ifndef __CYGWIN__
 	if (setreuid(0, U_UID) < 0)
 	{
 		mailerr("450 4.2.0", "setreuid(0, %d): %s (r=%d, e=%d)",
 			U_UID, errstring(errno), getuid(), geteuid());
 		goto err1;
 	}
+#endif	
 #ifdef DEBUG
 	fprintf(stderr, "new euid = %d\n", geteuid());
 #endif /* DEBUG */
@@ -1121,12 +1137,14 @@ tryagain:
 
 
 	/* Wait until we can get a lock on the file. */
+#ifndef __CYGWIN__
 	if (flock(mbfd, LOCK_EX) < 0)
 	{
 		mailerr("450 4.2.0", "%s: %s", path, errstring(errno));
 		goto err1;
 	}
-
+#endif
+	
 	/* Get the starting offset of the new message for biff. */
 	curoff = lseek(mbfd, (off_t)0, SEEK_END);
 	if (sizeof curoff > sizeof(long))
@@ -1233,12 +1251,14 @@ err0:		unlockmbox();
 	else
 		notifybiff(biffmsg);
 
+#ifndef __CYGWIN__		
 	if (setreuid(0, 0) < 0)
 	{
 		mailerr("450 4.2.0", "setreuid(0, 0): %s",
 			errstring(errno));
 		goto err0;
 	}
+#endif	
 #ifdef DEBUG
 	fprintf(stderr, "reset euid = %d\n", geteuid());
 #endif /* DEBUG */
diff -upr /gnu/sendmail-8.11.1/sendmail/conf.h sendmail-8.11.1/sendmail/conf.h
--- /gnu/sendmail-8.11.1/sendmail/conf.h	Wed Aug  9 18:14:39 2000
+++ sendmail-8.11.1/sendmail/conf.h	Sun Dec 31 15:55:52 2000
@@ -1463,6 +1463,28 @@ extern void		*malloc();
 # endif /* ! HASFCHOWN */
 #endif /* __linux__ */
 
+/*
+** Cygwin
+*/
+
+#ifdef __CYGWIN__
+# define HASSETREUID   0       /* has setreuid(2) call */
+# define HASGETUSERSHELL 0     /* does not have getusershell(3) */
+# define HASUNSETENV   1
+# ifndef HASSNPRINTF
+#  define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
+# endif /* ! HASSNPRINTF */
+# ifndef HAS_IN_H
+#  define HAS_IN_H	1	/* use netinet/in.h */
+# endif /* ! HAS_IN_H */
+# define IP_SRCROUTE   0       /* does not have <netinet/ip_var.h> */
+# define setgroups(a,b) -1
+# define minor(x)      (x&0xff)
+# define major(x)      ((x>>8)&0xff)
+# define USE_LOCKF 1
+# define _PATH_VENDOR_CF      "/usr/local/etc/mail/sendmail.cf"
+# define _PATH_SENDMAILPID    "/var/log/sendmail.pid"
+#endif
 
 /*
 **  DELL SVR4 Issue 2.2, and others
@@ -2209,7 +2231,6 @@ typedef struct msgb		mblk_t;
 # define _PATH_VENDOR_CF	"/etc/sendmail.cf"
 # define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
 #endif /* MOTO */
-
 
 /**********************************************************************
 **  End of Per-Operating System defines
diff -upr /gnu/sendmail-8.11.1/sendmail/err.c sendmail-8.11.1/sendmail/err.c
--- /gnu/sendmail-8.11.1/sendmail/err.c	Fri May 26 02:08:29 2000
+++ sendmail-8.11.1/sendmail/err.c	Sun Dec 31 15:04:47 2000
@@ -859,8 +859,13 @@ errstring(errnum)
 	char *bp;
 	static char buf[MAXLINE];
 #if !HASSTRERROR && !defined(ERRLIST_PREDEFINED)
-	extern char *sys_errlist[];
-	extern int sys_nerr;
+#ifdef __CYGWIN__
+#define sys_nerr _sys_nerr
+#define sys_errlist _sys_errlist
+#else
+        extern char *sys_errlist[];
+        extern int sys_nerr;
+#endif
 #endif /* !HASSTRERROR && !defined(ERRLIST_PREDEFINED) */
 
 	/*

generic-cygwin.cf

generic-cygwin.mc

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]