[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[screen-devel] automake patch 4
From: |
William Pursell |
Subject: |
[screen-devel] automake patch 4 |
Date: |
Mon, 06 Oct 2008 20:55:49 +0100 |
User-agent: |
Thunderbird 2.0.0.17 (Macintosh/20080914) |
--
William Pursell
>From 317eaf1b86bab1f837e9fd702925a389bb32bd0f Mon Sep 17 00:00:00 2001
From: William Pursell <address@hidden>
Date: Mon, 6 Oct 2008 20:25:11 +0100
Subject: [PATCH] Adding 3rd part of configure.ac
---
src/configure.ac | 250 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 250 insertions(+), 0 deletions(-)
diff --git a/src/configure.ac b/src/configure.ac
index 8dcb848..ed0c10e 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -748,3 +748,253 @@ main()
}
],[
if test -f conftest_grp; then
+ ptygrp=`cat conftest_grp`
+ AC_MSG_NOTICE([- pty mode: $ptymode, group: $ptygrp])
+ AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
+ AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
+ else
+ AC_MSG_NOTICE(- 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_MSG_NOTICE([- pty mode: $ptymode, group: $ptygrp])
+ AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
+ AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
+ else
+ AC_MSG_NOTICE(- ptys are world accessable)
+ fi
+ else
+ AC_MSG_NOTICE(- can't determine - assume ptys are world accessable)
+ fi
+ ]
+)
+rm -f conftest_grp
+fi
+
+dnl
+dnl **** utmp handling ****
+dnl
+AC_CHECKING(getutent)
+AC_TRY_LINK([
+#include <time.h> /* to get time_t on SCO */
+#include <sys/types.h>
+#if defined(SVR4) && !defined(DGUX)
+#include <utmpx.h>
+#define utmp utmpx
+#else
+#include <utmp.h>
+#endif
+#ifdef __hpux
+#define pututline _pututline
+#endif
+],
+[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();],
AC_DEFINE(GETUTENT),
+olibs="$LIBS"
+LIBS="$LIBS -lgen"
+AC_CHECKING(getutent with -lgen)
+AC_TRY_LINK([
+#include <time.h>
+#include <sys/types.h>
+#if defined(SVR4) && !defined(DGUX)
+#include <utmpx.h>
+#define utmp utmpx
+#else
+#include <utmp.h>
+#endif
+#ifdef __hpux
+#define pututline _pututline
+#endif
+],
+[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();],
AC_DEFINE(GETUTENT), LIBS="$olibs")
+)
+AC_CHECKING(ut_host)
+AC_TRY_COMPILE([
+#include <time.h>
+#include <sys/types.h>
+#if defined(SVR4) && !defined(DGUX)
+#include <utmpx.h>
+#define utmp utmpx
+#else
+#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 ****
+dnl
+AC_CHECKING(for libutil(s))
+test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
+test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
+
+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_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
+AC_EGREP_CPP(yes,
+[#if defined(NeXT) || defined(apollo) || defined(linux)
+ yes;
+#endif
+], load=1)
+fi
+if test -z "$load" ; then
+AC_CHECKING(for kernelfile)
+for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix
/kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do
+ if test -f $core || test -c $core; then
+ break
+ fi
+done
+if test ! -f $core && test ! -c $core ; then
+ AC_MSG_NOTICE(- no kernelfile found)
+else
+ AC_MSG_NOTICE(- using kernelfile '$core')
+ if test -r $core ; then
+ AC_DEFINE_UNQUOTED(LOADAV_UNIX,"$core")
+ AC_CHECK_HEADER(nlist.h,
+ [AC_DEFINE(NLIST_STRUCT)
+ AC_CHECKING(n_un in struct nlist)
+ AC_TRY_COMPILE([#include <nlist.h>],
+ [struct nlist n; n.n_un.n_name = 0;],
+ AC_DEFINE(NLIST_NAME_UNION))])
+
+ AC_CHECKING(for nlist declaration)
+ AC_EGREP_CPP([nlist(( | )( | )*.*\(|\()],[
+#ifdef NLIST_STRUCT
+# include <nlist.h>
+#else
+# include <a.out.h>
+#endif
+],AC_DEFINE(NLIST_DECLARED))
+
+ 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_MSG_NOTICE(- no avenrun symbol found)
+ else
+ AC_MSG_NOTICE(- using avenrun symbol '$avensym')
+ AC_DEFINE_UNQUOTED(LOADAV_AVENRUN,"$avensym")
+ if test -n "$nlist64"; then
+ AC_MSG_NOTICE(- used nlist64 to find it)
+ AC_DEFINE(LOADAV_USE_NLIST64)
+ fi
+ load=1
+ fi
+ else
+ AC_MSG_NOTICE( Can't configure the load average display feature)
+ AC_MSG_NOTICE( because $core is not readable by you.)
+ AC_MSG_NOTICE( To configure the load average display feature,)
+ AC_MSG_NOTICE( re-run configure as root if possible.)
+ AC_MSG_NOTICE( If you are not the system administrator then disregard)
+ AC_MSG_NOTICE( this warning. You can still use screen without)
+ AC_MSG_NOTICE( the load average display feature.)
+ fi
+fi
+fi
+
+AC_PROGRAM_SOURCE([
+#include <sys/types.h>
+#include <sys/param.h>
+],[
+#if !defined(LOADAV_GETLOADAVG) && ((defined(hp300) && !defined(__hpux)) ||
defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) ||
defined(sgi) || (defined(SVR4) && !defined(__hpux)) || defined(sony_news) ||
(!defined(__osf__) && defined(__alpha)) || defined(_IBMR2) ||
defined(_AUX_SOURCE) || defined(AUX) || defined(m88k))
+loadtype=long
+# if defined(apollo) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX)
+loadscale=65536
+# else
+# if defined(FSCALE) && !defined(__osf__)
+# undef FSCALE
+loadscale=FSCALE
+# else
+# ifdef sgi
+loadtype=int
+loadscale=1024
+# else
+# if defined(MIPS) || defined(SVR4) || defined(m88k)
+loadscale=256
+# else /* not MIPS */
+loadscale=1000 /* our default value */
+# endif /* MIPS */
+# endif /* sgi */
+# endif /* not FSCALE */
+# endif /* not apollo */
+#else
+loadtype=double
+loadscale=1
+#endif
+#ifdef alliant
+loadnum=4
+#else
+loadnum=3
+#endif
+])
+
+if test -n "$load" ; then AC_DEFINE(LOADAV) fi
--
1.6.0.2.GIT
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [screen-devel] automake patch 4,
William Pursell <=