screen: update to latest stable

Upgraded app-misc/screen to version 4.0.3-r4 on amd64, arm, x86.

Nothing depends on this as it's a dev-only package, so should be
trivial to merge.

BUG=None
TEST=`emerge screen` worked
TEST=`emerge-x86-alex screen` worked

Change-Id: I9920525c0b41a1c12665a0207dddfb6990cb2065
Reviewed-on: https://gerrit.chromium.org/gerrit/19532
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2012-04-03 14:02:10 -04:00 committed by Gerrit
parent f5d5c36f9e
commit 183bceee2f
16 changed files with 1554 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST screen-4.0.3.tar.gz 840602 RMD160 8c3903c1642ae30fd9d5706298919428552f7754 SHA1 7bc6e2f0959ffaae6f52d698c26c774e7dec3545 SHA256 78f0d5b1496084a5902586304d4a73954b2bfe33ea13edceecf21615c39e6c77

View File

@ -0,0 +1,11 @@
--- utmp.c.orig 2004-11-14 23:15:28.000000000 +0100
+++ utmp.c 2004-11-14 23:15:39.000000000 +0100
@@ -618,7 +618,7 @@
#endif /* sgi */
strncpy(u->ut_line, line, sizeof(u->ut_line));
u->ut_pid = pid;
- (void)time((time_t *)&u->ut_time);
+ u->ut_time = time(NULL);
}
static slot_t

View File

@ -0,0 +1,18 @@
--- screen-4.0.2/configure.in 2005-05-22 19:55:06.559874997 +0000
+++ screen-4.0.2-no-libelf/configure.in 2005-05-22 19:56:05.895801017 +0000
@@ -195,15 +195,6 @@
#endif
], LIBS="$LIBS -lsocket -linet";seqptx=1)
-oldlibs="$LIBS"
-LIBS="$LIBS -lelf"
-AC_CHECKING(SVR4)
-AC_TRY_LINK([#include <utmpx.h>
-],,
-[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
-[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
-,LIBS="$oldlibs")
-
AC_CHECKING(for Solaris 2.x)
AC_EGREP_CPP(yes,
[#if defined(SVR4) && defined(sun)

View File

@ -0,0 +1,14 @@
--- screen-4.0.2/pty.c.orig 2004-07-29 23:53:45.313533536 -0400
+++ screen-4.0.2/pty.c 2004-07-29 23:53:59.011451136 -0400
@@ -33,11 +33,6 @@
# include <sys/ioctl.h>
#endif
-/* for solaris 2.1, Unixware (SVR4.2) and possibly others */
-#ifdef HAVE_SVR4_PTYS
-# include <sys/stropts.h>
-#endif
-
#if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
# include <sys/ttold.h>
#endif

View File

@ -0,0 +1,14 @@
--- screen-4.0.2/configure.in.orig 2004-12-17 19:55:45.314670411 +0100
+++ screen-4.0.2/configure.in 2004-12-17 19:55:50.575941541 +0100
@@ -855,11 +855,6 @@
#include <utmp.h>
#endif
],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE(UTHOST))
-AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
-if test "$have_utempter" = yes; then
- AC_DEFINE(HAVE_UTEMPTER)
- LIBS="$LIBS -lutempter"
-fi
dnl
dnl **** loadav ****

View File

@ -0,0 +1,11 @@
--- screen.c.orig 2006-04-02 17:05:28.000000000 +0200
+++ screen.c 2006-04-02 17:05:39.000000000 +0200
@@ -1197,7 +1197,7 @@ char **av;
if (!detached)
{
/* reopen tty. must do this, because fd 0 may be RDONLY */
- if ((n = secopen(attach_tty, O_RDWR, 0)) < 0)
+ if ((n = secopen(attach_tty, O_RDWR | O_NONBLOCK, 0)) < 0)
Panic(0, "Cannot reopen '%s' - please check.", attach_tty);
}
else

View File

@ -0,0 +1,12 @@
diff -Nur screen-4.0.2.orig/process.c screen-4.0.2/process.c
--- screen-4.0.2.orig/process.c 2003-09-18 14:53:54.000000000 +0200
+++ screen-4.0.2/process.c 2005-07-06 19:55:08.370772955 +0200
@@ -4841,7 +4841,7 @@
s = buf;
for (display = displays; display; display = display->d_next)
{
- if (D_user == olddisplay->d_user)
+ if (olddisplay && D_user == olddisplay->d_user)
continue;
for (cv = D_cvlist; cv; cv = cv->c_next)
if (Layer2Window(cv->c_layer) == p)

View File

@ -0,0 +1,203 @@
diff --git a/acls.c b/acls.c
index 0f98df2..5f26d70 100644
--- a/acls.c
+++ b/acls.c
@@ -178,7 +178,7 @@ struct acluser **up;
#endif
(*up)->u_Esc = DefaultEsc;
(*up)->u_MetaEsc = DefaultMetaEsc;
- strncpy((*up)->u_name, name, 20);
+ strncpy((*up)->u_name, name, MAXSTR);
(*up)->u_password = NULL;
if (pass)
(*up)->u_password = SaveStr(pass);
@@ -314,8 +314,8 @@ struct acluser **up;
return UserAdd(name, pass, up);
if (!strcmp(name, "nobody")) /* he remains without password */
return -1;
- strncpy((*up)->u_password, pass ? pass : "", 20);
- (*up)->u_password[20] = '\0';
+ strncpy((*up)->u_password, pass ? pass : "", MAXSTR);
+ (*up)->u_password[MAXSTR] = '\0';
return 0;
}
#endif
diff --git a/acls.h b/acls.h
index c41b714..7f20f55 100644
--- a/acls.h
+++ b/acls.h
@@ -36,6 +36,16 @@
#define ACLBYTE(data, w) ((data)[(w) >> 3])
#define ACLBIT(w) (0x80 >> ((w) & 7))
+#include <limits.h>
+
+#ifndef NAME_MAX
+# ifndef MAXNAMELEN
+# define NAME_MAX 255
+# else
+# define NAME_MAX MAXNAMELEN
+# endif
+#endif
+
typedef unsigned char * AclBits;
/*
@@ -73,7 +83,7 @@ struct plop
typedef struct acluser
{
struct acluser *u_next; /* continue the main user list */
- char u_name[20+1]; /* login name how he showed up */
+ char u_name[NAME_MAX+1]; /* login name how he showed up */
char *u_password; /* his password (may be NullStr). */
int u_checkpassword; /* nonzero if this u_password is valid */
int u_detachwin; /* the window where he last detached */
diff --git a/display.h b/display.h
index ef99954..563fcd0 100644
--- a/display.h
+++ b/display.h
@@ -22,6 +22,16 @@
* $Id: 4.0.3-extend-d_termname-ng2.patch,v 1.2 2010/12/08 21:28:15 jlec Exp $ FAU
*/
+#include <limits.h>
+
+#ifndef NAME_MAX
+# ifndef MAXNAMELEN
+# define NAME_MAX 255
+# else
+# define NAME_MAX MAXNAMELEN
+# endif
+#endif
+
#ifdef MAPKEYS
#define KMAP_KEYS (T_OCAPS-T_CAPS)
@@ -85,7 +95,7 @@ struct display
struct win *d_other; /* pointer to other window */
int d_nonblock; /* -1 don't block if obufmax reached */
/* >0: block after nonblock secs */
- char d_termname[20 + 1]; /* $TERM */
+ char d_termname[NAME_MAX + 1]; /* $TERM */
char *d_tentry; /* buffer for tgetstr */
char d_tcinited; /* termcap inited flag */
int d_width, d_height; /* width/height of the screen */
diff --git a/screen.c b/screen.c
index 70741df..6f45b60 100644
--- a/screen.c
+++ b/screen.c
@@ -106,6 +106,16 @@ FILE *dfp;
#endif
+#include <limits.h>
+
+#ifndef NAME_MAX
+# ifndef MAXNAMELEN
+# define NAME_MAX 255
+# else
+# define NAME_MAX MAXNAMELEN
+# endif
+#endif
+
extern char Term[], screenterm[], **environ, Termcap[];
int force_vt = 1;
int VBellWait, MsgWait, MsgMinWait, SilenceWait;
@@ -877,13 +887,13 @@ char **av;
if (home == 0 || *home == '\0')
home = ppp->pw_dir;
- if (strlen(LoginName) > 20)
+ if (strlen(LoginName) > NAME_MAX)
Panic(0, "LoginName too long - sorry.");
#ifdef MULTIUSER
- if (multi && strlen(multi) > 20)
+ if (multi && strlen(multi) > NAME_MAX)
Panic(0, "Screen owner name too long - sorry.");
#endif
- if (strlen(home) > MAXPATHLEN - 25)
+ if (strlen(home) > MAXPATHLEN - NAME_MAX)
Panic(0, "$HOME too long - sorry.");
attach_tty = "";
diff --git a/screen.h b/screen.h
index 4f9f354..bcaaaf6 100644
--- a/screen.h
+++ b/screen.h
@@ -43,6 +43,15 @@
#include "comm.h"
#include "layer.h"
#include "term.h"
+#include <limits.h>
+
+#ifndef NAME_MAX
+# ifndef MAXNAMELEN
+# define NAME_MAX 255
+# else
+# define NAME_MAX MAXNAMELEN
+# endif
+#endif
#ifdef DEBUG
@@ -195,26 +204,26 @@ struct msg
create;
struct
{
- char auser[20 + 1]; /* username */
+ char auser[NAME_MAX + 1]; /* username */
int apid; /* pid of frontend */
int adaptflag; /* adapt window size? */
int lines, columns; /* display size */
char preselect[20];
int esc; /* his new escape character unless -1 */
int meta_esc; /* his new meta esc character unless -1 */
- char envterm[20 + 1]; /* terminal type */
+ char envterm[NAME_MAX + 1]; /* terminal type */
int encoding; /* encoding of display */
}
attach;
struct
{
- char duser[20 + 1]; /* username */
+ char duser[NAME_MAX + 1]; /* username */
int dpid; /* pid of frontend */
}
detach;
struct
{
- char auser[20 + 1]; /* username */
+ char auser[NAME_MAX + 1]; /* username */
int nargs;
char cmd[MAXPATHLEN]; /* command */
int apid; /* pid of frontend */
diff --git a/socket.c b/socket.c
index 62a73af..1cc9c27 100644
--- a/socket.c
+++ b/socket.c
@@ -45,6 +45,16 @@
#include "extern.h"
+#include <limits.h>
+
+#ifndef NAME_MAX
+# ifndef MAXNAMELEN
+# define NAME_MAX 255
+# else
+# define NAME_MAX MAXNAMELEN
+# endif
+#endif
+
static int CheckPid __P((int));
static void ExecCreate __P((struct msg *));
static void DoCommandMsg __P((struct msg *));
@@ -1248,7 +1258,7 @@ static void PasswordProcessInput __P((char *, int));
struct pwdata {
int l;
- char buf[20 + 1];
+ char buf[NAME_MAX + 1];
struct msg m;
};

View File

@ -0,0 +1,31 @@
--- ansi.c.orig 2003-09-08 10:24:44.000000000 -0400
+++ ansi.c 2003-11-29 10:41:15.000000000 -0500
@@ -559,7 +559,7 @@
{
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- if (curr->w_NumArgs < MAXARGS)
+ if (curr->w_NumArgs >= 0 && curr->w_NumArgs < MAXARGS)
{
if (curr->w_args[curr->w_NumArgs] < 100000000)
curr->w_args[curr->w_NumArgs] =
--- resize.c.orig 2003-09-08 10:26:31.000000000 -0400
+++ resize.c 2003-11-29 10:41:50.000000000 -0500
@@ -682,6 +682,17 @@
if (wi == 0)
he = hi = 0;
+ if (wi > 1000)
+ {
+ Msg(0, "Window width too large, truncated");
+ wi = 1000;
+ }
+ if (he > 1000)
+ {
+ Msg(0, "Window height too large, truncated");
+ he = 1000;
+ }
+
if (p->w_width == wi && p->w_height == he && p->w_histheight == hi)
{
debug("ChangeWindowSize: No change.\n");

View File

@ -0,0 +1,13 @@
--- screen-4.0.1/configure.in 2003-06-03 07:58:24.000000000 -0400
+++ screen-4.0.1/configure.in.agriffis 2004-01-13 12:07:37.000000000 -0500
@@ -1206,7 +1206,9 @@
rm -f /tmp/conftest*
AC_MSG_CHECKING(for vsprintf)
-AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
+AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);],
+ [AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS)],
+ [AC_MSG_RESULT(no)])
AC_HEADER_DIRENT

View File

@ -0,0 +1,14 @@
compability for sys-devel/autoconf-2.62
https://bugs.gentoo.org/show_bug.cgi?id=217311
--- screen/config.h.in
+++ screen/config.h.in
@@ -563,7 +563,6 @@
* If you are on a SYS V machine that restricts filename length to 14
* characters, you may need to enforce that by setting NAME_MAX to 14
*/
-#undef NAME_MAX /* KEEP_UNDEF_HERE override system value */
#undef NAME_MAX
/*

View File

@ -0,0 +1,598 @@
--- configure.in~ 2008-11-23 17:43:48.000000000 +0000
+++ configure.in 2008-11-23 17:43:48.000000000 +0000
@@ -46,6 +46,7 @@
AC_PROG_GCC_TRADITIONAL
AC_ISC_POSIX
+AC_MSG_CHECKING([for compiler sanity])
AC_TRY_RUN(main(){exit(0);},,[
if test $CC != cc ; then
AC_NOTE(Your $CC failed - restarting with CC=cc)
@@ -54,22 +55,17 @@
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_MSG_WARN([skipping test due to crosscompilation]))
+AC_MSG_CHECKING([if compiler sets exit status])
AC_TRY_RUN([
main()
{
int __something_strange_();
__something_strange_(0);
}
-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
+],AC_MSG_ERROR(Your compiler does not set the exit status - sorry),,
+AC_MSG_WARN(skipping test due to crosscompilation))
AC_PROG_AWK
@@ -103,6 +99,7 @@
dnl
dnl **** special unix variants ****
dnl
+AH_TEMPLATE(ISC,[])
if test -n "$ISC"; then
AC_DEFINE(ISC) LIBS="$LIBS -linet"
fi
@@ -114,11 +111,13 @@
dnl fi
dnl fi
+AH_TEMPLATE([sysV68],[])
if test -f /sysV68 ; then
AC_DEFINE(sysV68)
fi
AC_CHECKING(for MIPS)
+AH_TEMPLATE([MIPS],[])
if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
oldlibs="$LIBS"
test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha.
@@ -132,6 +131,8 @@
AC_CHECKING(wait3)
AC_TRY_LINK(,[wait3();], ,
AC_CHECKING(wait2)
+AH_TEMPLATE([USE_WAIT2],[On RISCOS we prefer wait2() over wait3(). rouilj@sni-usa.com])
+dnl TODO(Hannes) shipped config.h.in wraps the define in #ifdef BSDWAIT
AC_TRY_LINK(,[wait2();],
dnl John Rouillard (rouilj@sni-usa.com):
dnl need -I/usr/include/bsd in RISCOS otherwise sockets are broken, no
@@ -154,9 +155,11 @@
oldlibs="$LIBS"
LIBS="$LIBS -lpyr"
AC_CHECKING(Pyramid OSX)
+AH_TEMPLATE([OSX], [Pyramid OSX])
AC_TRY_LINK(,[open_controlling_pty("")], AC_DEFINE(OSX), LIBS="$oldlibs")
fi
+AH_TEMPLATE([POSIX],[Define POSIX if your system supports IEEE Std 1003.1-1988 (POSIX).])
dnl ghazi@caip.rutgers.edu (Kaveh R. Ghazi):
dnl BBN butterfly is not POSIX, but a MACH BSD system.
dnl Do not define POSIX and TERMIO.
@@ -183,6 +186,7 @@
fi
AC_CHECKING(for System V)
+AH_TEMPLATE([SYSV], [Define SYSV if your machine is SYSV complient (Sys V, HPUX, A/UX)])
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <signal.h>
@@ -226,6 +230,9 @@
dnl
AC_CHECKING(BSD job jontrol)
+AH_TEMPLATE([BSDJOBS],
+[Define BSDJOBS if you have BSD-style job control (both process
+ groups and a tty that deals correctly with them)])
AC_TRY_LINK(
[#include <sys/types.h>
#include <sys/ioctl.h>
@@ -246,6 +253,10 @@
dnl **** setreuid(), seteuid() ****
dnl
AC_CHECKING(setreuid)
+AH_TEMPLATE([HAVE_SETREUID],
+[If your system has the calls setreuid() and setregid(),
+ define HAVE_SETREUID. Otherwise screen will use a forked process to
+ safely create output files without retaining any special privileges.])
AC_TRY_LINK(,[
#ifdef __hpux
setresuid(0, 0, 0);
@@ -260,6 +271,9 @@
dnl Solaris seteuid doesn't change the saved uid, bad for
dnl multiuser screen sessions
AC_CHECKING(seteuid)
+AH_TEMPLATE([HAVE_SETEUID],
+[If your system supports BSD4.4's seteuid() and setegid(), define
+ HAVE_SETEUID.])
AC_TRY_LINK(,[
#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
seteuid_is_broken(0);
@@ -284,6 +298,8 @@
dnl
AC_CHECKING(fifos)
+AC_CACHE_CHECK([usable fifos],
+ [screen_cv_sys_fifo_usable],
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
@@ -348,12 +364,15 @@
exit(1);
exit(0);
}
-], AC_NOTE(- your fifos are usable) fifo=1,
-AC_NOTE(- your fifos are not usable))
+], screen_cv_sys_fifo_usable=yes, screen_cv_sys_fifo_usable=no))
rm -f /tmp/conftest*
-if test -n "$fifo"; then
-AC_CHECKING(for broken fifo implementation)
+if test X"$screen_cv_sys_fifo_usable" = Xyes; then
+AH_TEMPLATE([BROKEN_PIPE],
+[Define this if your system exits select() immediatly if a pipe is
+ opened read-only and no writer has opened it.])
+AC_CACHE_CHECK([broken fifo implementation],
+ [screen_cv_sys_fifo_broken_impl],
AC_TRY_RUN([
#include <sys/types.h>
#include <fcntl.h>
@@ -398,9 +416,12 @@
exit(1);
exit(0);
}
-], AC_NOTE(- your implementation is ok),
-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
+], screen_cv_sys_fifo_broken_impl=no,
+screen_cv_sys_fifo_broken_impl=yes))
+if test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then
+ AC_DEFINE(BROKEN_PIPE)
+fi
rm -f /tmp/conftest*
fi
dnl
@@ -410,6 +430,8 @@
dnl
AC_CHECKING(sockets)
+AC_CACHE_CHECK([sockets are usable],
+ [screen_cv_sys_sockets_usable],
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
@@ -460,12 +482,16 @@
exit(1);
exit(0);
}
-], AC_NOTE(- your sockets are usable) sock=1,
-AC_NOTE(- your sockets are not usable))
-rm -f /tmp/conftest*
+], screen_cv_sys_sockets_usable=yes,
+screen_cv_sys_sockets_usable=no))
-if test -n "$sock"; then
+if test X"$screen_cv_sys_sockets_usable" = Xyes; then
AC_CHECKING(socket implementation)
+AH_TEMPLATE([SOCK_NOT_IN_FS],
+[Define this if the unix-domain socket implementation doesn't
+ create a socket in the filesystem.])
+AC_CACHE_CHECK([if sockets are not stored in the filesystem],
+ [screen_cv_sys_sockets_nofs],
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
@@ -491,22 +517,25 @@
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*
+], screen_cv_sys_sockets_nofs=no,
+screen_cv_sys_sockets_nofs=yes))
+
+if test X"$screen_cv_sys_sockets_nofs" = Xyes; then
+ AC_DEFINE(SOCK_NOT_IN_FS)
+fi
fi
dnl
dnl **** choose sockets or fifos ****
dnl
-if test -n "$fifo"; then
- if test -n "$sock"; then
- if test -n "$nore"; then
+AH_TEMPLATE([NAMEDPIPE], [Define this if your system supports named pipes.])
+if test X"$screen_cv_sys_fifo_usable" = Xyes; then
+ if test X"$screen_cv_sys_sockets_usable" = Xyes; then
+ if test X"$screen_cv_sys_sockets_nofs" = Xyes; then
AC_NOTE(- hmmm... better take the fifos)
AC_DEFINE(NAMEDPIPE)
- elif test -n "$fifobr"; then
+ elif test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then
AC_NOTE(- as your fifos are broken lets use the sockets.)
else
AC_NOTE(- both sockets and fifos usable. let's take fifos.)
@@ -516,7 +545,7 @@
AC_NOTE(- using named pipes, of course)
AC_DEFINE(NAMEDPIPE)
fi
-elif test -n "$sock"; then
+elif test X"$screen_cv_sys_sockets_usable" = Xyes; then
AC_NOTE(- using unix-domain sockets, of course)
else
AC_MSG_ERROR(you have neither usable sockets nor usable pipes -> no screen)
@@ -526,7 +555,11 @@
dnl **** check the select implementation ****
dnl
-AC_CHECKING(select return value)
+AH_TEMPLATE([SELECT_BROKEN],
+[If the select return value doesn't treat a descriptor that is
+ usable for reading and writing as two hits, define SELECT_BROKEN.])
+AC_CACHE_CHECK([for broken select return value],
+ [screen_cv_sys_select_broken_retval],
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
@@ -625,17 +658,26 @@
exit(1);
exit(0);
}
-],AC_NOTE(- select is ok),
-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
+], screen_cv_sys_select_broken_retval=no,
+screen_cv_sys_select_broken_retval=yes))
+if test X"$screen_cv_sys_select_broken_retval" = Xyes; then
+ AC_DEFINE(SELECT_BROKEN)
+fi
dnl
dnl **** termcap or terminfo ****
dnl
+AH_TEMPLATE([TERMINFO],
+[Define TERMINFO if your machine emulates the termcap routines
+ with the terminfo database.
+ Thus the .screenrc file is parsed for
+ the command 'terminfo' and not 'termcap'])
+
AC_CHECKING(for tgetent)
AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
olibs="$LIBS"
-LIBS="-lcurses $olibs"
AC_CHECKING(libcurses)
+AC_CHECK_LIB(ncursesw,tgetent)
AC_TRY_LINK(,[
#ifdef __hpux
__sorry_hpux_libcurses_is_totally_broken_in_10_10();
@@ -654,24 +696,39 @@
AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
AC_MSG_ERROR(!!! no tgetent - no screen))))))
-AC_TRY_RUN([
+AC_CACHE_CHECK([using terminfo database],[screen_cv_sys_terminfo_used],
+ 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))
+}
+ ], screen_cv_sys_terminfo_used=no,
+ screen_cv_sys_terminfo_used=yes)
+)
+
+if test X"$screen_cv_sys_terminfo_used" = Xyes; then
+ AC_DEFINE(TERMINFO)
+fi
+
AC_CHECKING(ospeed)
+AH_TEMPLATE([NEED_OSPEED],[If your library does not define ospeed, define this.])
AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
dnl
dnl **** PTY specific things ****
dnl
+AH_TEMPLATE([HAVE_DEV_PTC],
+[define HAVE_DEV_PTC if you have a /dev/ptc character special
+ device.])
AC_CHECKING(for /dev/ptc)
if test -r /dev/ptc; then
AC_DEFINE(HAVE_DEV_PTC)
fi
AC_CHECKING(for SVR4 ptys)
+AH_TEMPLATE([HAVE_SVR4_PTYS],
+[define HAVE_SVR4_PTYS if you have a /dev/ptmx character special
+ device and support the ptsname(), grantpt(), unlockpt() functions.])
sysvr4ptys=
if test -c /dev/ptmx ; then
AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
@@ -687,6 +744,13 @@
fi
AC_CHECKING(for ptyranges)
+AH_TEMPLATE([PTYRANGE0],
+[define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen
+ to unusual environments. E.g. For SunOs the defaults are "qpr" and
+ "0123456789abcdef". For SunOs 4.1.2
+ #define PTYRANGE0 "pqrstuvwxyzPQRST"
+ is recommended by Dan Jacobson.])
+AH_TEMPLATE([PTYRANGE1],[])
if test -d /dev/ptym ; then
pdir='/dev/ptym'
else
@@ -850,20 +914,39 @@
dnl
dnl **** loadav ****
dnl
+
+AH_TEMPLATE([LOADAV],
+[If you want the "time" command to display the current load average
+ define LOADAV. Maybe you must install screen with the needed
+ privileges to read /dev/kmem.
+ Note that NLIST_ stuff is only checked, when getloadavg() is not available.
+])
+AH_TEMPLATE([LOADAV_NUM])
+AH_TEMPLATE([LOADAV_TYPE])
+AH_TEMPLATE([LOADAV_SCALE])
+AH_TEMPLATE([LOADAV_GETLOADAVG])
+AH_TEMPLATE([LOADAV_UNIX])
+AH_TEMPLATE([LOADAV_AVENRUN])
+AH_TEMPLATE([LOADAV_USE_NLIST64])
+
+AH_TEMPLATE([NLIST_DECLARED])
+AH_TEMPLATE([NLIST_STRUCT])
+AH_TEMPLATE([NLIST_NAME_UNION])
+
AC_CHECKING(for libutil(s))
-test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
-test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
+dnl I have no idea whether "login" is an appropriate symbol to check for here - Hannes
+AC_CHECK_LIB(utils,login)
+AC_CHECK_LIB(util,login)
AC_CHECKING(getloadavg)
AC_TRY_LINK(,[getloadavg((double *)0, 0);],
AC_DEFINE(LOADAV_GETLOADAVG) load=1,
-if test -f /usr/lib/libkvm.a ; then
olibs="$LIBS"
-LIBS="$LIBS -lkvm"
+AC_CHECK_LIB(kvm,kvm_open,
AC_CHECKING(getloadavg with -lkvm)
AC_TRY_LINK(,[getloadavg((double *)0, 0);],
AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
-fi
+)
)
if test -z "$load" ; then
@@ -1005,6 +1088,11 @@
dnl
dnl **** signal handling ****
dnl
+
+AH_TEMPLATE([SIGVOID],
+[Define SIGVOID if your signal handlers return void. On older
+ systems, signal returns int, but on newer ones, it returns void.])
+
if test -n "$posix" ; then
dnl POSIX has reliable signals with void return type.
@@ -1014,6 +1102,7 @@
else
AC_CHECKING(return type of signal handlers)
+AH_TEMPLATE([USESIGSET], [Define USESIGSET if you have sigset for BSD 4.1 reliable signals.])
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <signal.h>
@@ -1033,6 +1122,9 @@
#endif
], AC_DEFINE(USESIGSET))
AC_CHECKING(signal implementation)
+AH_TEMPLATE([SYSVSIGS],
+[Define SYSVSIGS if signal handlers must be reinstalled after
+ they have been called.])
AC_TRY_RUN([
#include <sys/types.h>
#include <signal.h>
@@ -1075,13 +1167,14 @@
dnl
AC_CHECKING(for crypt and sec libraries)
-test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
+dnl I have no idea whether "crypt" is an appropriate symbol to check for here - Hannes
+AC_CHECK_LIB(crypt_d,crypt)
oldlibs="$LIBS"
-LIBS="$LIBS -lcrypt"
AC_CHECKING(crypt)
AC_TRY_LINK(,,,LIBS="$oldlibs")
-test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
-test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
+AC_CHECK_LIB(crypt,crypt)
+AC_CHECK_LIB(sec,crypt)
+AC_CHECK_LIB(shadow,getspnam)
oldlibs="$LIBS"
LIBS="$LIBS -lsun"
AC_CHECKING(IRIX sun library)
@@ -1104,6 +1197,13 @@
dnl **** misc things ****
dnl
AC_CHECKING(wait union)
+AH_TEMPLATE([BSDWAIT],
+[Define BSDWAIT if your system defines a 'union wait' in <sys/wait.h>
+
+ Only allow BSDWAIT i.e. wait3 on nonposix systems, since
+ posix implies wait(3) and waitpid(3). vdlinden@fwi.uva.nl
+ TODO(Hannes) shipped config.h.in does that with a #ifdef
+])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/wait.h>
],[
@@ -1114,6 +1214,13 @@
#endif
],AC_DEFINE(BSDWAIT))
+AH_TEMPLATE([TERMIO],
+[Define TERMIO if you have struct termio instead of struct sgttyb.
+ This is usually the case for SVID systems, where BSD uses sgttyb.
+ POSIX systems should define this anyway, even though they use
+ struct termios.])
+
+
if test -z "$butterfly"; then
AC_CHECKING(for termio or termios)
AC_TRY_CPP([#include <termio.h>], AC_DEFINE(TERMIO),
@@ -1123,17 +1230,35 @@
)
fi
+AH_TEMPLATE([CYTERMIO], [Define CYTERMIO if you have cyrillic termio modes.])
+
dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
AC_CHECKING(getspnam)
+AH_TEMPLATE([SHADOWPW],
+[If the passwords are stored in a shadow file and you want the
+ builtin lock to work properly, define SHADOWPW.])
AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
AC_CHECKING(getttyent)
+AH_TEMPLATE([GETTTYENT],
+[If your system has the new format /etc/ttys (like 4.3 BSD) and the
+ getttyent(3) library functions, define GETTTYENT.])
AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
AC_CHECKING(fdwalk)
+AH_TEMPLATE([HAVE_FDWALK],
+[Newer versions of Solaris include fdwalk, which can greatly improve
+ the startup time of screen; otherwise screen spends a lot of time
+ closing file descriptors.])
AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
-AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
+AH_TEMPLATE([USEBCOPY],
+[Define USEBCOPY if the bcopy/memcpy from your system's C library
+ supports the overlapping of source and destination blocks. When
+ undefined, screen uses its own (probably slower) version of bcopy().])
+
+AC_CACHE_CHECK([if bcopy handles overlap],
+ [screen_cv_sys_bcopy_overlap],
AC_TRY_RUN([
main() {
char buf[10];
@@ -1146,7 +1271,21 @@
if (strncmp(buf, "cdedef", 6))
exit(1);
exit(0); /* libc version works properly. */
-}], AC_DEFINE(USEBCOPY))
+}], screen_cv_sys_bcopy_overlap=yes,
+screen_cv_sys_bcopy_overlap=no))
+if test X"$screen_cv_sys_bcopy_overlap" = Xyes; then
+ AC_DEFINE(USEBCOPY)
+fi
+
+AH_TEMPLATE([USEMEMMOVE],
+[SYSV machines may have a working memcpy() -- Oh, this is
+ quite unlikely. Tell me if you see one.
+ "But then, memmove() should work, if at all available" he thought...
+ Boing, never say "works everywhere" unless you checked SCO UNIX.
+ Their memove fails the test in the configure script. Sigh. (Juergen)
+])
+AC_CACHE_CHECK([if memmove handles overlap],
+ [screen_cv_sys_memmove_overlap],
AC_TRY_RUN([
#define bcopy(s,d,l) memmove(d,s,l)
@@ -1161,9 +1300,15 @@
if (strncmp(buf, "cdedef", 6))
exit(1);
exit(0); /* libc version works properly. */
-}], AC_DEFINE(USEMEMMOVE))
-
+}], screen_cv_sys_memmove_overlap=yes,
+screen_cv_sys_memmove_overlap=no))
+if test X"$screen_cv_sys_memmove_overlap" = Xyes; then
+ AC_DEFINE(USEMEMMOVE)
+fi
+AH_TEMPLATE([USEMEMCPY],[])
+AC_CACHE_CHECK([if memcpy handles overlap],
+ [screen_cv_sys_memcpy_overlap],
AC_TRY_RUN([
#define bcopy(s,d,l) memcpy(d,s,l)
main() {
@@ -1177,9 +1322,19 @@
if (strncmp(buf, "cdedef", 6))
exit(1);
exit(0); /* libc version works properly. */
-}], AC_DEFINE(USEMEMCPY))
+}], screen_cv_sys_memcpy_overlap=yes,
+screen_cv_sys_memcpy_overlap=no))
+if test X"$screen_cv_sys_memcpy_overlap" = Xyes; then
+ AC_DEFINE(USEMEMCPY)
+fi
AC_MSG_CHECKING(long file names)
+AH_TEMPLATE([NAME_MAX],
+[If you are on a SYS V machine that restricts filename length to 14
+ characters, you may need to enforce that by setting NAME_MAX to 14])
+dnl TODO(Hannes) shipped config.h.in has
+dnl #undef NAME_MAX /* KEEP_UNDEF_HERE override system value */
+dnl ahead of this
(echo 1 > /tmp/conftest9012345) 2>/dev/null
(echo 2 > /tmp/conftest9012346) 2>/dev/null
val=`cat /tmp/conftest9012345 2>/dev/null`
@@ -1192,6 +1347,10 @@
rm -f /tmp/conftest*
AC_MSG_CHECKING(for vsprintf)
+AH_TEMPLATE([USEVARARGS],
+[If your system has vsprintf() and requires the use of the macros in
+ "varargs.h" to use functions with variable arguments,
+ define USEVARARGS.])
AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);],
[AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS)],
[AC_MSG_RESULT(no)])
@@ -1199,12 +1358,19 @@
AC_HEADER_DIRENT
AC_MSG_CHECKING(for setenv)
+AH_TEMPLATE([USESETENV], [If your system has setenv() and unsetenv() define USESETENV])
AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV),
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for putenv)
+AH_TEMPLATE([NEEDPUTENV],
+[If your system does not come with a setenv()/putenv()/getenv()
+ functions, you may bring in our own code by defining NEEDPUTENV.])
AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV)
))
AC_MSG_CHECKING([for nl_langinfo(CODESET)])
+AH_TEMPLATE([HAVE_NL_LANGINFO],
+[define HAVE_NL_LANGINFO if your system has the nl_langinfo() call
+ and <langinfo.h> defines CODESET.])
AC_TRY_LINK([
#include <langinfo.h>
],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NL_LANGINFO), AC_MSG_RESULT(no))
@@ -1254,7 +1420,8 @@
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.))
+AC_MSG_CHECKING(compiler sanity)
+AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.), AC_MSG_WARN(Skipping test due to crosscompilation))
ETCSCREENRC="\"/usr/local/etc/screenrc\""
if test -n "$prefix"; then

View File

@ -0,0 +1,79 @@
--- configure.in.DIST 2006-10-31 21:39:07.010473000 -0800
+++ configure.in 2006-10-31 21:43:05.630162000 -0800
@@ -1211,15 +1211,32 @@
AC_HEADER_DIRENT
AC_MSG_CHECKING(for setenv)
-AH_TEMPLATE([USESETENV], [If your system has setenv() and unsetenv() define USESETENV])
-AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV),
-AC_MSG_RESULT(no)
-AC_MSG_CHECKING(for putenv)
-AH_TEMPLATE([NEEDPUTENV],
-[If your system does not come with a setenv()/putenv()/getenv()
- functions, you may bring in our own code by defining NEEDPUTENV.])
-AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV)
-))
+if test -z "$ac_setenv_args"; then
+ AC_TRY_LINK(
+ [#include <stdlib.h>],
+ [
+ setenv((char *) 0, (char *) 0, 0);
+ ], ac_setenv_args=3)
+fi
+if test -z "$ac_setenv_args"; then
+ AC_TRY_LINK(
+ [#include <stdlib.h>],
+ [
+ setenv((char *) 0, (char *) 0);
+ ], ac_setenv_args=2)
+fi
+if test -n "$ac_setenv_args"; then
+ AC_DEFINE(USESETENV)
+ if test "$ac_setenv_args" = 3; then
+ AC_DEFINE(HAVE_SETENV_3)
+ elif test "$ac_setenv_args" = 2; then
+ AC_DEFINE(HAVE_SETENV_2)
+ fi
+else
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(for putenv)
+ AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV))
+fi
AC_MSG_CHECKING([for nl_langinfo(CODESET)])
AH_TEMPLATE([HAVE_NL_LANGINFO],
[define HAVE_NL_LANGINFO if your system has the nl_langinfo() call
--- config.h.in.DIST 2006-10-31 21:43:23.233714000 -0800
+++ config.h.in 2006-10-31 21:44:27.346275000 -0800
@@ -548,6 +548,16 @@
#undef USESETENV
/*
+ * If setenv() takes 3 arguments define HAVE_SETENV_3
+ */
+#undef HAVE_SETENV_3
+
+/*
+ * If setenv() takes 2 arguments define HAVE_SETENV_2
+ */
+#undef HAVE_SETENV_2
+
+/*
* If your system does not come with a setenv()/putenv()/getenv()
* functions, you may bring in our own code by defining NEEDPUTENV.
*/
--- misc.c.DIST 2006-10-31 20:55:42.481760000 -0800
+++ misc.c 2006-10-31 21:53:24.143551000 -0800
@@ -613,11 +613,11 @@
*/
# endif /* NEEDSETENV */
#else /* USESETENV */
-# if defined(linux) || defined(__convex__) || (BSD >= 199103)
+# if HAVE_SETENV_3
setenv(var, value, 1);
# else
setenv(var, value);
-# endif /* linux || convex || BSD >= 199103 */
+# endif /* HAVE_SETENV_3 */
#endif /* USESETENV */
}

View File

@ -0,0 +1,356 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# /etc/screenrc
#
# This is the system wide screenrc.
#
# You can use this file to change the default behavior of screen system wide
# or copy it to ~/.screenrc and use it as a starting point for your own
# settings.
#
# Commands in this file are used to set options, bind screen functions to
# keys, redefine terminal capabilities, and to automatically establish one or
# more windows at the beginning of your screen session.
#
# This is not a comprehensive list of options, look at the screen manual for
# details on everything that you can put in this file.
#
#
# ==============================================================================
# SCREEN SETTINGS
# ==============================================================================
# ESCAPE - the COMMAND CHARACTER
# ===============================================================
# escape ^aa # default
# escape ^^^^ # suggested binding (Control-^) for Emacs users
# PASSWORD
# ===============================================================
# This commands sets the *internal* password for the screen session.
# WARNING!! If this is set then a "lock" command will only let you in to the
# session after you enter the user's account password and then *also*
# the internal password for that session. This gives additional safety but,
# if you forget the internal password then you cannot resume your session.
# Use :password to generate a password
# password ODSJQf.4IJN7E # "1234"
# VARIABLES
# ===============================================================
# No annoying audible bell, using "visual bell"
# vbell on # default: off
# vbell_msg " -- Bell,Bell!! -- " # default: "Wuff,Wuff!!"
# Automatically detach on hangup.
autodetach on # default: on
# Don't display the copyright page
startup_message off # default: on
# Uses nethack-style messages
# nethack on # default: off
# Affects the copying of text regions
crlf off # default: off
# Enable/disable multiuser mode. Standard screen operation is singleuser.
# In multiuser mode the commands acladd, aclchg, aclgrp and acldel can be used
# to enable (and disable) other user accessing this screen session.
# Requires suid-root.
multiuser off
# Change default scrollback value for new windows
defscrollback 1000 # default: 100
# Define the time that all windows monitored for silence should
# wait before displaying a message. Default 30 seconds.
silencewait 15 # default: 30
# bufferfile: The file to use for commands
# "readbuf" ('<') and "writebuf" ('>'):
bufferfile $HOME/.screen_exchange
#
# hardcopydir: The directory which contains all hardcopies.
# hardcopydir ~/.hardcopy
# hardcopydir ~/.screen
#
# shell: Default process started in screen's windows.
# Makes it possible to use a different shell inside screen
# than is set as the default login shell.
# If begins with a '-' character, the shell will be started as a login shell.
# shell zsh
# shell bash
# shell ksh
shell -$SHELL
# shellaka '> |tcsh'
# shelltitle '$ |bash'
# emulate .logout message
pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
# caption always " %w --- %c:%s"
# caption always "%3n %t%? @%u%?%? [%h]%?%=%c"
# advertise hardstatus support to $TERMCAP
# termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
# set every new windows hardstatus line to somenthing descriptive
# defhstatus "screen: ^En (^Et)"
# don't kill window after the process died
# zombie "^["
# ignore displays that block on output
defnonblock on
# XTERM TWEAKS
# ===============================================================
# xterm understands both im/ic and doesn't have a status line.
# Note: Do not specify im and ic in the real termcap/info file as
# some programs (e.g. vi) will not work anymore.
termcap xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
# 80/132 column switching must be enabled for ^AW to work
# change init sequence to not switch width
termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l
# Make the output buffer large for (fast) xterms.
# termcapinfo xterm* OL=10000
termcapinfo xterm* OL=100
# tell screen that xterm can switch to dark background and has function
# keys.
termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l'
termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
# special xterm hardstatus: use the window title.
termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
#terminfo xterm 'vb=\E[?5h$<200/>\E[?5l'
termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l'
# emulate part of the 'K' charset
termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
# xterm-52 tweaks:
# - uses background color for delete operations
termcapinfo xterm* be
# Do not use xterm's alternative window buffer, it breaks scrollback (see bug #61195)
termcapinfo xterm|xterms|xs ti@:te=\E[2J
# WYSE TERMINALS
# ===============================================================
#wyse-75-42 must have flow control (xo = "terminal uses xon/xoff")
#essential to have it here, as this is a slow terminal.
termcapinfo wy75-42 xo:hs@
# New termcap sequences for cursor application mode.
termcapinfo wy* CS=\E[?1h:CE=\E[?1l:vi=\E[?25l:ve=\E[?25h:VR=\E[?5h:VN=\E[?5l:cb=\E[1K:CD=\E[1J
# OTHER TERMINALS
# ===============================================================
# make hp700 termcap/info better
termcapinfo hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
# Extend the vt100 desciption by some sequences.
termcap vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC
termcapinfo linux C8
# old rxvt versions also need this
# termcapinfo rxvt C8
# KEYBINDINGS
# ==============================================================
# The "bind" command assign keys to (internal) commands
# SCREEN checks all the keys you type; you type the key
# which is known as the "command character" then SCREEN
# eats this key, too, and checks whether this key is
# "bound" to a command. If so then SCREEN will execute it.
#
# The command "bind" allows you to chose which keys
# will be assigned to the commands.
#
# Some commands are bound to several keys -
# usually to both some letter and its corresponding
# control key combination, eg the command
# "(create) screen" is bound to both 'c' and '^C'.
#
# The following list shows the default bindings:
#
# break ^B b
# clear C
# colon :
# copy ^[ [
# detach ^D d
# digraph ^V
# displays *
# dumptermcap .
# fit F
# flow ^F f
# focus ^I
# hardcopy h
# help ?
# history { }
# info i
# kill K k
# lastmsg ^M m
# license ,
# log H
# login L
# meta x
# monitor M
# next ^@ ^N sp n
# number N
# only Q
# other ^X
# pow_break B
# pow_detach D
# prev ^H ^P p ^?
# quit \
# readbuf <
# redisplay ^L l
# remove X
# removebuf =
# reset Z
# screen ^C c
# select " '
# silence _
# split S
# suspend ^Z z
# time ^T t
# title A
# vbell ^G
# version v
# width W
# windows ^W w
# wrap ^R r
# writebuf >
# xoff ^S s
# xon ^Q q
# ^] paste .
# - select -
# 0 select 0
# 1 select 1
# 2 select 2
# 3 select 3
# 4 select 4
# 5 select 5
# 6 select 6
# 7 select 7
# 8 select 8
# 9 select 9
# I login on
# O login off
# ] paste .
#
# And here are the default bind commands if you need them:
#
# bind A title
# bind C clear
# bind D pow_detach
# bind F fit
# bind H log
# bind I login on
# bind K kill
# bind L login
# bind M monitor
# bind N number
# bind O login off
# bind Q only
# bind S split
# bind W width
# bind X remove
# bind Z reset
# Let's remove some dangerous key bindings ...
bind k
bind ^k
# bind . dumptermcap # default
bind .
# bind ^\ quit # default
bind ^\
# bind \\ quit # default
bind \\
# bind ^h ??? # default
bind ^h
# bind h hardcopy # default
bind h
# ... and make them better.
bind 'K' kill
bind 'I' login on
bind 'O' login off
bind '}' history
# Yet another hack:
# Prepend/append register [/] to the paste if ^a^] is pressed.
# This lets me have autoindent mode in vi.
register [ "\033:se noai\015a"
register ] "\033:se ai\015a"
bind ^] paste [.]
# hardstatus alwaysignore
# hardstatus alwayslastline "%Lw"
# Resize the current region. The space will be removed from or added to
# the region below or if there's not enough space from the region above.
bind = resize =
bind + resize +3
bind - resize -3
# bind _ resize max
#
# attrcolor u "-u b"
# attrcolor b "R"
# STARTUP SCREENS
# ===============================================================
# Defines the time screen delays a new message when one message
# is currently displayed. The default is 1 second.
# msgminwait 2
# Time a message is displayed if screen is not disturbed by
# other activity. The dafault is 5 seconds:
# msgwait 2
# Briefly show the version number of this starting
# screen session - but only for *one* second:
# msgwait 1
# version
# Welcome the user:
# echo "welcome :-)"
# echo "I love you today."
# Uncomment one/some following lines to automatically let
# SCREEN start some programs in the given window numbers:
# screen -t MAIL 0 mutt
# screen -t EDIT 1 vim
# screen -t GOOGLE 2 links http://www.google.com
# screen -t NEWS 3 slrn
# screen -t WWW 4 links http://www.math.fu-berlin.de/~guckes/
# screen 5
# screen 6
# Set the environment variable var to value string. If only var is specified,
# you'll be prompted to enter a value. If no parameters are specified,
# you'll be prompted for both variable and value. The environment is
# inherited by all subsequently forked shells.
# setenv PROMPT_COMMAND 'echo -n -e "\033k\033\134"'
# Don't you want to start programs which need a DISPLAY ?
# setenv DISPLAY ''

View File

@ -0,0 +1,166 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/screen/screen-4.0.3-r4.ebuild,v 1.8 2011/07/15 14:31:00 xarthisius Exp $
EAPI="3"
WANT_AUTOCONF="2.5"
inherit eutils flag-o-matic toolchain-funcs pam autotools
DESCRIPTION="Full-screen window manager that multiplexes physical terminals between several processes"
HOMEPAGE="http://www.gnu.org/software/screen/"
SRC_URI="ftp://ftp.uni-erlangen.de/pub/utilities/${PN}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~hppa-hpux ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="debug nethack pam selinux multiuser"
RDEPEND=">=sys-libs/ncurses-5.2
pam? ( virtual/pam )
selinux? ( sec-policy/selinux-screen )"
DEPEND="${RDEPEND}"
pkg_setup() {
# Make sure utmp group exists, as it's used later on.
enewgroup utmp 406
}
src_prepare() {
# Bug 34599: integer overflow in 4.0.1
# (Nov 29 2003 -solar)
epatch "${FILESDIR}"/screen-4.0.1-int-overflow-fix.patch
# Bug 31070: configure problem which affects alpha
# (13 Jan 2004 agriffis)
epatch "${FILESDIR}"/screen-4.0.1-vsprintf.patch
# uclibc doesnt have sys/stropts.h
if ! (echo '#include <sys/stropts.h>' | $(tc-getCC) -E - &>/dev/null) ; then
epatch "${FILESDIR}"/4.0.2-no-pty.patch
fi
# Don't use utempter even if it is found on the system
epatch "${FILESDIR}"/4.0.2-no-utempter.patch
# Don't link against libelf even if it is found on the system
epatch "${FILESDIR}"/4.0.2-no-libelf.patch
# Patch for time function on 64bit systems
epatch "${FILESDIR}"/4.0.2-64bit-time.patch
# Patch that makes %u work for windowlist -b formats
epatch "${FILESDIR}"/4.0.2-windowlist-multiuser-fix.patch
# Open tty in non-blocking mode
epatch "${FILESDIR}"/4.0.2-nonblock.patch
# compability for sys-devel/autoconf-2.62
epatch "${FILESDIR}"/screen-4.0.3-config.h-autoconf-2.62.patch
# crosscompile patch
epatch "${FILESDIR}"/"${P}"-crosscompile.patch
# sched.h is a system header and causes problems with some C libraries
mv sched.h _sched.h || die
sed -i '/include/s:sched.h:_sched.h:' screen.h || die
# Allow for more rendition (color/attribute) changes in status bars
sed -i \
-e "s:#define MAX_WINMSG_REND 16:#define MAX_WINMSG_REND 64:" \
screen.c \
|| die "sed screen.c failed"
# Fix manpage.
sed -i \
-e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
-e "s:/usr/local/screens:${EPREFIX}/var/run/screen:g" \
-e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
-e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
-e "s:/local/screens/S-:${EPREFIX}/var/run/screen/S-:g" \
doc/screen.1 \
|| die "sed doc/screen.1 failed"
# proper setenv detection for Solaris
epatch "${FILESDIR}"/${P}-setenv_autoconf.patch
# Allow TERM string large enough to use with rxvt-unicode-256color
# Allow usernames up to 32 chars
epatch "${FILESDIR}"/${PV}-extend-d_termname-ng2.patch
# reconfigure
eautoconf
}
src_configure() {
append-flags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"
[[ ${CHOST} == *-solaris* ]] && append-libs -lsocket -lnsl
use nethack || append-flags "-DNONETHACK"
use debug && append-flags "-DDEBUG"
econf \
--with-socket-dir="${EPREFIX}/var/run/screen" \
--with-sys-screenrc="${EPREFIX}/etc/screenrc" \
--with-pty-mode=0620 \
--with-pty-group=5 \
--enable-rxvt_osc \
--enable-telnet \
--enable-colors256 \
$(use_enable pam) \
|| die "econf failed"
# Second try to fix bug 12683, this time without changing term.h
# The last try seemed to break screen at run-time.
# (16 Jan 2003 agriffis)
LC_ALL=POSIX make term.h || die "Failed making term.h"
}
src_install() {
dobin screen || die "dobin failed"
keepdir /var/run/screen || die "keepdir failed"
if use multiuser || use prefix
then
fperms 4755 /usr/bin/screen || die "fperms failed"
else
fowners root:utmp /{usr/bin,var/run}/screen \
|| die "fowners failed, use multiuser USE-flag instead"
fperms 2755 /usr/bin/screen || die "fperms failed"
fi
insinto /usr/share/screen
doins terminfo/{screencap,screeninfo.src} || die "doins failed"
insinto /usr/share/screen/utf8encodings
doins utf8encodings/?? || die "doins failed"
insinto /etc
doins "${FILESDIR}"/screenrc || die "doins failed"
pamd_mimic_system screen auth || die "pamd_mimic_system failed"
dodoc \
README ChangeLog INSTALL TODO NEWS* patchlevel.h \
doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps} \
|| die "dodoc failed"
doman doc/screen.1 || die "doman failed"
doinfo doc/screen.info* || die "doinfo failed"
}
pkg_postinst() {
if use prefix; then
chmod 0777 "${EROOT}"/var/run/screen
elif use multiuser; then
chown root:0 "${EROOT}"/var/run/screen
chmod 0755 "${EROOT}"/var/run/screen
else
chown root:utmp "${EROOT}"/var/run/screen
chmod 0775 "${EROOT}"/var/run/screen
fi
elog "Some dangerous key bindings have been removed or changed to more safe values."
elog "We enable some xterm hacks in our default screenrc, which might break some"
elog "applications. Please check /etc/screenrc for information on these changes."
}

View File

@ -0,0 +1,13 @@
DEFINED_PHASES=configure install postinst prepare setup
DEPEND=>=sys-libs/ncurses-5.2 pam? ( virtual/pam ) selinux? ( sec-policy/selinux-screen ) || ( =sys-devel/automake-1.11* ) >=sys-devel/autoconf-2.61 sys-devel/libtool
DESCRIPTION=Full-screen window manager that multiplexes physical terminals between several processes
EAPI=3
HOMEPAGE=http://www.gnu.org/software/screen/
IUSE=debug nethack pam selinux multiuser
KEYWORDS=alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~hppa-hpux ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris
LICENSE=GPL-2
RDEPEND=>=sys-libs/ncurses-5.2 pam? ( virtual/pam ) selinux? ( sec-policy/selinux-screen )
SLOT=0
SRC_URI=ftp://ftp.uni-erlangen.de/pub/utilities/screen/screen-4.0.3.tar.gz
_eclasses_=autotools 63332a15502113ca711ccccb3889a109 eutils 33ef77a15337022e05342d2c772a7a5a flag-o-matic 01a8b1eb019305bc4b4a8bd0b04e4cd8 libtool 0fd90d183673bf1107465ec45849d1ea multilib 5f4ad6cf85e365e8f0c6050ddd21659e pam 3f746974e1cc47cabe3bd488c08cdc8e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 6526ac6fc9aedf391efb91fcd75ace68 user 9e552f935106ff0bc92af16da64b4b29
_md5_=a1c9d09a1f23751558d4361cd464184c