diff -u orig/screen-4.0.2/Makefile.in screen-4.0.2/Makefile.in
--- orig/screen-4.0.2/Makefile.in	2003-12-05 08:59:39.000000000 -0500
+++ screen-4.0.2/Makefile.in	2006-06-13 00:16:47.265625000 -0400
@@ -18,7 +18,7 @@
 bindir  = $(exec_prefix)/bin
 
 VERSION = @VERSION@
-SCREEN = screen-$(VERSION)
+SCREEN = screen-$(VERSION)$(EXEEXT)
 
 ETCSCREENRC = `sed < config.h -n -e '/define ETCSCREENRC/s/^.*"\([^"]*\)"/\1/p'`
 SCREENENCODINGS = `sed < config.h -n -e '/define SCREENENCODINGS/s/^.*"\([^"]*\)"/\1/p'`
diff -u orig/screen-4.0.2/configure screen-4.0.2/configure
--- orig/screen-4.0.2/configure	2003-12-05 08:46:53.000000000 -0500
+++ screen-4.0.2/configure	2006-06-13 00:01:50.437500000 -0400
@@ -4188,6 +4188,7 @@
 
 main()
 {
+	exit(0);
   struct stat stb;
 #ifdef FD_SET
   fd_set f;
diff -u orig/screen-4.0.2/misc.c screen-4.0.2/misc.c
--- orig/screen-4.0.2/misc.c	2003-12-05 08:45:41.000000000 -0500
+++ screen-4.0.2/misc.c	2006-06-13 00:13:01.937500000 -0400
@@ -613,7 +613,7 @@
    */
 # endif /* NEEDSETENV */
 #else /* USESETENV */
-# if defined(linux) || defined(__convex__) || (BSD >= 199103)
+# if defined(linux) || defined(__convex__) || (BSD >= 199103) || defined(__CYGWIN__)
   setenv(var, value, 1);
 # else
   setenv(var, value);
diff -u orig/screen-4.0.2/pty.c screen-4.0.2/pty.c
--- orig/screen-4.0.2/pty.c	2003-09-08 10:26:18.000000000 -0400
+++ screen-4.0.2/pty.c	2006-06-13 00:26:43.609375000 -0400
@@ -35,7 +35,9 @@
 
 /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
 #ifdef HAVE_SVR4_PTYS
-# include <sys/stropts.h>
+#ifndef __CYGWIN__
+#   include <sys/stropts.h>
+#endif
 #endif
 
 #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
diff -u orig/screen-4.0.2/utmp.c screen-4.0.2/utmp.c
--- orig/screen-4.0.2/utmp.c	2003-09-08 10:27:17.000000000 -0400
+++ screen-4.0.2/utmp.c	2006-06-13 00:26:08.953125000 -0400
@@ -89,7 +89,7 @@
 static int  initutmp __P((void));
 static void setutent __P((void));
 #endif
-#if defined(linux) && defined(GETUTENT)
+#if (defined(linux) || defined(__CYGWIN__)) && defined(GETUTENT)
 static struct utmp *xpututline __P((struct utmp *utmp));
 # define pututline xpututline
 #endif
@@ -106,7 +106,9 @@
 #  if defined(hpux) /* cruel hpux release 8.0 */
 #   define pututline _pututline
 #  endif /* hpux */
+#ifndef __CYGWIN__
 extern struct utmp *getutline(), *pututline();
+#endif
 #  if defined(_SEQUENT_)
 extern struct utmp *ut_add_user(), *ut_delete_user();
 extern char *ut_find_host();
@@ -589,7 +591,7 @@
 struct utmp *u;
 {
   u->ut_type = DEAD_PROCESS;
-#if !defined(linux) || defined(EMPTY)
+#if (!defined(linux) && !defined(__CYGWIN__))|| defined(EMPTY)
   u->ut_exit.e_termination = 0;
   u->ut_exit.e_exit = 0;
 #endif
@@ -858,7 +860,7 @@
 }
 # endif /* BUGGYGETLOGIN */
 
-#if defined(linux) && defined(GETUTENT)
+#if (defined(linux) || defined(__CYGWIN__)) && defined(GETUTENT)
 # undef pututline
 
 /* aargh, linux' pututline returns void! */

