home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-19 | 58.9 KB | 2,298 lines |
- Newsgroups: comp.sources.misc
- From: fitz@rpi.edu (Brian P. Fitzgerald)
- Subject: v41i039: rperf - performance monitoring of network hosts, v3.1, Part01/04
- Message-ID: <csm-v41i039=rperf.145038@sparky.Sterling.COM>
- X-Md4-Signature: 7146c8b9faaafb4cb378f269ebfbd1a9
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Rensselaer Polytechnic Institute, Troy NY
- Date: Sun, 19 Dec 1993 20:51:02 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: fitz@rpi.edu (Brian P. Fitzgerald)
- Posting-number: Volume 41, Issue 39
- Archive-name: rperf/part01
- Environment: UNIX
- Supersedes: rperf: Volume 39, Issue 69-71
-
- rperf is similar to xmeter, or SunView perfmeter, but is intended for
- use on ascii terminals or for logging. rperf obtains system statistics
- from one or more network hosts and prints them to the standard output
- at periodic intervals, in a format similar to rup, vmstat, and
- netstat. rperf reports on cpu load, disk activity, network interface
- activity, and virtual memory activity.
-
- If invoked as "rup", it prints the uptime and system load.
-
- New features:
- - work around bugs in some vendors' versions of rpc.rstatd
- - optional rstatd version selection
- - trim common suffix in hostname display
- - optional screen clear before each display
- - print '-' for unreported statistics
- - improved algorithms
- - many useful debug mode features
-
- This is a major release. Previous versions of rperf should be
- discarded.
-
- Building:
-
- Type "./configure", then "make".
-
- Running:
-
- Try "rperf" or "rperf <host>"
- Every monitored host must run rstatd. Check with:
- rpcinfo -u <host> rstatd
-
- Send bug reports and fixes to fitz@rpi.edu.
-
- Runs on 386BSD, Alliant, Amiga, BSDi, DEC, DG, ESIX, HP, IBM, IRIS,
- Linux, MIPS, Motorolla, NeXT, NetBSD, SCO, Sun.
-
- If it runs on your machine, please tell me!
-
- Brian
- ----
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. The tool that generated this
- # shell archive is called "shar", and is available by anonymous ftp
- # from ftp.uu.net in subdirectory /usenet/comp.sources.unix, and from many
- # other places. Check 'archie' for the latest locations. If this archive
- # is complete, you will see the following message at the end:
- # "End of archive 1 (of 4)."
- # Contents: README FAQ configure configure.in MANIFEST Makefile.in
- # rstat.x rstat.h term.h
- # Wrapped by fitzgb@mml0.meche.rpi.edu on Wed Dec 15 13:06:53 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(5921 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- Xrperf README file
- X----- ------ ----
- X
- XContents of this file:
- X DESCRIPTION
- X BUILDING
- X BUILDING HINTS
- X RUNNING
- X RUNNING HINTS
- X PROBLEMS WITH BROADCAST MODE
- X KNOWN PROBLEMS
- X BUG REPORTS
- X PLATFORMS SUPPORTED
- X
- XDESCRIPTION
- X-----------
- X
- Xrperf is similar to xmeter, or SunView perfmeter, but is intended for
- Xuse on ascii terminals or for logging. rperf obtains system statistics
- Xfrom one or more network hosts and prints them to the standard output
- Xat periodic intervals, in a format similar to rup, vmstat, and
- Xnetstat. rperf reports on cpu load, disk activity, network interface
- Xactivity, and virtual memory activity.
- X
- XIf installed as rup, the program prints the hostname, uptime, and load
- Xaverage once, then exits. A hard or symbolic link to rperf may be used
- Xfor the installation.
- X
- XBUILDING
- X--------
- X
- XType "./configure", then type "make".
- X
- XBUILDING HINTS
- X--------------
- X
- X- Copious syntax errors: you may need to force K&R style
- Xcompilation. In the Makefile, try modifying CFLAGS appropriately for
- Xyour compiler.
- X
- X- Configuration errors: If the sources do not compile, it may be
- Xbecause the configure script does not work on your machine. For
- Xexample, on ESIX, all configuration checks that involve using the
- Xcompiler and that are performed after the library checks are
- Xpotentially incorrect, and manual editing of the Makefile is required.
- X
- X- on many systems, the symbols _xdr_* and _clnt_* are defined in
- Xthe C library. On other systems, the needed objects are in other
- Xlibraries, and must be specified on the link command line.
- X
- X- If the symbols are not defined in any library on your system, you
- Xcan obtain the RPC library by anonymous ftp from wuarchive.wustl.edu in
- X/systems/sun/sun-exchange/rpc4.0
- X
- X- if the client stubs provided do not compile on your machine, but you
- Xhave rpcgen (usually /bin/rpcgen), type "make gen" first.
- X
- XI would appreciate receiving patches from anyone who needed to modify
- Xthe sources or the Makefile to make the program compile on their
- Xmachine. Patches should be sent to fitz@rpi.edu. Please indicate the
- Xmanufacturer and model of your computer, and the name and version of
- Xyour operating system.
- X
- XRUNNING
- X-------
- X
- Xtype "rperf" to monitor all hosts on the local net, or "rperf host ..."
- Xto monitor a particular list of hosts.
- X
- XRUNNING HINTS
- X-------------
- X
- XEvery monitored host must run rstatd. Check with:
- X
- Xrpcinfo -u <host> rstatd
- X
- XIf rstatd is not registered, uncomment rstatd from /etc/inetd.conf on
- Xthe host to be monitored, and send the inetd process a SIGHUP, as
- Xfollows:
- X
- Xps axc | grep inetd (note pid of inetd)
- Xkill -HUP <pid>
- X
- Xrs6000 users check your manual for the appropriate smit command.
- X
- X- if your system needs rpc.rstatd, you may obtain it from
- Xwuarchive.wustl.edu in /systems/sun/sun-exchange/rpc4.0/rpcsvc. You
- Xwill need rstat_proc.c, rstat.x, and Makefile. The executable will be
- Xcalled rstat_svc, but it's the same as rpc.rstatd.
- X
- XUnfortunately, the public version of rpc.rstatd does not support
- Xversion 4 of the rstatd protocol, as the latest Sun distribution does.
- X
- XIt also contains a serious error. In rstat_proc.c,
- X
- Xunion {
- X struct stats s1;
- X struct statsswtch s2;
- X struct statstime s3;
- X} stats_all;
- X
- Xdoesn't work because the members don't align (For example, look at the
- Xbyte offset of
- Xstats_all.s1.if_opackets vs
- Xstats_all.s2.if_opackets vs
- Xstats_all.s3.if_opackets). The whole thing was rewritten
- Xby Sun, but the source is not public.
- X
- XPROBLEMS WITH BROADCAST MODE
- X-------- ---- --------- ----
- X
- XA lack of output in broadcast mode sometimes indicates a system
- Xconfiguration problem on the local machine or on the remote host. If a
- Xhost on the local broadcast network does not respond to broadcasts
- X("rperf -b") but responds to rpc calls when specific hosts are supplied
- Xon the command line, then a system configuration problem is indicated.
- X
- XThe following troubleshooting suggestions and comments may be helpful:
- X
- X- check that other programs, besides rperf, that are designed to
- Xbroadcast are functioning properly. See "rup", "rusers", "rpcinfo -b",
- Xand "ypbind", for example.
- X
- X- check that its network interface is configured to receive
- Xbroadcasts. On some systems, this is done with the proper "netmask"
- Xand "broadcast" options to ifconfig. These parameters are usually set
- Xat boot time, possibly in /etc/rc.local or /etc/rc.boot. On some
- Xsystems, the relevant configuration is in /etc/tcpip.params.
- X
- X- a host connected to a smart hub may not be able to broadcast to other
- Xhosts.
- X
- X- a Linux user reports that a problem with ethernet addresses in
- Xbroadcast mode in Linux 0.99p13 was fixed in Linux 0.99p14.
- X
- X- an ESIX 4.0.4 user received the following message: "clnt_broadcast:
- XRPC: Unable to send". No additional details are available.
- X
- XKNOWN PROBLEMS
- X----- ---------
- X
- XThe first rstat reply from a newly started rpc.rstatd daemon on AIX
- X(and others) is cumulative, but the rest of the replies are incremental
- Xfrom the previous call. The code attempts to work around this.
- X
- XBus Error. On some systems, object code generated by gcc version 1.xx
- Xmay be incompatible with system libraries. In particular, the use of
- Xgcc version 1 on sparc stations will result in a bus error in
- Xclntudp_create(). For sparcstations, use to cc to compile, or a more
- Xrecent version of gcc.
- X
- XBUG REPORTS
- X-----------
- X
- XSend bug reports, bug fixes, comments, and suggestions to
- Xfitz@rpi.edu. Please indicate the manufacturer and model of your
- Xcomputer, the name and version of your operating system and the version
- Xof rperf that you are using. Accompany reports about configuring or
- Xcompiling problems with the relevant configuration settings in
- Xconfig.status (grep ="'" config.status)
- X
- XPLATFORMS SUPPORTED
- X-------------------
- X
- XAlliant
- XAmiga
- XESIX
- XHP
- XIBM
- XIRIS
- XLinux
- XMIPS
- XMotorola
- XNeXT
- XSCO
- XSun
- XUltrix ...
- X
- XIf it runs on your machine, please tell me!
- X
- XBrian P. Fitzgerald
- XMechanics of Materials Laboratory
- XRensselaer Polytechnic Institute
- XTroy, New York
- END_OF_FILE
- if test 5921 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'FAQ' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'FAQ'\"
- else
- echo shar: Extracting \"'FAQ'\" \(783 characters\)
- sed "s/^X//" >'FAQ' <<'END_OF_FILE'
- XAnswers to frequently asked questions about rperf
- X
- XCONTENTS OF THIS FILE
- X---------------------
- X1) Could rperf report additional kernel statistics?
- X2) Can rperf broadcast on just one network interface?
- X
- X1) Could rperf report additional kernel statistics?
- X
- XIt could be done. rperf queries rpc.rstatd, the network kernel
- Xstatistics daemon. Currently, rpc.rstatd reports the statistics listed
- Xin /usr/rpcsvc/rstat.x. You could extend rstat.x and then modify
- Xrpc.rstatd and rperf
- X
- X2) Can rperf broadcast on just one network interface?
- X
- XNot easily. The rperf broadcast mode uses the clnt_broadcast() routine
- Xin the RPC library. clnt_broadcast() does not broadcast on a single
- Xinterface. To confine the broadcast to a single network, run rperf
- Xfrom a host other than the gateway.
- END_OF_FILE
- if test 783 -ne `wc -c <'FAQ'`; then
- echo shar: \"'FAQ'\" unpacked with wrong size!
- fi
- # end of 'FAQ'
- fi
- if test -f 'configure' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'configure'\"
- else
- echo shar: Extracting \"'configure'\" \(27666 characters\)
- sed "s/^X//" >'configure' <<'END_OF_FILE'
- X#!/bin/sh
- X# Guess values for system-dependent variables and create Makefiles.
- X# Generated automatically using autoconf version 1.7
- X# by fitzgb@mml0.meche.rpi.edu on Wed Dec 15 13:06:36 EST 1993
- X# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
- X
- X# This program is free software; you can redistribute it and/or modify
- X# it under the terms of the GNU General Public License as published by
- X# the Free Software Foundation; either version 2, or (at your option)
- X# any later version.
- X
- X# This program is distributed in the hope that it will be useful,
- X# but WITHOUT ANY WARRANTY; without even the implied warranty of
- X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X# GNU General Public License for more details.
- X
- X# You should have received a copy of the GNU General Public License
- X# along with this program; if not, write to the Free Software
- X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- X# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
- X# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
- X# Ignores all args except --srcdir, --prefix, --exec-prefix, and
- X# --with-PACKAGE[=VALUE] unless this script has special code to handle it.
- X
- Xfor arg
- Xdo
- X # Handle --exec-prefix with a space before the argument.
- X if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
- X # Handle --host with a space before the argument.
- X elif test x$next_host = xyes; then next_host=
- X # Handle --prefix with a space before the argument.
- X elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
- X # Handle --srcdir with a space before the argument.
- X elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
- X else
- X case $arg in
- X # For backward compatibility, recognize -exec-prefix and --exec_prefix.
- X -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
- X exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- X -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
- X next_exec_prefix=yes ;;
- X
- X -gas | --gas | --ga | --g) ;;
- X
- X -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
- X -host | --host | --hos | --ho | --h)
- X next_host=yes ;;
- X
- X -nfp | --nfp | --nf) ;;
- X
- X -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- X prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- X -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- X next_prefix=yes ;;
- X
- X -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
- X srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- X -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
- X next_srcdir=yes ;;
- X
- X -with-* | --with-*)
- X package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
- X # Reject names that aren't valid shell variable names.
- X if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- X echo "configure: $package: invalid package name" >&2; exit 1
- X fi
- X package=`echo $package| sed 's/-/_/g'`
- X case "$arg" in
- X *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
- X *) val=1 ;;
- X esac
- X eval "with_$package='$val'" ;;
- X
- X -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
- X verbose=yes ;;
- X
- X *) ;;
- X esac
- X fi
- Xdone
- X
- Xtrap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
- Xtrap 'rm -f confdefs*' 0
- X
- X# NLS nuisances.
- X# These must not be set unconditionally because not all systems understand
- X# e.g. LANG=C (notably SCO).
- Xif test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
- Xif test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi
- X
- Xrm -f conftest* confdefs.h
- X# AIX cpp loses on an empty file, so make sure it contains at least a newline.
- Xecho > confdefs.h
- Xcompile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
- X
- X# A filename unique to this package, relative to the directory that
- X# configure is in, which we can look for to find out if srcdir is correct.
- Xunique_file=configure.in
- X
- X# Find the source files, if location was not specified.
- Xif test -z "$srcdir"; then
- X srcdirdefaulted=yes
- X # Try the directory containing this script, then `..'.
- X prog=$0
- X confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
- X test "X$confdir" = "X$prog" && confdir=.
- X srcdir=$confdir
- X if test ! -r $srcdir/$unique_file; then
- X srcdir=..
- X fi
- Xfi
- Xif test ! -r $srcdir/$unique_file; then
- X if test x$srcdirdefaulted = xyes; then
- X echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
- X else
- X echo "configure: Can not find sources in \`${srcdir}'." 1>&2
- X fi
- X exit 1
- Xfi
- X# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
- X# But we can't avoid them for `..', to make subdirectories work.
- Xcase $srcdir in
- X .|/*|~*) ;;
- X *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
- Xesac
- X
- X
- X# Save the original args to write them into config.status later.
- Xconfigure_args="$*"
- X
- X
- X# configure.in for rperf
- X#
- X# This program may be copied, redistributed in any form, source or
- X# binary, and used for any purpose, provided this copyright notice is
- X# retained.
- X#
- X# @(#)configure.in 3.1 12/15/93 (c) Copyright Brian P. Fitzgerald
- X# Rensselaer Polytechnic Institute
- X
- X# definitions
- X
- X
- X# configure varibles
- X
- X
- X
- X
- X
- X
- X
- X
- X# compiler configuration
- X
- Xif test -z "$CC"; then
- X # Extract the first word of `gcc', so it can be a program name with args.
- X set dummy gcc; word=$2
- X echo checking for $word
- X IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
- X for dir in $PATH; do
- X test -z "$dir" && dir=.
- X if test -f $dir/$word; then
- X CC="gcc"
- X break
- X fi
- X done
- X IFS="$saveifs"
- Xfi
- Xtest -z "$CC" && CC="cc"
- Xtest -n "$CC" && test -n "$verbose" && echo " setting CC to $CC"
- X
- X# Find out if we are using GNU C, under whatever name.
- Xcat > conftest.c <<EOF
- X#ifdef __GNUC__
- X yes
- X#endif
- XEOF
- X${CC-cc} -E conftest.c > conftest.out 2>&1
- Xif egrep yes conftest.out >/dev/null 2>&1; then
- X GCC=1 # For later tests.
- Xfi
- Xrm -f conftest*
- X
- Xgccv1=`${CC-cc} -v 2>&1 | grep 'gcc version 1'`
- Xif test -n "$gccv1" ; then
- X echo "Caution: $gccv1 detected."
- X echo "Some system library objects may be incompatible."
- X echo "Using cc"
- X CC=cc
- Xfi
- Xecho checking for AIX
- Xecho checking how to run the C preprocessor
- Xif test -z "$CPP"; then
- X # This must be in double quotes, not single quotes, because CPP may get
- X # substituted into the Makefile and ``${CC-cc}'' will simply confuse
- X # make. It must be expanded now.
- X CPP="${CC-cc} -E"
- X cat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <stdio.h>
- XSyntax Error
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X :
- Xelse
- X rm -rf conftest*
- X CPP=/lib/cpp
- Xfi
- Xrm -f conftest*
- Xfi
- Xtest ".${verbose}" != "." && echo " setting CPP to $CPP"
- X
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#ifdef _AIX
- X yes
- X#endif
- X
- XEOF
- Xeval "$CPP conftest.c > conftest.out 2>&1"
- Xif egrep "yes" conftest.out >/dev/null 2>&1; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining _ALL_SOURCE"
- Xecho "#define" _ALL_SOURCE 1 >> confdefs.h
- XDEFS="$DEFS -D_ALL_SOURCE=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- X
- X
- Xecho checking for minix/config.h
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <minix/config.h>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X MINIX=1
- X
- Xfi
- Xrm -f conftest*
- X
- X# The Minix shell can't assign to the same variable on the same line!
- Xif test -n "$MINIX"; then
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining _POSIX_SOURCE"
- Xecho "#define" _POSIX_SOURCE 1 >> confdefs.h
- XDEFS="$DEFS -D_POSIX_SOURCE=1"
- X}
- X
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining" _POSIX_1_SOURCE to be 2
- Xecho "#define" _POSIX_1_SOURCE 2 >> confdefs.h
- XDEFS="$DEFS -D_POSIX_1_SOURCE=2"
- X}
- X
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining _MINIX"
- Xecho "#define" _MINIX 1 >> confdefs.h
- XDEFS="$DEFS -D_MINIX=1"
- X}
- X
- Xfi
- X
- Xecho checking for POSIXized ISC
- Xif test -d /etc/conf/kconfig.d &&
- X grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
- Xthen
- X ISC=1 # If later tests want to check for ISC.
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining _POSIX_SOURCE"
- Xecho "#define" _POSIX_SOURCE 1 >> confdefs.h
- XDEFS="$DEFS -D_POSIX_SOURCE=1"
- X}
- X
- X if test -n "$GCC"; then
- X CC="$CC -posix"
- X else
- X CC="$CC -Xp"
- X fi
- Xfi
- X
- Xecho checking for ANSI C header files
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <stdlib.h>
- X#include <stdarg.h>
- X#include <string.h>
- X#include <float.h>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- Xecho '#include "confdefs.h"
- X#include <string.h>' > conftest.c
- Xeval "$CPP conftest.c > conftest.out 2>&1"
- Xif egrep "memchr" conftest.out >/dev/null 2>&1; then
- X rm -rf conftest*
- X # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <ctype.h>
- X#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
- X#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
- X#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
- Xint main () { int i; for (i = 0; i < 256; i++)
- Xif (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
- Xexit (0); }
- X
- XEOF
- Xeval $compile
- Xif test -s conftest && (./conftest; exit) 2>/dev/null; then
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining STDC_HEADERS"
- Xecho "#define" STDC_HEADERS 1 >> confdefs.h
- XDEFS="$DEFS -DSTDC_HEADERS=1"
- X}
- X
- X
- Xfi
- Xrm -fr conftest*
- X
- Xfi
- Xrm -f conftest*
- X
- X
- Xfi
- Xrm -f conftest*
- X
- X
- Xecho checking for checking for sgi
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X
- Xint main() { exit(0); }
- Xint t() {
- X#ifndef sgi
- Xintentional_error
- X#endif
- X }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X if test "$CC" = "cc" ; then CFLAGS="${CFLAGS} -cckr" ; fi
- X
- Xfi
- Xrm -f conftest*
- X
- X
- Xecho checking how to run the C preprocessor
- Xif test -z "$CPP"; then
- X # This must be in double quotes, not single quotes, because CPP may get
- X # substituted into the Makefile and ``${CC-cc}'' will simply confuse
- X # make. It must be expanded now.
- X CPP="${CC-cc} -E"
- X cat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <stdio.h>
- XSyntax Error
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X :
- Xelse
- X rm -rf conftest*
- X CPP=/lib/cpp
- Xfi
- Xrm -f conftest*
- Xfi
- Xtest ".${verbose}" != "." && echo " setting CPP to $CPP"
- X
- X
- X# programming and installation utilities
- X
- Xif test -z "$RANLIB"; then
- X # Extract the first word of `ranlib', so it can be a program name with args.
- X set dummy ranlib; word=$2
- X echo checking for $word
- X IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
- X for dir in $PATH; do
- X test -z "$dir" && dir=.
- X if test -f $dir/$word; then
- X RANLIB="ranlib"
- X break
- X fi
- X done
- X IFS="$saveifs"
- Xfi
- Xtest -z "$RANLIB" && RANLIB=":"
- Xtest -n "$RANLIB" && test -n "$verbose" && echo " setting RANLIB to $RANLIB"
- X
- Xecho checking for ln -s
- Xrm -f conftestdata
- Xif ln -s X conftestdata 2>/dev/null
- Xthen
- X rm -f conftestdata
- X LN_S="ln -s"
- Xelse
- X LN_S=ln
- Xfi
- X
- X
- Xif test -z "$LINT"; then
- X # Extract the first word of `lint', so it can be a program name with args.
- X set dummy lint; word=$2
- X echo checking for $word
- X IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
- X for dir in $PATH; do
- X test -z "$dir" && dir=.
- X if test -f $dir/$word; then
- X LINT="lint"
- X break
- X fi
- X done
- X IFS="$saveifs"
- Xfi
- Xtest -z "$LINT" && LINT="@echo no lint;false"
- Xtest -n "$LINT" && test -n "$verbose" && echo " setting LINT to $LINT"
- X
- Xif test "$LINT" = lint ; then
- X echo checking for lint pass 1 option
- X rm -f conftest.c conftest.ln
- X echo 'void foo(){}' > conftest.c
- X $LINT -i conftest.c > /dev/null 2>&1
- X if test -f conftest.ln ; then
- X LINT_PASS1=-i
- X else
- X $LINT -c conftest.c > /dev/null 2>&1
- X if test -f conftest.ln ; then
- X LINT_PASS1=-c
- X fi
- X fi
- X rm -f conftest.c conftest.ln
- Xfi
- X
- X# If we have rpcgen, then we can reproduce the stubs and header.
- X# In that case, let the stubs and header depend on the .x file
- X
- X
- X# libraries
- X
- X# This section is accreted from suggestions from numerous rperf users.
- X# Thanks to all who contributed.
- X
- X# Do not search -lrpcsvc. rstat_xdr.o lives there, but don't use it.
- X# Use the rstat_xdr.c that is supplied with rperf, because it
- X# works around a bug found on most non-Sun rpc.rstatd's)
- X
- X
- X
- X echo checking for libns
- X if test -f /lib/libns.a ; then LIBS="-lns $LIBS"
- X elif test -f /usr/lib/libns.a ; then LIBS="-lns $LIBS"
- X elif test -f /usr/local/libns.a ; then LIBS="-L/usr/local/lib -lns $LIBS"
- X fi
- X
- X
- X echo checking for libc_s
- X if test -f /lib/libc_s.a ; then LIBS="-lc_s $LIBS"
- X elif test -f /usr/lib/libc_s.a ; then LIBS="-lc_s $LIBS"
- X elif test -f /usr/local/libc_s.a ; then LIBS="-L/usr/local/lib -lc_s $LIBS"
- X fi
- X
- X
- X echo checking for libinet
- X if test -f /lib/libinet.a ; then LIBS="-linet $LIBS"
- X elif test -f /usr/lib/libinet.a ; then LIBS="-linet $LIBS"
- X elif test -f /usr/local/libinet.a ; then LIBS="-L/usr/local/lib -linet $LIBS"
- X fi
- X
- X
- X echo checking for libypsec
- X if test -f /lib/libypsec.a ; then LIBS="-lypsec $LIBS"
- X elif test -f /usr/lib/libypsec.a ; then LIBS="-lypsec $LIBS"
- X elif test -f /usr/local/libypsec.a ; then LIBS="-L/usr/local/lib -lypsec $LIBS"
- X fi
- X
- X
- X echo checking for librpc
- X if test -f /lib/librpc.a ; then LIBS="-lrpc $LIBS"
- X elif test -f /usr/lib/librpc.a ; then LIBS="-lrpc $LIBS"
- X elif test -f /usr/local/librpc.a ; then LIBS="-L/usr/local/lib -lrpc $LIBS"
- X fi
- X
- X
- X echo checking for libnsl
- X if test -f /lib/libnsl.a ; then LIBS="-lnsl $LIBS"
- X elif test -f /usr/lib/libnsl.a ; then LIBS="-lnsl $LIBS"
- X elif test -f /usr/local/libnsl.a ; then LIBS="-L/usr/local/lib -lnsl $LIBS"
- X fi
- X
- X
- X echo checking for libsun
- X if test -f /lib/libsun.a ; then LIBS="-lsun $LIBS"
- X elif test -f /usr/lib/libsun.a ; then LIBS="-lsun $LIBS"
- X elif test -f /usr/local/libsun.a ; then LIBS="-L/usr/local/lib -lsun $LIBS"
- X fi
- X
- X
- X echo checking for libsocket
- X if test -f /lib/libsocket.a ; then LIBS="-lsocket $LIBS"
- X elif test -f /usr/lib/libsocket.a ; then LIBS="-lsocket $LIBS"
- X elif test -f /usr/local/libsocket.a ; then LIBS="-L/usr/local/lib -lsocket $LIBS"
- X fi
- X LIBS_save="${LIBS}"
- XLIBS="${LIBS} -lintl"
- Xhave_lib=""
- Xecho checking for -lintl
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X
- Xint main() { exit(0); }
- Xint t() { main(); }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X have_lib="1"
- X
- Xfi
- Xrm -f conftest*
- XLIBS="${LIBS_save}"
- Xif test -n "${have_lib}"; then
- X :; LIBS="$LIBS -lintl"
- Xelse
- X :;
- Xfi
- X
- X
- X# Some SYSV users needed -lc -lucb but this breaks for Solaris 2
- X# so I have commented it out.
- X#
- X# The purpose was to link in library functions bzero and bcopy.
- X# bzero and bcopy are now macros that are defined in common.h
- X#
- X#echo checking for libucb
- X#if test -f /usr/ucblib/libucb.a ; then LIBS="-lc -L/usr/ucblib -lucb $LIBS"
- X#elif test -f /lib/libucb.a ; then LIBS="-lc -lucb $LIBS"
- X#elif test -f /usr/lib/libucb.a ; then LIBS="-lc -lucb $LIBS"
- X#elif test -f /usr/local/libucb.a ; then LIBS="-lc -L/usr/local/lib -lucb $LIBS"
- X#fi
- X
- Xecho checking for compiling with LIBS=$LIBS
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X
- Xint main() { exit(0); }
- Xint t() { }
- XEOF
- Xif eval $compile; then
- X :
- Xelse
- X rm -rf conftest*
- X echo '
- X Your compiler apparently has a problem with linking an empty main
- X program to the libraries that have been found by this configure
- X script. The configuration from here will, in some cases, be
- X incorrect, and you will have to edit Makefile by hand. In
- X particular, you may need to set -DRETSIGTYPE=void to compile without
- X trouble. This is a known problem on ESIX.
- X'
- Xfi
- Xrm -f conftest*
- X
- X
- X# headers
- X
- Xfor hdr in sys/termio.h
- Xdo
- Xtrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
- Xecho checking for ${hdr}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <${hdr}>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining ${trhdr}"
- Xecho "#define" ${trhdr} 1 >> confdefs.h
- XDEFS="$DEFS -D${trhdr}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- Xfor hdr in sys/termios.h
- Xdo
- Xtrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
- Xecho checking for ${hdr}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <${hdr}>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining ${trhdr}"
- Xecho "#define" ${trhdr} 1 >> confdefs.h
- XDEFS="$DEFS -D${trhdr}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- Xfor hdr in sys/bsd_tty.h
- Xdo
- Xtrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
- Xecho checking for ${hdr}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <${hdr}>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining ${trhdr}"
- Xecho "#define" ${trhdr} 1 >> confdefs.h
- XDEFS="$DEFS -D${trhdr}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- Xfor hdr in sys/resource.h
- Xdo
- Xtrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
- Xecho checking for ${hdr}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <${hdr}>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining ${trhdr}"
- Xecho "#define" ${trhdr} 1 >> confdefs.h
- XDEFS="$DEFS -D${trhdr}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- Xfor hdr in unistd.h
- Xdo
- Xtrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
- Xecho checking for ${hdr}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <${hdr}>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining ${trhdr}"
- Xecho "#define" ${trhdr} 1 >> confdefs.h
- XDEFS="$DEFS -D${trhdr}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- Xfor hdr in stdlib.h
- Xdo
- Xtrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
- Xecho checking for ${hdr}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <${hdr}>
- XEOF
- Xerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`
- Xif test -z "$err"; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining ${trhdr}"
- Xecho "#define" ${trhdr} 1 >> confdefs.h
- XDEFS="$DEFS -D${trhdr}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- X
- X# types
- X
- Xecho checking for return type of signal handlers
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <sys/types.h>
- X#include <signal.h>
- X#ifdef signal
- X#undef signal
- X#endif
- Xextern void (*signal ()) ();
- Xint main() { exit(0); }
- Xint t() { int i; }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining" RETSIGTYPE to be void
- Xecho "#define" RETSIGTYPE void >> confdefs.h
- XDEFS="$DEFS -DRETSIGTYPE=void"
- X}
- X
- X
- Xelse
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining" RETSIGTYPE to be int
- Xecho "#define" RETSIGTYPE int >> confdefs.h
- XDEFS="$DEFS -DRETSIGTYPE=int"
- X}
- X
- Xfi
- Xrm -f conftest*
- X
- X
- Xecho checking for return type of inet_addr
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <sys/types.h>
- X#include <netinet/in.h>
- X#include <arpa/inet.h>
- Xint main() { exit(0); }
- Xint t() { struct in_addr
- Xx()
- X{
- X struct in_addr a;
- X
- X a = inet_addr("127.0.0.1");
- X return a;
- X} }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining STRUCT_IN_ADDR_INET_ADDR"
- Xecho "#define" STRUCT_IN_ADDR_INET_ADDR 1 >> confdefs.h
- XDEFS="$DEFS -DSTRUCT_IN_ADDR_INET_ADDR=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- X
- X
- X# structures
- X
- Xecho checking for struct tm in time.h
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <sys/types.h>
- X#include <time.h>
- Xint main() { exit(0); }
- Xint t() { struct tm *tp; tp->tm_sec; }
- XEOF
- Xif eval $compile; then
- X :
- Xelse
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining TM_IN_SYS_TIME"
- Xecho "#define" TM_IN_SYS_TIME 1 >> confdefs.h
- XDEFS="$DEFS -DTM_IN_SYS_TIME=1"
- X}
- X
- Xfi
- Xrm -f conftest*
- X
- Xdecl='#include <sys/types.h>
- X'
- Xcase "$DEFS" in
- X *TM_IN_SYS_TIME*) decl="$decl
- X#include <sys/time.h>
- X" ;;
- X *) decl="$decl
- X#include <time.h>
- X" ;;
- Xesac
- Xecho checking for tm_zone in struct tm
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X$decl
- Xint main() { exit(0); }
- Xint t() { struct tm tm; tm.tm_zone; }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining HAVE_TM_ZONE"
- Xecho "#define" HAVE_TM_ZONE 1 >> confdefs.h
- XDEFS="$DEFS -DHAVE_TM_ZONE=1"
- X}
- X
- X
- Xelse
- X rm -rf conftest*
- X no_tm_zone=1
- Xfi
- Xrm -f conftest*
- X
- Xif test -n "$no_tm_zone"; then
- Xecho checking for tzname
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <time.h>
- X#ifndef tzname /* For SGI. */
- Xextern char *tzname[]; /* RS6000 and others want it this way. */
- X#endif
- Xint main() { exit(0); }
- Xint t() { atoi(*tzname); }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining HAVE_TZNAME"
- Xecho "#define" HAVE_TZNAME 1 >> confdefs.h
- XDEFS="$DEFS -DHAVE_TZNAME=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- X
- Xfi
- X
- X
- X# functions
- X
- Xecho checking for BSD memory functions
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <strings.h>
- Xint main() { exit(0); }
- Xint t() { bzero(0, 0); }
- XEOF
- Xif eval $compile; then
- X :
- Xelse
- X rm -rf conftest*
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining NO_BSTRING"
- Xecho "#define" NO_BSTRING 1 >> confdefs.h
- XDEFS="$DEFS -DNO_BSTRING=1"
- X}
- X
- Xfi
- Xrm -f conftest*
- X
- X
- Xfor func in strftime
- Xdo
- Xecho checking for ${func}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <ctype.h>
- Xint main() { exit(0); }
- Xint t() {
- X/* The GNU C library defines this for functions which it implements
- X to always fail with ENOSYS. Some functions are actually named
- X something starting with __ and the normal name is an alias. */
- X#if defined (__stub_${func}) || defined (__stub___${func})
- Xchoke me
- X#else
- X/* Override any gcc2 internal prototype to avoid an error. */
- Xextern char ${func}(); ${func}();
- X#endif
- X }
- XEOF
- Xif eval $compile; then
- X :
- Xelse
- X rm -rf conftest*
- X LIBOBJS="$LIBOBJS ${func}.o"
- Xtest -n "$verbose" && echo " using ${func}.o instead"
- Xfi
- Xrm -f conftest*
- X
- Xdone
- X
- Xfor func in strdup
- Xdo
- Xecho checking for ${func}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <ctype.h>
- Xint main() { exit(0); }
- Xint t() {
- X/* The GNU C library defines this for functions which it implements
- X to always fail with ENOSYS. Some functions are actually named
- X something starting with __ and the normal name is an alias. */
- X#if defined (__stub_${func}) || defined (__stub___${func})
- Xchoke me
- X#else
- X/* Override any gcc2 internal prototype to avoid an error. */
- Xextern char ${func}(); ${func}();
- X#endif
- X }
- XEOF
- Xif eval $compile; then
- X :
- Xelse
- X rm -rf conftest*
- X LIBOBJS="$LIBOBJS ${func}.o"
- Xtest -n "$verbose" && echo " using ${func}.o instead"
- Xfi
- Xrm -f conftest*
- X
- Xdone
- X
- Xif test -n "$LIBOBJS" ; then
- X LIBC="libc.a"
- Xfi
- Xfor func in setlinebuf
- Xdo
- Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
- Xecho checking for ${func}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <ctype.h>
- Xint main() { exit(0); }
- Xint t() {
- X/* The GNU C library defines this for functions which it implements
- X to always fail with ENOSYS. Some functions are actually named
- X something starting with __ and the normal name is an alias. */
- X#if defined (__stub_${func}) || defined (__stub___${func})
- Xchoke me
- X#else
- X/* Override any gcc2 internal prototype to avoid an error. */
- Xextern char ${func}(); ${func}();
- X#endif
- X }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X {
- Xtest -n "$verbose" && \
- Xecho " defining ${trfunc}"
- Xecho "#define" ${trfunc} 1 >> confdefs.h
- XDEFS="$DEFS -D${trfunc}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <stdio.h>
- X/* If setvbuf has the reversed format, exit 0. */
- Xmain () {
- X /* This call has the arguments reversed.
- X A reversed system may check and see that the address of main
- X is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */
- X if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
- X exit(1);
- X putc('\r', stdout);
- X exit(0); /* Non-reversed systems segv here. */
- X}
- XEOF
- Xeval $compile
- Xif test -s conftest && (./conftest; exit) 2>/dev/null; then
- X
- X{
- Xtest -n "$verbose" && \
- Xecho " defining SETVBUF_REVERSED"
- Xecho "#define" SETVBUF_REVERSED 1 >> confdefs.h
- XDEFS="$DEFS -DSETVBUF_REVERSED=1"
- X}
- X
- X
- Xfi
- Xrm -fr conftest*
- Xrm -f core
- X
- Xfor func in setdtablesize
- Xdo
- Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
- Xecho checking for ${func}
- Xcat > conftest.c <<EOF
- X#include "confdefs.h"
- X#include <ctype.h>
- Xint main() { exit(0); }
- Xint t() {
- X/* The GNU C library defines this for functions which it implements
- X to always fail with ENOSYS. Some functions are actually named
- X something starting with __ and the normal name is an alias. */
- X#if defined (__stub_${func}) || defined (__stub___${func})
- Xchoke me
- X#else
- X/* Override any gcc2 internal prototype to avoid an error. */
- Xextern char ${func}(); ${func}();
- X#endif
- X }
- XEOF
- Xif eval $compile; then
- X rm -rf conftest*
- X {
- Xtest -n "$verbose" && \
- Xecho " defining ${trfunc}"
- Xecho "#define" ${trfunc} 1 >> confdefs.h
- XDEFS="$DEFS -D${trfunc}=1"
- X}
- X
- X
- Xfi
- Xrm -f conftest*
- Xdone
- X
- X
- X# Set default prefixes.
- Xif test -n "$prefix"; then
- X test -z "$exec_prefix" && exec_prefix='${prefix}'
- X prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
- Xfi
- Xif test -n "$exec_prefix"; then
- X prsub="$prsub
- Xs%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
- Xfi
- X# Quote sed substitution magic chars in DEFS.
- Xcat >conftest.def <<EOF
- X$DEFS
- XEOF
- Xescape_ampersand_and_backslash='s%[&\\]%\\&%g'
- XDEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
- Xrm -f conftest.def
- X# Substitute for predefined variables.
- X
- Xtrap 'rm -f config.status; exit 1' 1 3 15
- Xecho creating config.status
- Xrm -f config.status
- Xcat > config.status <<EOF
- X#!/bin/sh
- X# Generated automatically by configure.
- X# Run this file to recreate the current configuration.
- X# This directory was configured as follows,
- X# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
- X#
- X# $0 $configure_args
- X
- Xfor arg
- Xdo
- X case "\$arg" in
- X -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- X echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
- X exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
- X *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
- X esac
- Xdone
- X
- Xtrap 'rm -f Makefile; exit 1' 1 3 15
- XLIBC='$LIBC'
- XCFLAGS='$CFLAGS'
- XLINT_PASS1='$LINT_PASS1'
- XCONF_USER='$CONF_USER'
- XCONF_HOST='$CONF_HOST'
- XCONF_DATE='$CONF_DATE'
- XCC='$CC'
- XCPP='$CPP'
- XRANLIB='$RANLIB'
- XLN_S='$LN_S'
- XLINT='$LINT'
- XLIBOBJS='$LIBOBJS'
- XLIBS='$LIBS'
- Xsrcdir='$srcdir'
- XDEFS='$DEFS'
- Xprefix='$prefix'
- Xexec_prefix='$exec_prefix'
- Xprsub='$prsub'
- Xextrasub='$extrasub'
- XEOF
- Xcat >> config.status <<\EOF
- Xsedcmd='s/^(*(\(^)*\)).*/\1/'
- XCONF_USER=`(whoami || id|sed "$sedcmd") 2>/dev/null`
- XCONF_HOST=`(hostname || uname -n) 2>/dev/null`
- XCONF_DATE=`date`
- X
- Xtop_srcdir=$srcdir
- X
- XCONFIG_FILES=${CONFIG_FILES-"Makefile"}
- Xfor file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
- X srcdir=$top_srcdir
- X # Remove last slash and all that follows it. Not all systems have dirname.
- X dir=`echo $file|sed 's%/[^/][^/]*$%%'`
- X if test "$dir" != "$file"; then
- X test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
- X test ! -d $dir && mkdir $dir
- X fi
- X echo creating $file
- X rm -f $file
- X echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
- X sed -e "
- X$prsub
- X$extrasub
- Xs%@LIBC@%$LIBC%g
- Xs%@CFLAGS@%$CFLAGS%g
- Xs%@LINT_PASS1@%$LINT_PASS1%g
- Xs%@CONF_USER@%$CONF_USER%g
- Xs%@CONF_HOST@%$CONF_HOST%g
- Xs%@CONF_DATE@%$CONF_DATE%g
- Xs%@CC@%$CC%g
- Xs%@CPP@%$CPP%g
- Xs%@RANLIB@%$RANLIB%g
- Xs%@LN_S@%$LN_S%g
- Xs%@LINT@%$LINT%g
- Xs%@LIBOBJS@%$LIBOBJS%g
- Xs%@LIBS@%$LIBS%g
- Xs%@srcdir@%$srcdir%g
- Xs%@DEFS@%$DEFS%
- X" $top_srcdir/${file}.in >> $file
- Xfi; done
- X
- X
- Xexit 0
- XEOF
- Xchmod +x config.status
- X${CONFIG_SHELL-/bin/sh} config.status
- X
- Xecho ""
- Xecho "Configuration complete."
- Xecho ""
- Xecho "Now type 'make' to build rperf."
- END_OF_FILE
- if test 27666 -ne `wc -c <'configure'`; then
- echo shar: \"'configure'\" unpacked with wrong size!
- fi
- chmod +x 'configure'
- # end of 'configure'
- fi
- if test -f 'configure.in' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'configure.in'\"
- else
- echo shar: Extracting \"'configure.in'\" \(4551 characters\)
- sed "s/^X//" >'configure.in' <<'END_OF_FILE'
- Xdnl Process this file with autoconf to produce a configure script.
- XAC_INIT(configure.in)
- X
- X# configure.in for rperf
- X#
- X# This program may be copied, redistributed in any form, source or
- X# binary, and used for any purpose, provided this copyright notice is
- X# retained.
- X#
- X# @(#)configure.in 3.1 12/15/93 (c) Copyright Brian P. Fitzgerald
- X# Rensselaer Polytechnic Institute
- X
- X# definitions
- X
- Xdefine(ACX_HAVE_LIB, [
- X AC_PROVIDE([$0])
- X echo checking for lib[$1]
- X if test -f /lib/lib[$1].a ; then LIBS="-l[$1] $LIBS"
- X elif test -f /usr/lib/lib[$1].a ; then LIBS="-l[$1] $LIBS"
- X elif test -f /usr/local/lib[$1].a ; then LIBS="-L/usr/local/lib -l[$1] $LIBS"
- X fi
- X])dnl
- X
- X# configure varibles
- X
- XAC_SUBST(LIBC)
- XAC_SUBST(CFLAGS)
- XAC_SUBST(LINT_PASS1)
- XAC_SUBST(CONF_USER)
- XAC_SUBST(CONF_HOST)
- XAC_SUBST(CONF_DATE)
- X
- X# compiler configuration
- X
- XAC_PROG_CC
- Xgccv1=`${CC-cc} -v 2>&1 | grep 'gcc version 1'`
- Xif test -n "$gccv1" ; then
- X echo "Caution: $gccv1 detected."
- X echo "Some system library objects may be incompatible."
- X echo "Using cc"
- X CC=cc
- Xfi
- XAC_AIX
- XAC_MINIX
- XAC_ISC_POSIX
- XAC_STDC_HEADERS
- X
- XAC_COMPILE_CHECK([checking for sgi],,[
- X#ifndef sgi
- Xintentional_error
- X#endif
- X],[if test "$CC" = "cc" ; then CFLAGS="${CFLAGS} -cckr" ; fi])
- X
- XAC_PROG_CPP
- X
- X# programming and installation utilities
- X
- XAC_PROG_RANLIB
- XAC_LN_S
- XAC_PROGRAM_CHECK(LINT,lint,lint,@echo no lint;false)
- Xif test "$LINT" = lint ; then
- X echo checking for lint pass 1 option
- X rm -f conftest.c conftest.ln
- X echo 'void foo(){}' > conftest.c
- X $LINT -i conftest.c > /dev/null 2>&1
- X if test -f conftest.ln ; then
- X LINT_PASS1=-i
- X else
- X $LINT -c conftest.c > /dev/null 2>&1
- X if test -f conftest.ln ; then
- X LINT_PASS1=-c
- X fi
- X fi
- X rm -f conftest.c conftest.ln
- Xfi
- X
- X# If we have rpcgen, then we can reproduce the stubs and header.
- X# In that case, let the stubs and header depend on the .x file
- X
- Xdnl AC_GCC_TRADITIONAL
- X
- X# libraries
- X
- X# This section is accreted from suggestions from numerous rperf users.
- X# Thanks to all who contributed.
- X
- X# Do not search -lrpcsvc. rstat_xdr.o lives there, but don't use it.
- X# Use the rstat_xdr.c that is supplied with rperf, because it
- X# works around a bug found on most non-Sun rpc.rstatd's)
- X
- XACX_HAVE_LIB(ns) dnl TLI support for AT&T
- XACX_HAVE_LIB(c_s) dnl shared lib on SCO Unix. Saves disk space.
- XACX_HAVE_LIB(inet) dnl needed for Interactive Systems 386/SYSV
- XACX_HAVE_LIB(ypsec) dnl Dolphin m88k machine speed up. (app. 1000/1)
- XACX_HAVE_LIB(rpc) dnl RPC library on some SYSV
- XACX_HAVE_LIB(nsl) dnl RPC library on some SYSV
- XACX_HAVE_LIB(sun) dnl RPC library for SGI
- XACX_HAVE_LIB(socket) dnl for gethostbyname/addr on ESIX
- XAC_SCO_INTL dnl for strftime
- X
- X# Some SYSV users needed -lc -lucb but this breaks for Solaris 2
- X# so I have commented it out.
- X#
- X# The purpose was to link in library functions bzero and bcopy.
- X# bzero and bcopy are now macros that are defined in common.h
- X#
- X#echo checking for libucb
- X#if test -f /usr/ucblib/libucb.a ; then LIBS="-lc -L/usr/ucblib -lucb $LIBS"
- X#elif test -f /lib/libucb.a ; then LIBS="-lc -lucb $LIBS"
- X#elif test -f /usr/lib/libucb.a ; then LIBS="-lc -lucb $LIBS"
- X#elif test -f /usr/local/libucb.a ; then LIBS="-lc -L/usr/local/lib -lucb $LIBS"
- X#fi
- X
- XAC_COMPILE_CHECK([compiling with LIBS=$LIBS],
- X, , , [echo '
- X Your compiler apparently has a problem with linking an empty main
- X program to the libraries that have been found by this configure
- X script. The configuration from here will, in some cases, be
- X incorrect, and you will have to edit Makefile by hand. In
- X particular, you may need to set -DRETSIGTYPE=void to compile without
- X trouble. This is a known problem on ESIX.
- X'])
- X
- X# headers
- X
- XAC_HAVE_HEADERS(sys/termio.h)
- XAC_HAVE_HEADERS(sys/termios.h)
- XAC_HAVE_HEADERS(sys/bsd_tty.h)
- XAC_HAVE_HEADERS(sys/resource.h)
- XAC_HAVE_HEADERS(unistd.h)
- XAC_HAVE_HEADERS(stdlib.h)
- X
- X# types
- X
- XAC_RETSIGTYPE
- XAC_COMPILE_CHECK(
- X[return type of inet_addr],
- X[#include <sys/types.h>
- X#include <netinet/in.h>
- X#include <arpa/inet.h>],
- X[struct in_addr
- Xx()
- X{
- X struct in_addr a;
- X
- X a = inet_addr("127.0.0.1");
- X return a;
- X}],
- X[AC_DEFINE(STRUCT_IN_ADDR_INET_ADDR)])
- X
- X# structures
- X
- XAC_TIMEZONE
- X
- X# functions
- X
- XAC_COMPILE_CHECK([BSD memory functions],
- X[#include <strings.h>], [bzero(0, 0);], , AC_DEFINE(NO_BSTRING))
- X
- XAC_REPLACE_FUNCS(strftime)
- XAC_REPLACE_FUNCS(strdup)
- Xif test -n "$LIBOBJS" ; then
- X LIBC="libc.a"
- Xfi
- XAC_HAVE_FUNCS(setlinebuf)
- XAC_SETVBUF_REVERSED
- XAC_HAVE_FUNCS(setdtablesize)
- X
- XAC_OUTPUT(Makefile)
- Xecho ""
- Xecho "Configuration complete."
- Xecho ""
- Xecho "Now type 'make' to build rperf."
- END_OF_FILE
- if test 4551 -ne `wc -c <'configure.in'`; then
- echo shar: \"'configure.in'\" unpacked with wrong size!
- fi
- # end of 'configure.in'
- fi
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(960 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X File Name Archive # Description
- X-----------------------------------------------------------
- X README 1
- X FAQ 1
- X configure 1 Type "sh ./configure"
- X configure.in 1
- X MANIFEST 1 This shipping list
- X Makefile.in 1
- X rstat.x 1
- X rstat.h 1
- X rstat_xdr.c 2
- X rstat_xdr.ed 2
- X rperf.8 2 use: tbl rperf.8 | nroff -man
- X rperf.c 3
- X term.h 1
- X rperf.h 2
- X term.c 2
- X rpc.c 2
- X common.h 2
- X strdup.c 2 Not found on all systems
- X strftime.c 4 Not found on all systems
- X hsearch.c 3 Use instead of the system hsearch
- X hsearch.h 2 Use instead of the system hsearch
- X PORTING 4
- END_OF_FILE
- if test 960 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'Makefile.in' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile.in'\"
- else
- echo shar: Extracting \"'Makefile.in'\" \(5171 characters\)
- sed "s/^X//" >'Makefile.in' <<'END_OF_FILE'
- X# Makefile for rperf
- X#
- X# Generated automatically from Makefile.in
- X# by @CONF_USER@@@CONF_HOST@
- X# on @CONF_DATE@
- X#
- X# This program may be copied, redistributed in any form, source or
- X# binary, and used for any purpose, provided this copyright notice is
- X# retained.
- X#
- X# @(#)Makefile.in 3.1 12/15/93 (c) Copyright Brian P. Fitzgerald
- X# Rensselaer Polytechnic Institute
- X
- XCLNT_PROG = rperf
- XCLNT_SRCS = rperf.c rstat_xdr.c term.c rpc.c hsearch.c
- XCLNT_OBJS = rperf.o rstat_xdr.o term.o rpc.o hsearch.o
- XLIB_SRCS = strdup.c strftime.c
- XLIB_OBJS = strdup.o strftime.o
- X
- XLIBS = @LIBC@ @LIBS@ -ltermcap
- X
- XGEN_SRCS = rstat_clnt.c rstat_svc.c rstat_xdr.c rstat.h
- XGEN_OBJS = rstat_xdr.o
- X
- XDBG_OBJS = /usr/lib/debug/malloc.o /usr/lib/debug/mallocmap.o
- X
- XDEFS = @DEFS@
- XCPPFLAGS = $(DEFS)
- X
- XCFLAGS = -O @CFLAGS@
- X
- X# Caution: On some systems, object code generated by gcc version 1.xx
- X# may be incompatible with system libraries. In particular, the use
- X# of gcc version 1 on sparc stations will result in a bus error in
- X# clntudp_create().
- X
- XCC = @CC@
- XCOMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
- XLINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
- XRM = rm -f
- XMAKE = make
- XAR = ar
- XARFLAGS = rv
- X
- XSHELL = /bin/sh
- X
- X.c.o:
- X $(COMPILE.c) $<
- X
- Xprefix = /usr/local
- Xexec_prefix = $(prefix)
- X
- Xbindir = $(exec_prefix)/bin
- Xmandir = $(prefix)/man
- X
- X$(CLNT_PROG): $(CLNT_OBJS) @LIBC@
- X $(LINK.c) -o $@ $(CLNT_OBJS) $(LIBS)
- X
- Xrup:
- X @LN_S@ $(CLNT_PROG) $@
- X
- Xall: $(CLNT_PROG) rup
- X
- Xlibc.a: @LIBOBJS@
- X $(AR) $(ARFLAGS) libc.a @LIBOBJS@
- X @RANLIB@ libc.a
- X
- Xdbg:
- X $(MAKE) $(TARGET) "DEFS=$(DEFS) -DDEBUG" "CLNT_OBJS=$(CLNT_OBJS) $(DBG_OBJS)" "LIBS=$(LIBS)" "CFLAGS=$(CFLAGS) -g" # /depot/rpc/arch/lib/librpclib.a"
- X
- X# compile with the AIX stdc compiler
- Xstdc:
- X $(MAKE) $(TARGET) "CFLAGS=$(CFLAGS) -qlanglvl=ansi" CC=cc
- X
- X# compile with -Wall
- XGNUFLAGS = -Wall \
- X -Wno-implicit \
- X -Wshadow
- X
- XWall:
- X $(MAKE) $(TARGET) "CFLAGS=$(CFLAGS) $(GNUFLAGS)"
- X
- Xobjs: $(CLNT_OBJS) $(LIB_OBJS)
- X
- Xprof:
- X $(MAKE) Wall TARGET="$(TARGET)" "CFLAGS=$(CFLAGS) -p"
- X
- Xgprof:
- X $(MAKE) Wall TARGET="$(TARGET)" "CFLAGS=$(CFLAGS) -pg"
- X
- Xdfiles:
- X $(MAKE) $(TARGET) "CFLAGS=$(CFLAGS) -a" CC=/usr/lang/SC1.0/cc
- X
- XTCOV = tcov
- XTCOVOPTS =
- XTCOV.c = $(TCOV) $(TCOVOPTS)
- X.d.tcov:
- X $(TCOV.c) $*.c
- XCLNT_TCOVS = rperf.tcov rpc.tcov term.tcov rstat_xdr.tcov hsearch.tcov
- X
- Xtcov: $(CLNT_TCOVS)
- X
- Xinstall: install_prefix install_bin install_man
- X
- Xinstall_prefix:
- X if test ! -d $(prefix) ; then mkdir $(prefix) ; fi
- X
- Xinstall_bin:
- X if test ! -d $(bindir) ; then mkdir $(bindir) ; fi
- X cp $(CLNT_PROG) $(bindir)/$(CLNT_PROG)
- X chmod go+rx $(bindir)/$(CLNT_PROG)
- X $(RM) $(bindir)/rup
- X cd $(bindir) ; @LN_S@ $(CLNT_PROG) rup
- X
- Xinstall_man:
- X if test ! -d $(mandir) ; then mkdir $(mandir) ; fi
- X if test ! -d $(mandir)/man8 ; then mkdir $(mandir)/man8 ; fi
- X if test ! -d $(mandir)/cat8 ; then mkdir $(mandir)/cat8 ; fi
- X cp rperf.8 $(mandir)/man8/rperf.8
- X chmod go+r $(mandir)/man8/rperf.8
- X tbl $(mandir)/man8/rperf.8 | nroff -man > $(mandir)/cat8/rperf.8
- X chmod go+r $(mandir)/cat8/rperf.8
- X
- X# let rmdir fail if directory is not empty
- Xuninstall: uninstall_bin uninstall_man uninstall_prefix
- X
- Xuninstall_bin:
- X $(RM) $(bindir)/$(CLNT_PROG)
- X $(RM) $(bindir)/rup
- X -rmdir $(bindir)
- X
- Xuninstall_man:
- X $(RM) $(mandir)/man8/rperf.8
- X $(RM) $(mandir)/cat8/rperf.8
- X -rmdir $(mandir)/man8
- X -rmdir $(mandir)/cat8
- X -rmdir $(mandir)
- X
- Xuninstall_prefix:
- X -rmdir $(prefix)
- X
- Xgen:
- X rpcgen -h rstat.x > rstat.h
- X rpcgen -c rstat.x > rstat_xdr.c
- X ed < rstat_xdr.ed rstat_xdr.c
- X
- Xconfigure: configure.in
- X autoconf
- X
- XSHARMSG = "Now do 'sh ./configure' or 'sh ./configure -prefix=PATH' (Default = $(prefix))"
- XSHAROPTS = -p -npart -m -t $(SHARMSG)
- XSHARDEPS = configure
- Xkit: $(SHARDEPS)
- X makekit $(SHAROPTS)
- X
- Xshar: $(SHARDEPS)
- X makekit -s1000k $(SHAROPTS)
- X
- Xmostlyclean:
- X $(RM) a.out $(CLNT_PROG) rup *.BAK typescript
- X $(RM) mon.out gmon.out *.d *.tcov
- X
- Xclean: mostlyclean
- X $(RM) *.ln *.o core libc.a *.fl
- X
- Xdistclean: clean
- X $(RM) Makefile config.status *part* tags
- X
- X# wayclean is "way too clean" unless you have autoconf and Sun rpcgen :-)
- Xwayclean: distclean
- X $(RM) configure $(GEN_SRCS)
- X
- X# development
- X
- XLINT_PASS1 = @LINT_PASS1@
- XLINTFLAGS = -wk -wD -wa -u -n -wP -x
- XLINTFLAGS = -abchx
- XLINTFLAGS =
- XLINT = @LINT@
- XLINT.c = $(LINT) $(LINTFLAGS) $(CPPFLAGS)
- XCLNT_LNS = rperf.ln rpc.ln term.ln rstat_xdr.ln hsearch.ln
- XLIB_LNS = strdup.ln strftime.ln
- XGEN_LNS = rstat_xdr.ln
- X
- X.SUFFIXES: .ln .fl .d .tcov
- X
- X.c.ln:
- X $(LINT.c) $(LINT_PASS1) $<
- X
- Xlint: lint-clnt lint-lib
- X @echo linting all
- X $(LINT.c) $(CLNT_LNS) $(LIB_LNS) $(LIBS)
- X
- Xlint-clnt: $(CLNT_LNS)
- X $(LINT.c) $(CLNT_LNS) $(LIBS)
- Xlint-lib: $(LIB_LNS)
- X $(LINT.c) $(LIB_LNS) $(LIBS)
- X
- XCFLOW = /bin/cflow
- XCFLOWFLAGS =
- XCFLOW.c = $(CFLOW) $(CFLOWFLAGS) $(CPPFLAGS)
- XCLNT_FLS = rperf.fl rpc.fl term.fl rstat_xdr.fl hsearch.fl
- XLIB_FLS = strdup.fl strftime.fl
- X.c.fl:
- X $(CFLOW.c) $< > $@
- X
- Xflow: $(CLNT_FLS) $(LIB_FLS)
- X
- X# hidden dependencies
- Xrperf.o: rstat.h term.h rperf.h common.h
- Xrperf.ln: rstat.h term.h rperf.h common.h
- Xterm.o: rstat.h term.h common.h
- Xterm.ln: rstat.h term.h common.h
- Xrpc.o: rstat.h rperf.h common.h
- Xrpc.ln: rstat.h rperf.h common.h
- X$(GEN_OBJS): rstat.h
- X$(GEN_LNS): rstat.h
- Xhsearch.o: hsearch.h
- Xhsearch.ln: hsearch.h
- END_OF_FILE
- if test 5171 -ne `wc -c <'Makefile.in'`; then
- echo shar: \"'Makefile.in'\" unpacked with wrong size!
- fi
- # end of 'Makefile.in'
- fi
- if test -f 'rstat.x' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rstat.x'\"
- else
- echo shar: Extracting \"'rstat.x'\" \(4278 characters\)
- sed "s/^X//" >'rstat.x' <<'END_OF_FILE'
- X/* @(#)rstat.x 2.2 88/08/01 4.0 RPCSRC */
- X/* @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro */
- X
- X/*
- X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- X * unrestricted use provided that this legend is included on all tape
- X * media and as a part of the software program in whole or part. Users
- X * may copy or modify Sun RPC without charge, but are not authorized
- X * to license or distribute it to anyone else except as part of a product or
- X * program developed by the user.
- X *
- X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- X *
- X * Sun RPC is provided with no support and without any obligation on the
- X * part of Sun Microsystems, Inc. to assist in its use, correction,
- X * modification or enhancement.
- X *
- X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- X * OR ANY PART THEREOF.
- X *
- X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- X * or profits or other special, indirect and consequential damages, even if
- X * Sun has been advised of the possibility of such damages.
- X *
- X * Sun Microsystems, Inc.
- X * 2550 Garcia Avenue
- X * Mountain View, California 94043
- X */
- X
- X/*
- X * Gather statistics on remote machines
- X */
- X
- X#ifdef RPC_HDR
- X
- X%#ifndef FSCALE
- X%/*
- X% * Scale factor for scaled integers used to count load averages.
- X% */
- X%#define FSHIFT 8 /* bits to right of fixed binary point */
- X%#define FSCALE (1<<FSHIFT)
- X%
- X%#endif /* ndef FSCALE */
- X
- X#endif /* def RPC_HDR */
- X
- Xconst CPUSTATES = 4;
- Xconst DK_NDRIVE = 4; /* max drives for rstatprog versions 1-3 */
- X
- X/*
- X * GMT since 0:00, January 1, 1970
- X */
- Xstruct rstat_timeval {
- X unsigned int tv_sec; /* seconds */
- X unsigned int tv_usec; /* and microseconds */
- X};
- X
- Xstruct statsvar { /* version 4 */
- X int cp_time<>;
- X int dk_xfer<>;
- X unsigned int v_pgpgin;
- X unsigned int v_pgpgout;
- X unsigned int v_pswpin;
- X unsigned int v_pswpout;
- X unsigned int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_opackets;
- X int if_oerrors;
- X int if_collisions;
- X unsigned int v_swtch;
- X long avenrun[3];
- X rstat_timeval boottime;
- X rstat_timeval curtime;
- X};
- X
- Xstruct statstime { /* RSTATVERS_TIME */
- X int cp_time[CPUSTATES];
- X int dk_xfer[DK_NDRIVE];
- X unsigned int v_pgpgin; /* these are cumulative sum */
- X unsigned int v_pgpgout;
- X unsigned int v_pswpin;
- X unsigned int v_pswpout;
- X unsigned int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_oerrors;
- X int if_collisions;
- X unsigned int v_swtch;
- X int avenrun[3]; /* scaled by FSCALE */
- X rstat_timeval boottime;
- X rstat_timeval curtime;
- X int if_opackets;
- X};
- X
- Xstruct statsswtch { /* RSTATVERS_SWTCH */
- X int cp_time[CPUSTATES];
- X int dk_xfer[DK_NDRIVE];
- X unsigned int v_pgpgin; /* these are cumulative sum */
- X unsigned int v_pgpgout;
- X unsigned int v_pswpin;
- X unsigned int v_pswpout;
- X unsigned int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_oerrors;
- X int if_collisions;
- X unsigned int v_swtch;
- X unsigned int avenrun[3];/* scaled by FSCALE */
- X rstat_timeval boottime;
- X int if_opackets;
- X};
- X
- Xstruct stats { /* RSTATVERS_ORIG */
- X int cp_time[CPUSTATES];
- X int dk_xfer[DK_NDRIVE];
- X unsigned int v_pgpgin; /* these are cumulative sum */
- X unsigned int v_pgpgout;
- X unsigned int v_pswpin;
- X unsigned int v_pswpout;
- X unsigned int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_oerrors;
- X int if_collisions;
- X int if_opackets;
- X};
- X
- X
- Xprogram RSTATPROG {
- X /*
- X * variable number of disks and cpu states
- X */
- X version RSTATVERS_VAR {
- X statsvar
- X RSTATPROC_STATS(void) = 1;
- X
- X unsigned int
- X RSTATPROC_HAVEDISK(void) = 2;
- X } = 4;
- X /*
- X * version includes current time and context switching info
- X */
- X version RSTATVERS_TIME {
- X statstime
- X RSTATPROC_STATS(void) = 1;
- X
- X unsigned int
- X RSTATPROC_HAVEDISK(void) = 2;
- X } = 3;
- X /*
- X * Does not have current time
- X */
- X version RSTATVERS_SWTCH {
- X statsswtch
- X RSTATPROC_STATS(void) = 1;
- X
- X unsigned int
- X RSTATPROC_HAVEDISK(void) = 2;
- X } = 2;
- X /*
- X * Old version has no info about current time or context switching
- X */
- X version RSTATVERS_ORIG {
- X stats
- X RSTATPROC_STATS(void) = 1;
- X
- X unsigned int
- X RSTATPROC_HAVEDISK(void) = 2;
- X } = 1;
- X} = 100001;
- END_OF_FILE
- if test 4278 -ne `wc -c <'rstat.x'`; then
- echo shar: \"'rstat.x'\" unpacked with wrong size!
- fi
- # end of 'rstat.x'
- fi
- if test -f 'rstat.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rstat.h'\"
- else
- echo shar: Extracting \"'rstat.h'\" \(2556 characters\)
- sed "s/^X//" >'rstat.h' <<'END_OF_FILE'
- X/*
- X * Please do not edit this file.
- X * It was generated using rpcgen.
- X */
- X
- X#include <rpc/types.h>
- X
- X#ifndef FSCALE
- X/*
- X * Scale factor for scaled integers used to count load averages.
- X */
- X#define FSHIFT 8 /* bits to right of fixed binary point */
- X#define FSCALE (1<<FSHIFT)
- X
- X#endif /* ndef FSCALE */
- X#define CPUSTATES 4
- X#define DK_NDRIVE 4
- X
- Xstruct rstat_timeval {
- X u_int tv_sec;
- X u_int tv_usec;
- X};
- Xtypedef struct rstat_timeval rstat_timeval;
- Xbool_t xdr_rstat_timeval();
- X
- Xstruct statsvar {
- X struct {
- X u_int cp_time_len;
- X int *cp_time_val;
- X } cp_time;
- X struct {
- X u_int dk_xfer_len;
- X int *dk_xfer_val;
- X } dk_xfer;
- X u_int v_pgpgin;
- X u_int v_pgpgout;
- X u_int v_pswpin;
- X u_int v_pswpout;
- X u_int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_opackets;
- X int if_oerrors;
- X int if_collisions;
- X u_int v_swtch;
- X long avenrun[3];
- X rstat_timeval boottime;
- X rstat_timeval curtime;
- X};
- Xtypedef struct statsvar statsvar;
- Xbool_t xdr_statsvar();
- X
- Xstruct statstime {
- X int cp_time[CPUSTATES];
- X int dk_xfer[DK_NDRIVE];
- X u_int v_pgpgin;
- X u_int v_pgpgout;
- X u_int v_pswpin;
- X u_int v_pswpout;
- X u_int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_oerrors;
- X int if_collisions;
- X u_int v_swtch;
- X int avenrun[3];
- X rstat_timeval boottime;
- X rstat_timeval curtime;
- X int if_opackets;
- X};
- Xtypedef struct statstime statstime;
- Xbool_t xdr_statstime();
- X
- Xstruct statsswtch {
- X int cp_time[CPUSTATES];
- X int dk_xfer[DK_NDRIVE];
- X u_int v_pgpgin;
- X u_int v_pgpgout;
- X u_int v_pswpin;
- X u_int v_pswpout;
- X u_int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_oerrors;
- X int if_collisions;
- X u_int v_swtch;
- X u_int avenrun[3];
- X rstat_timeval boottime;
- X int if_opackets;
- X};
- Xtypedef struct statsswtch statsswtch;
- Xbool_t xdr_statsswtch();
- X
- Xstruct stats {
- X int cp_time[CPUSTATES];
- X int dk_xfer[DK_NDRIVE];
- X u_int v_pgpgin;
- X u_int v_pgpgout;
- X u_int v_pswpin;
- X u_int v_pswpout;
- X u_int v_intr;
- X int if_ipackets;
- X int if_ierrors;
- X int if_oerrors;
- X int if_collisions;
- X int if_opackets;
- X};
- Xtypedef struct stats stats;
- Xbool_t xdr_stats();
- X
- X#define RSTATPROG ((u_long)100001)
- X#define RSTATVERS_VAR ((u_long)4)
- X#define RSTATPROC_STATS ((u_long)1)
- Xextern statsvar *rstatproc_stats_4();
- X#define RSTATPROC_HAVEDISK ((u_long)2)
- Xextern u_int *rstatproc_havedisk_4();
- X#define RSTATVERS_TIME ((u_long)3)
- Xextern statstime *rstatproc_stats_3();
- Xextern u_int *rstatproc_havedisk_3();
- X#define RSTATVERS_SWTCH ((u_long)2)
- Xextern statsswtch *rstatproc_stats_2();
- Xextern u_int *rstatproc_havedisk_2();
- X#define RSTATVERS_ORIG ((u_long)1)
- Xextern stats *rstatproc_stats_1();
- Xextern u_int *rstatproc_havedisk_1();
- END_OF_FILE
- if test 2556 -ne `wc -c <'rstat.h'`; then
- echo shar: \"'rstat.h'\" unpacked with wrong size!
- fi
- # end of 'rstat.h'
- fi
- if test -f 'term.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'term.h'\"
- else
- echo shar: Extracting \"'term.h'\" \(87 characters\)
- sed "s/^X//" >'term.h' <<'END_OF_FILE'
- Xextern void init_termcap();
- Xextern void check_term();
- Xextern void clear();
- END_OF_FILE
- if test 87 -ne `wc -c <'term.h'`; then
- echo shar: \"'term.h'\" unpacked with wrong size!
- fi
- # end of 'term.h'
- fi
- echo shar: End of archive 1 \(of 4\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- echo "Now do 'sh ./configure' or 'sh ./configure -prefix=PATH' (Default = /usr/local)"
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- exit 0 # Just in case...
-