diff -ru screen-4.0.3.orig/configure.in screen-4.0.3/configure.in
--- screen-4.0.3.orig/configure.in	2007-11-07 13:22:56.000000000 -0500
+++ screen-4.0.3/configure.in	2007-11-07 11:54:48.000000000 -0500
@@ -46,31 +46,6 @@
 AC_PROG_GCC_TRADITIONAL
 AC_ISC_POSIX
 
-AC_TRY_RUN(main(){exit(0);},,[
-if test $CC != cc ; then
-AC_NOTE(Your $CC failed - restarting with CC=cc)
-AC_NOTE()
-CC=cc
-export CC
-exec $0 $configure_args
-fi
-])
-
-AC_TRY_RUN(main(){exit(0);},,
-exec 5>&2
-eval $ac_link
-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
-AC_NOTE($ac_compile)
-AC_MSG_ERROR(Can't run the compiler - sorry))
-
-AC_TRY_RUN([
-main()
-{
-  int __something_strange_();
-  __something_strange_(0);
-}
-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
-
 AC_PROG_AWK
 
 AC_PROG_INSTALL
@@ -293,123 +268,10 @@
 dnl
 
 AC_CHECKING(fifos)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#ifndef O_NONBLOCK
-#define O_NONBLOCK O_NDELAY
-#endif
-#ifndef S_IFIFO
-#define S_IFIFO 0010000
-#endif
-
-char *fin = "/tmp/conftest$$";
-
-main()
-{
-  struct stat stb;
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-  (void)alarm(5);
-#ifdef POSIX
-  if (mkfifo(fin, 0777))
-#else
-  if (mknod(fin, S_IFIFO|0777, 0))
-#endif
-    exit(1);
-  if (stat(fin, &stb) || (stb.st_mode & S_IFIFO) != S_IFIFO)
-    exit(1);
-  close(0);
-#ifdef __386BSD__
-  /*
-   * The next test fails under 386BSD, but screen works using fifos.
-   * Fifos in O_RDWR mode are only used for the BROKEN_PIPE case and for
-   * the select() configuration test.
-   */
-  exit(0);
-#endif
-  if (open(fin, O_RDONLY | O_NONBLOCK))
-    exit(1);
-  if (fork() == 0)
-    {
-      close(0);
-      if (open(fin, O_WRONLY | O_NONBLOCK))
-	exit(1);
-      close(0);
-      if (open(fin, O_WRONLY | O_NONBLOCK))
-	exit(1);
-      if (write(0, "TEST", 4) == -1)
-	exit(1);
-      exit(0);
-    }
-#ifdef FD_SET
-  FD_SET(0, &f);
-#else
-  f = 1;
-#endif
-  if (select(1, &f, 0, 0, 0) == -1)
-    exit(1);
-  exit(0);
-}
-], AC_NOTE(- your fifos are usable) fifo=1,
-AC_NOTE(- your fifos are not usable))
-rm -f /tmp/conftest*
+fifo=1
 
 if test -n "$fifo"; then
 AC_CHECKING(for broken fifo implementation)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-
-#ifndef O_NONBLOCK
-#define O_NONBLOCK O_NDELAY
-#endif
-#ifndef S_IFIFO
-#define S_IFIFO 0010000
-#endif
-
-char *fin = "/tmp/conftest$$";
-
-main()
-{
-  struct timeval tv;
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-#ifdef POSIX
-  if (mkfifo(fin, 0600))
-#else
-  if (mknod(fin, S_IFIFO|0600, 0))
-#endif
-    exit(1);
-  close(0);
-  if (open(fin, O_RDONLY|O_NONBLOCK))
-    exit(1);
-#ifdef FD_SET
-  FD_SET(0, &f);
-#else
-  f = 1;
-#endif
-  tv.tv_sec = 1;
-  tv.tv_usec = 0;
-  if (select(1, &f, 0, 0, &tv))
-    exit(1);
-  exit(0);
-}
-], AC_NOTE(- your implementation is ok), 
-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
-rm -f /tmp/conftest*
 fi
 
 dnl
@@ -419,91 +281,10 @@
 dnl
 
 AC_CHECKING(sockets)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <fcntl.h>
-
-char *son = "/tmp/conftest$$";
-
-main()
-{
-  int s1, s2, l;
-  struct sockaddr_un a;
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-  (void)alarm(5);
-  if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-    exit(1);
-  a.sun_family = AF_UNIX;
-  strcpy(a.sun_path, son);
-  (void) unlink(son);
-  if (bind(s1, (struct sockaddr *) &a, strlen(son)+2) == -1)
-    exit(1);
-  if (listen(s1, 2))
-    exit(1);
-  if (fork() == 0)
-    {
-      if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-	kill(getppid(), 3);
-      (void)connect(s2, (struct sockaddr *)&a, strlen(son) + 2);
-      if (write(s2, "HELLO", 5) == -1)
-	kill(getppid(), 3);
-      exit(0);
-    }
-  l = sizeof(a);
-  close(0);
-  if (accept(s1, &a, &l))
-    exit(1);
-#ifdef FD_SET
-  FD_SET(0, &f);
-#else
-  f = 1;
-#endif
-  if (select(1, &f, 0, 0, 0) == -1)
-    exit(1);
-  exit(0);
-}
-], AC_NOTE(- your sockets are usable) sock=1,
-AC_NOTE(- your sockets are not usable))
-rm -f /tmp/conftest*
+sock=1
 
 if test -n "$sock"; then
 AC_CHECKING(socket implementation)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-char *son = "/tmp/conftest$$";
-
-main()
-{
-  int s;
-  struct stat stb;
-  struct sockaddr_un a;
-  if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-    exit(0);
-  a.sun_family = AF_UNIX;
-  strcpy(a.sun_path, son);
-  (void) unlink(son);
-  if (bind(s, (struct sockaddr *) &a, strlen(son)+2) == -1)
-    exit(0);
-  if (stat(son, &stb))
-    exit(1);
-  close(s);
-  exit(0);
-}
-],AC_NOTE(- you are normal),
-AC_NOTE(- unix domain sockets are not kept in the filesystem)
-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
-rm -f /tmp/conftest*
 fi
 
 
@@ -536,106 +317,6 @@
 dnl
 
 AC_CHECKING(select return value)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-char *nam = "/tmp/conftest$$";
-
-#ifdef NAMEDPIPE
-
-#ifndef O_NONBLOCK
-#define O_NONBLOCK O_NDELAY
-#endif
-#ifndef S_IFIFO
-#define S_IFIFO 0010000
-#endif
-
-
-main()
-{
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-#ifdef __FreeBSD__
-/* From Andrew A. Chernov (ache@astral.msk.su):
- * opening RDWR fifo fails in BSD 4.4, but select return values are
- * right.
- */
-  exit(0);
-#endif
-  (void)alarm(5);
-#ifdef POSIX
-  if (mkfifo(nam, 0777))
-#else
-  if (mknod(nam, S_IFIFO|0777, 0))
-#endif
-    exit(1);
-  close(0);
-  if (open(nam, O_RDWR | O_NONBLOCK))
-    exit(1);
-  if (write(0, "TEST", 4) == -1)
-    exit(1);
-
-#else
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-main()
-{
-  int s1, s2, l;
-  struct sockaddr_un a;
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-  (void)alarm(5);
-  if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-    exit(1);
-  a.sun_family = AF_UNIX;
-  strcpy(a.sun_path, nam);
-  (void) unlink(nam);
-  if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1)
-    exit(1);
-  if (listen(s1, 2))
-    exit(1);
-  if (fork() == 0)
-    {
-      if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-	kill(getppid(), 3);
-      (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2);
-      if (write(s2, "HELLO", 5) == -1)
-	kill(getppid(), 3);
-      exit(0);
-    }
-  l = sizeof(a);
-  close(0);
-  if (accept(s1, (struct sockaddr *)&a, &l))
-    exit(1);
-#endif
-
-
-#ifdef FD_SET
-  FD_SET(0, &f);
-#else
-  f = 1;
-#endif
-  if (select(1, &f, 0, 0, 0) == -1)
-    exit(1);
-  if (select(1, &f, &f, 0, 0) != 2)
-    exit(1);
-  exit(0);
-}
-],AC_NOTE(- select is ok),
-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
 
 dnl
 dnl    ****  termcap or terminfo  ****
@@ -668,12 +349,6 @@
 AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
 AC_MSG_ERROR(!!! no tgetent - no screen)))))))
 
-AC_TRY_RUN([
-main()
-{
- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
-}], AC_NOTE(- you use the termcap database),
-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
 AC_CHECKING(ospeed)
 AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
 
@@ -687,10 +362,6 @@
 
 AC_CHECKING(for SVR4 ptys)
 sysvr4ptys=
-if test -c /dev/ptmx ; then
-AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
-sysvr4ptys=1])
-fi
 
 AC_CHECK_FUNCS(getpt)
 
@@ -737,80 +408,6 @@
 
 AC_CHECKING(default tty permissions/group)
 rm -f conftest_grp
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-main()
-{
-  struct stat sb;
-  char *x,*ttyname();
-  int om, m;
-  FILE *fp;
-
-  if (!(x = ttyname(0))) exit(1);
-  if (stat(x, &sb)) exit(1);
-  om = sb.st_mode;
-  if (om & 002) exit(0);
-  m = system("mesg y");
-  if (m == -1 || m == 127) exit(1);
-  if (stat(x, &sb)) exit(1);
-  m = sb.st_mode;
-  if (chmod(x, om)) exit(1);
-  if (m & 002) exit(0);
-  if (sb.st_gid == getgid()) exit(1);
-  if (!(fp=fopen("conftest_grp", "w")))
-    exit(1);
-  fprintf(fp, "%d\n", sb.st_gid);
-  fclose(fp);
-  exit(0);
-}
-],[
-    if test -f conftest_grp; then
-	ptygrp=`cat conftest_grp`
-	AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
-	AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
-	AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
-    else
-	AC_NOTE(- ptys are world accessable)
-    fi
-],[
-    WRITEPATH=''
-    XTERMPATH=''
-    AC_PATH_PROG(WRITEPATH, write)
-    AC_PATH_PROG(XTERMPATH, xterm)
-    found=
-    if test -n "$WRITEPATH$XTERMPATH"; then
-      findfollow=
-      lsfollow=
-      found=`find $WRITEPATH $XTERMPATH -follow -print 2>/dev/null`
-      if test -n "$found"; then
-	findfollow=-follow
-	lsfollow=L
-      fi
-      if test -n "$XTERMPATH"; then
-	ptygrpn=`ls -l$lsfollow $XTERMPATH | sed -n -e 1p | $AWK '{print $4}'`
-	if test tty != "$ptygrpn"; then
-	  XTERMPATH=
-	fi
-      fi
-    fi
-    if test -n "$WRITEPATH$XTERMPATH"; then
-      found=`find $WRITEPATH $XTERMPATH $findfollow -perm -2000 -print` 
-      if test -n "$found"; then
-	ptygrp=`ls -ln$lsfollow $found | sed -n -e 1p | $AWK '{print $4}'`
-	AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
-	AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
-	AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
-      else
-	AC_NOTE(- ptys are world accessable)
-      fi
-    else
-      AC_NOTE(- can't determine - assume ptys are world accessable)
-    fi
-  ]
-)
-rm -f conftest_grp
 fi
 
 dnl
@@ -923,40 +520,6 @@
 
   AC_CHECKING(for avenrun symbol)
   nlist64=
-  for av in avenrun _avenrun _Loadavg avenrun _avenrun _Loadavg; do
-  AC_TRY_RUN([
-#include <sys/types.h>
-#ifdef NLIST_STRUCT
-#include <nlist.h>
-#else
-#include <a.out.h>
-#endif
-
-$nlist64
-
-struct nlist nl[2];
-
-main()
-{
-#if !defined(_AUX_SOURCE) && !defined(AUX)
-# ifdef NLIST_NAME_UNION
-  nl[0].n_un.n_name = "$av";
-# else
-  nl[0].n_name = "$av";
-# endif
-#else
-  strncpy(nl[0].n_name, "$av", sizeof(nl[0].n_name));
-#endif
-  nlist(LOADAV_UNIX, nl);
-  if (nl[0].n_value == 0)
-    exit(1);
-  exit(0);
-}
-  ],avensym=$av;break)
-  if test "$av" = _Loadavg; then
-    nlist64='#define nlist nlist64'
-  fi
-  done
   if test -z "$avensym" ; then
     AC_NOTE(- no avenrun symbol found)
   else
@@ -1052,40 +615,6 @@
 #endif
 ], AC_DEFINE(USESIGSET))
 AC_CHECKING(signal implementation)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <signal.h>
-
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif
-#ifdef USESIGSET
-#define signal sigset
-#endif
-
-int got;
-
-#ifdef SIGVOID
-void
-#endif
-hand()
-{
-  got++;
-}
-
-main()
-{
-  /* on hpux we use sigvec to get bsd signals */
-#ifdef __hpux
-  (void)signal(SIGCLD, hand);
-  kill(getpid(), SIGCLD);
-  kill(getpid(), SIGCLD);
-  if (got < 2)
-    exit(1);
-#endif
-  exit(0);
-}
-],,AC_DEFINE(SYSVSIGS))
 
 fi
 
@@ -1153,50 +682,9 @@
 AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
 
 AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
-AC_TRY_RUN([
-main() {
-  char buf[10];
-  strcpy(buf, "abcdefghi");
-  bcopy(buf, buf + 2, 3);
-  if (strncmp(buf, "ababcf", 6))
-    exit(1);
-  strcpy(buf, "abcdefghi");
-  bcopy(buf + 2, buf, 3);
-  if (strncmp(buf, "cdedef", 6))
-    exit(1);
-  exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEBCOPY))
-
-AC_TRY_RUN([
-#define bcopy(s,d,l) memmove(d,s,l)
-main() {
-  char buf[10];
-  strcpy(buf, "abcdefghi");
-  bcopy(buf, buf + 2, 3);
-  if (strncmp(buf, "ababcf", 6))
-    exit(1);
-  strcpy(buf, "abcdefghi");
-  bcopy(buf + 2, buf, 3);
-  if (strncmp(buf, "cdedef", 6))
-    exit(1);
-  exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEMEMMOVE))
-
-
-AC_TRY_RUN([
-#define bcopy(s,d,l) memcpy(d,s,l)
-main() {
-  char buf[10];
-  strcpy(buf, "abcdefghi");
-  bcopy(buf, buf + 2, 3);
-  if (strncmp(buf, "ababcf", 6))
-    exit(1);
-  strcpy(buf, "abcdefghi");
-  bcopy(buf + 2, buf, 3);
-  if (strncmp(buf, "cdedef", 6))
-    exit(1);
-  exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEMEMCPY))
+AC_DEFINE(USEBCOPY)
+AC_DEFINE(USEMEMMOVE)
+AC_DEFINE(USEMEMCPY)
 
 AC_MSG_CHECKING(long file names)
 (echo 1 > /tmp/conftest9012345) 2>/dev/null
@@ -1271,8 +759,6 @@
 dnl Ptx bug workaround -- insert -lc after -ltermcap
 test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
 
-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
-
 ETCSCREENRC="\"/usr/local/etc/screenrc\""
 if test -n "$prefix"; then
 ETCSCREENRC="\"$prefix/etc/screenrc\""
--- screen-4.0.3.orig/doc/Makefile.in	2006-10-23 09:06:32.000000000 -0400
+++ screen-4.0.3/doc/Makefile.in	2007-11-07 13:39:44.000000000 -0500
@@ -5,6 +5,9 @@
 
 DESTDIR = 
 
+datadir = @datadir@
+datarootdir = @datarootdir@
+
 prefix = @prefix@
 mandir = @mandir@
 infodir = @infodir@
--- screen-4.0.3.orig/config.h.in	2006-10-23 09:06:32.000000000 -0400
+++ screen-4.0.3/config.h.in	2007-11-07 16:53:56.000000000 -0500
@@ -208,7 +208,7 @@
  * If screen is installed with permissions to update /etc/utmp (such
  * as if it is installed set-uid root), define UTMPOK.
  */
-#define UTMPOK
+#undef UTMPOK
 
 /* Set LOGINDEFAULT to one (1)
  * if you want entries added to /etc/utmp by default, else set it to
--- screen-4.0.3.orig/utmp.c	2003-09-08 10:27:17.000000000 -0400
+++ screen-4.0.3/utmp.c	2007-11-07 16:56:09.000000000 -0500
@@ -861,6 +861,7 @@
 #if defined(linux) && defined(GETUTENT)
 # undef pututline
 
+#ifdef UTMPOK
 /* aargh, linux' pututline returns void! */
 struct utmp *
 xpututline(u)
@@ -876,3 +877,4 @@
 }
 #endif
 
+#endif
--- screen-4.0.3.orig/etc/etcscreenrc	2003-12-05 08:46:13.000000000 -0500
+++ screen-4.0.3/etc/etcscreenrc	2007-11-07 16:58:46.000000000 -0500
@@ -10,7 +10,6 @@
 
 #defflow on # will force screen to process ^S/^Q
 
-deflogin on
 #autodetach off
 
 vbell on
@@ -88,7 +87,5 @@
 #make them better
 bind \\ quit
 bind K kill
-bind I login on
-bind O login off
 bind } history
 
