[comp.sources.bugs] perl 3.0 patch #2

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (11/11/89)

System: perl version 3.0
Patch #: 2
Priority: HIGH
Subject: Configure now does pwd.h right
Subject: Configure now looks up functions in -l libs
Subject: Configure now handles gcc cpp better
Subject: Configure now gets cpp flags from cc flags
Subject: Configure no longer relies on SIGTSTP to indicate BSDness
Subject: Configure may now set -DDEBUGGING
Subject: Configure now supports sizeof(long) > 4
Subject: Configure now locates csh
Subject: Configure now supports Wollongong sockets
Subject: Configure now gets sig names directly from signal.h
Subject: $sockethdr incorporated into $ccflags
Subject: $libs now has most of the -l libraries
Subject: non-BSD machines required two ^D's for <>
Subject: grow_dlevel() not inside #ifdef DEBUGGING
Subject: Configure now discovers if <sys/time.h> includes <time.h>
Subject: Configure now finds the wait4() routine
Subject: '-' x 26 made warnings about undefined value
Subject: eval with no args caused strangeness
Subject: local(@foo) didn't work, but local(@foo,$bar) did
Subject: printf %c, %D, %X and %O didn't work right
Subject: printf of unsigned vs signed needed separate casts on some machines
Subject: orthogonalized the file modes some so we can have <& +<& etc.
Subject: do_open() now detects sockets passed to process from parent
Subject: fd's above 2 are now closed on exec
Subject: csh code can now use csh from other than /bin
Subject: getsockopt, get{sock,peer}name didn't define result properly
Subject: warn("shutdown") was replicated
Subject: gethostbyname was misdeclared
Subject: telldir() is sometimes a macro
Subject: non-existent slice values are now undefined rather than null
Subject: mkdir and rmdir needed to quote argument when passed to shell
Subject: mkdir and rmdir now return better error codes
Subject: fileno, seekdir, rewinddir and closedir now disallow defaults
Subject: CX/UX needed to set the key each time in associative iterators
Subject: getopts.pl needed some explicit @ARGV refs
Subject: makedepend now uses cppflags determined by Configure
Subject: malloc pointer corruption check made more portable
Subject: netinet/in.h needed sys/types.h some places
Subject: more <sys/time.h> and <time.h> wrangling
Subject: yydebug moved to where type doesn't matter  
Subject: explained about sh and ${1+"$@"}
Subject: documented that space must separate word and '' string
Subject: made some line breaks depend on troff vs. nroff
Subject: example of unshift had args backwards
Subject: clarified operation of ^ and $ when $* is false
Subject: moved yydebug to where its type doesn't matter
Subject: !$foo++ was unreasonably illegal
Subject: local(@foo) didn't work
Subject: default args to unary operators didn't work
Subject: moved yydebug to where its type didn't matter
Subject: /[\000]/ didn't work
Subject: /\b$foo/ didn't work
Subject: sys_errlist[sys_nerr] is illegal
Subject: uchar gives Crays fits
Subject: t/TEST tried to run .rej files
Subject: added debugging to io.argv
Subject: trimmed filename to 14 chars
Subject: made mkdir/rmdir tests more portable
Subject: op.split blew up if no -DDEBUGGING
Subject: in op.stat, some machines need -c '/dev/printer'
Subject: fixed a CLINE macro conflict
Subject: made dup2 a little better
Subject: in s2p, + within patterns needed backslashing
Subject: s2p was printing out some debugging info to the output file
Subject: in a2p, awk script with no line actions still needs main loop

Description:
	The metaconfig problem with pw_* fields has been fixed.

	When you specify extra libraries to link in, Configure now
	uses those libraries as well as libc to look for the functions
	that are available.  From the ccflags you give it now derives
	the corresponding flags for the C preprocessor.  And it has
	better support for the Gnu C preprocessor.

	Configure now detects USGness by the behavior of the tr program.
	If USGness isn't found, then SIGTSTP determines BSDness.

	The define of DEBUGGING has been taken out of perl.h and a2p.h.
	If you want debugging you have to add -DDEBUGGING in a cc flag.
	If you give an optimizer flag of -g, you get DEBUGGING as a
	default.

	Machines like the Cray have longs longer than 4 bytes.  There
	is now support for that.

	Some machines have csh in other places than /bin.  Configure
	now figures out where it is.

	Configure now supports Wollongong sockets and knows about
	/usr/netinclude and /usr/lib/libnet.a.

	Configure now gets sig names directly from signal.h if possible,
	and only if that fails does it try to use kill -l.

	The $sockethdr variable has been incorporated into $ccflags

	Non-BSD machines required two ^D's to exit

		while (<>) { ... }

	This has been fixed, I believe, though I can't test it here.

	It's now possible to compile perl without the DEBUGGING code.
	It runs about 10% faster when you take the code out.

	Configure now discovers if <sys/time.h> includes <time.h>, or
	whether perl must include it itself.

	Configure now finds the wait4() routine if available.

	'-' x 26 made warnings about undefined value because of a bug
	in evalstatic().  (Non-static 'x' didn't have the problem.)

	A local list consisting of nothing but an array didn't work
	right.  Now it does.

	A printf %c omitted the format string between the preceeding % field
	and the %c.  Code to printf %D, %X and %O was misplaced.

	Some machines complain about printing signed values with
	unsigned format specifiers like %x.  The unsigned specifiers
	now have a separate cast from the signed specifiers like %d.

	The various file modes were not orthogonal.  Now you can use
	any of:
		< > >> +< +> +>> <& >& >>& +<& +>& +>>&

	Perl can now detect when a parent process passes in a socket so
	that you can write reasonable inetd servers.

	File descriptors above 2 are now closed on exec, either by using
	the fcntl(), or if unavailable, brute force closing in a loop.

	The return values of getsockopt(), getsockname() and getpeername()
	were always undefined.

	There were several places where a warn("shutdown") had to be
	changed to some other function name.

	The C routine gethostbyname() was misdeclared as gethostbynam().

	telldir() is sometimes a macro, so we can't declare its return
	value if it's defined.

	Components of a slice corresponding to non-existent index elements
	are now undefined rather than just null.

	The mkdir and rmdir function will call the mkdir and rmdir
	programs if the corresponding system calls aren't available.
	The name of the directory was not quoted properly however.
	Also, some attempt is now made to translate the odd messages
	that some mkdirs and rmdir return into reasonable error codes.
	As a final check for mkdir programs that return NO useful status,
	a stat is done following the mkdir or rmdir to make sure the
	directory is really there or gone.

	The fileno, seekdir, rewinddir and closedir functions now specifically
	disallow defaults and return undef.  Previously they would just crash
	perl.

	CX/UX needs to set the key each time when iterating over associative
	arrays due to a non-standard dbm_nextkey() function.

	The lib/getopts.pl routine needed to shift @ARGV explicitly in
	several spots.

	The malloc pointer corruption check was made more portable by just
	checking for alignment errors.  It also is removed if DEBUGGING
	is not enabled.

	The include of <netinet/in.h> needed to be moved down below the
	include of <sys/types.h> for some machines.

	Not all machines declare the yydebug variable as the same type.
	The reference to yydebug was moved to perl.y where it doesn't care.

	I documented that a space must separate any word and a subsequent
	single-quoted string because of package name prefixes.

	Some long lines were broken for nroff, but not for troff.

	One example of unshift in the manual had its arguments backwards.

	I clarified that operation of ^ and $ on multiline strings when $*
	is false is somewhat inconsistent.

	People were forced to say !($foo++) when !$foo++ should be legal.

	None of the unary operators correctly handled their default
	arguments because of a screw-up in the parser actions.

	/[\000]/ never matched a null due to some left over non-binary-ness
	of perl 2.0.

	/\b$foo/ gave up too early in trying to match at the end of a string.

	sys_nerr was being used as the maximum error message number, when
	in fact it's the maximum+1.

	The identifier "uchar" is a typedef on Crays, so the variable of that
	name was changed to "unchar".

	The TEST program tried to run patch reject files.  The reject files
	are now rejected by TEST.

	One test failed on picky systems because it referred to a filename
	longer than 14 chars.

	The op.split test assumed that the perl -D switch was available,
	when in fact it's only available if perl was compiled with DEBUGGING.

	Some header file somewhere defined macro CLINE, which conflicted
	with toke.c's CLINE macro.

	In s2p, + within patterns needed backslashing because + isn't a
	metacharacter for sed.  s2p was also printing out some debugging
	info to the output file.

	In a2p, an awk script with no line actions didn't make a main
	loop, but it needs one to keep the awk semantics.


Fix:	From rn, say "| patch -p -N -d DIR", where DIR is your perl source
	directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
	If you don't have the patch program, apply the following by hand,
	or get patch (version 2.0, latest patchlevel).

	After patching:

	    *** DO NOT RECOMPILE--APPLY PATCHES 3 AND 4 NEXT ***

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel.h file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

	If you are missing previous patches they can be obtained from me:

	Larry Wall
	lwall@jpl-devvax.jpl.nasa.gov

	If you send a mail message of the following form it will greatly speed
	processing:

	Subject: Command
	@SH mailpatch PATH perl 3.0 LIST
		   ^ note the c

	where PATH is a return path FROM ME TO YOU either in Internet notation,
	or in bang notation from some well-known host, and LIST is the number
	of one or more patches you need, separated by spaces, commas, and/or
	hyphens.  Saying 35- says everything from 35 to the end.


	You can also get the patches via anonymous FTP from
	jpl-devvax.jpl.nasa.gov (128.149.1.143).

Index: patchlevel.h
Prereq: 1
1c1
< #define PATCHLEVEL 1
---
> #define PATCHLEVEL 2

Index: Configure
Prereq: 3.0.1.1
*** Configure.old	Sat Nov 11 05:10:01 1989
--- Configure	Sat Nov 11 05:10:08 1989
***************
*** 8,14 ****
  # and edit it to reflect your system.  Some packages may include samples
  # of config.h for certain machines, so you might look for one of those.)
  #
! # $Header: Configure,v 3.0.1.1 89/10/26 22:58:02 lwall Locked $
  #
  # Yes, you may rip this off to use in other distribution packages.
  # (Note: this Configure script was generated automatically.  Rather than
--- 8,14 ----
  # and edit it to reflect your system.  Some packages may include samples
  # of config.h for certain machines, so you might look for one of those.)
  #
! # $Header: Configure,v 3.0.1.2 89/11/11 04:05:37 lwall Locked $
  #
  # Yes, you may rip this off to use in other distribution packages.
  # (Note: this Configure script was generated automatically.  Rather than
***************
*** 39,46 ****
  esac
  
  d_eunice=''
- eunicefix=''
  define=''
  loclist=''
  expr=''
  sed=''
--- 39,46 ----
  esac
  
  d_eunice=''
  define=''
+ eunicefix=''
  loclist=''
  expr=''
  sed=''
***************
*** 91,96 ****
--- 91,97 ----
  touch=''
  make=''
  date=''
+ csh=''
  Log=''
  Header=''
  bin=''
***************
*** 103,108 ****
--- 104,110 ----
  d_charsprf=''
  d_crypt=''
  cryptlib=''
+ d_csh=''
  d_dosuid=''
  d_dup2=''
  d_fchmod=''
***************
*** 139,145 ****
  d_sockpair=''
  d_oldsock=''
  socketlib=''
- sockethdr=''
  d_statblks=''
  d_stdstdio=''
  d_strctcpy=''
--- 141,146 ----
***************
*** 147,157 ****
--- 148,160 ----
  d_syscall=''
  d_tminsys=''
  i_systime=''
+ i_timetoo=''
  d_varargs=''
  d_vfork=''
  d_voidsig=''
  d_vprintf=''
  d_charvspr=''
+ d_wait4=''
  gidtype=''
  i_dirent=''
  d_dirnamlen=''
***************
*** 161,166 ****
--- 164,172 ----
  i_pwd=''
  d_pwquota=''
  d_pwage=''
+ d_pwchange=''
+ d_pwclass=''
+ d_pwexpire=''
  i_sysdir=''
  i_sysioctl=''
  i_varargs=''
***************
*** 167,174 ****
  i_vfork=''
  intsize=''
  libc=''
- libdbm=''
- libndir=''
  libnm=''
  mallocsrc=''
  mallocobj=''
--- 173,178 ----
***************
*** 183,188 ****
--- 187,193 ----
  huge=''
  optimize=''
  ccflags=''
+ cppflags=''
  ldflags=''
  cc=''
  libs=''
***************
*** 230,236 ****
  
  echo "First let's make sure your kit is complete.  Checking..."
  (cd ..; awk '' `awk '$1 !~ /PACKINGLIST/ {print $1}' MANIFEST` >/dev/null || kill $$)
! echo " "
  
  attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
--- 235,241 ----
  
  echo "First let's make sure your kit is complete.  Checking..."
  (cd ..; awk '' `awk '$1 !~ /PACKINGLIST/ {print $1}' MANIFEST` >/dev/null || kill $$)
! echo "Looks good..."
  
  attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
***************
*** 242,247 ****
--- 247,253 ----
  pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb"
  d_newshome="/usr/NeWS"
  defvoidused=7
+ libswanted="net nm ndir ndbm dbm c_s"
  
  : some greps do not return status, grrr.
  echo "grimblepritz" >grimble
***************
*** 264,269 ****
--- 270,335 ----
  chmod +x contains
  esac
  
+ : see if sh knows # comments
+ echo " "
+ echo "Checking your sh to see if it knows about # comments..."
+ if sh -c '#' >/dev/null 2>&1 ; then
+     echo "Your sh handles # comments correctly."
+     shsharp=true
+     spitshell=cat
+     echo " "
+     echo "Okay, let's see if #! works on this system..."
+     echo "#!/bin/echo hi" > try
+     $eunicefix try
+     chmod +x try
+     try > today
+     if $contains hi today >/dev/null 2>&1; then
+ 	echo "It does."
+ 	sharpbang='#!'
+     else
+ 	echo "#! /bin/echo hi" > try
+ 	$eunicefix try
+ 	chmod +x try
+ 	try > today
+ 	if test -s today; then
+ 	    echo "It does."
+ 	    sharpbang='#! '
+ 	else
+ 	    echo "It doesn't."
+ 	    sharpbang=': use '
+ 	fi
+     fi
+ else
+     echo "Your sh doesn't grok # comments--I will strip them later on."
+     shsharp=false
+     echo "exec grep -v '^#'" >spitshell
+     chmod +x spitshell
+     $eunicefix spitshell
+     spitshell=`pwd`/spitshell
+     echo "I presume that if # doesn't work, #! won't work either!"
+     sharpbang=': use '
+ fi
+ 
+ : figure out how to guarantee sh startup
+ echo " "
+ echo "Checking out how to guarantee sh startup..."
+ startsh=$sharpbang'/bin/sh'
+ echo "Let's see if '$startsh' works..."
+ cat >try <<EOSS
+ $startsh
+ set abc
+ test "$?abc" != 1
+ EOSS
+ 
+ chmod +x try
+ $eunicefix try
+ if try; then
+     echo "Yup, it does."
+ else
+     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
+ fi
+ rm -f try today
+ 
  : first determine how to suppress newline on echo command
  echo "Checking echo to see how to suppress newlines..."
  (echo "hi there\c" ; echo " ") >.echotmp
***************
*** 423,428 ****
--- 489,495 ----
  trylist="
  Mcc
  cpp
+ csh
  egrep
  test
  "
***************
*** 512,732 ****
  esac
  rmlist="$rmlist loc"
  
- : get list of predefined functions in a handy place
- echo " "
- set /usr/lib/libc.so.[0-9]*
- eval set \$$#
- if test -f "$1"; then
-     echo "Your shared C library is in $1."
-     libc="$1"
- elif test -f /lib/libc.a; then
-     echo "Your C library is in /lib/libc.a.  You're normal."
-     libc=/lib/libc.a
- else
-     ans=`loc libc.a blurfl/dyick $libpth`
-     if test ! -f "$ans"; then
- 	ans=`loc clib blurfl/dyick $libpth`
-     fi
-     if test ! -f "$ans"; then
- 	ans=`loc libc blurfl/dyick $libpth`
-     fi
-     if test ! -f "$ans"; then
- 	ans=`loc Slibc.a blurfl/dyick /usr/lib/386 /lib/386 $libpth`
-     fi
-     if test ! -f "$ans"; then
- 	ans=`loc Mlibc.a blurfl/dyick $libpth`
-     fi
-     if test ! -f "$ans"; then
- 	ans=`loc Llibc.a blurfl/dyick $libpth`
-     fi
-     if test -f "$ans"; then
- 	echo "Your C library is in $ans, of all places."
- 	libc=$ans
-     else
- 	if test -f "$libc"; then
- 	    echo "Your C library is in $libc, like you said before."
- 	else
- 	    cat <<EOM
-  
- I can't seem to find your C library.  I've looked in the following places:
- 
- 	$libpth
- 
- None of these seems to contain your C library.  What is the full name
- EOM
- 	    dflt=None
- 	    $echo $n "of your C library? $c"
- 	    rp='C library full name?'
- 	    . myread
- 	    libc="$ans"
- 	fi
-     fi
- fi
- echo " "
- $echo $n "Extracting names from $libc for later perusal...$c"
- nm $libc 2>/dev/null >libc.tmp
- $sed -n -e 's/^.* [AT]  *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
- if $contains '^printf$' libc.list >/dev/null 2>&1; then
-     echo "done"
- else
-     $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
-     $contains '^printf$' libc.list >/dev/null 2>&1 || \
- 	$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list
-     $contains '^printf$' libc.list >/dev/null 2>&1 || \
-        $sed -n -e 's/^_//' \
- 	      -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list
-     if $contains '^printf$' libc.list >/dev/null 2>&1; then
- 	echo "done"
-     else
- 	echo " "
- 	echo "nm didn't seem to work right."
- 	echo "Trying ar instead..."
- 	if ar t $libc > libc.tmp; then
- 	    $sed -e 's/\.o$//' < libc.tmp > libc.list
- 	    echo "Ok."
- 	else
- 	    echo "ar didn't seem to work right."
- 	    echo "Maybe this is a Cray...trying bld instead..."
- 	    if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
- 		echo "Ok."
- 	    else
- 	    	echo "That didn't work either.  Giving up."
- 	    	exit 1
- 	    fi
- 	fi
-     fi
- fi
- 
- inlibc='echo " ";
- if $contains "^$1\$" libc.list >/dev/null 2>&1;
- then echo "$1() found"; eval "$2=$define";
- else echo "$1() not found"; eval "$2=$undef"; fi'
- 
- rmlist="$rmlist libc.tmp libc.list"
- 
- : make some quick guesses about what we are up against
- echo " "
- $echo $n "Hmm...  $c"
- cat /usr/include/signal.h /usr/include/sys/signal.h >foo
- if $contains SIGTSTP foo >/dev/null 2>&1 ; then
-     echo "Looks kind of like a BSD system, but we'll see..."
-     echo exit 0 >bsd
-     echo exit 1 >usg
-     echo exit 1 >v7
- elif $contains '^fcntl$' libc.list >/dev/null 2>&1 ; then
-     echo "Looks kind of like a USG system, but we'll see..."
-     echo exit 1 >bsd
-     echo exit 0 >usg
-     echo exit 1 >v7
- else
-     echo "Looks kind of like a version 7 system, but we'll see..."
-     echo exit 1 >bsd
-     echo exit 1 >usg
-     echo exit 0 >v7
- fi
- if $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
-     cat <<'EOI'
- There is, however, a strange, musty smell in the air that reminds me of
- something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
- EOI
-     echo "exit 0" >eunice
-     eunicefix=unixtovms
-     d_eunice="$define"
- : it so happens the Eunice I know will not run shell scripts in Unix format
- else
-     echo " "
-     echo "Congratulations.  You aren't running Eunice."
-     eunicefix=':'
-     d_eunice="$undef"
-     echo "exit 1" >eunice
- fi
- if test -f /xenix; then
-     echo "Actually, this looks more like a XENIX system..."
-     echo "exit 0" >xenix
- else
-     echo " "
-     echo "It's not Xenix..."
-     echo "exit 1" >xenix
- fi
- chmod +x xenix
- $eunicefix xenix
- if test -f /venix; then
-     echo "Actually, this looks more like a VENIX system..."
-     echo "exit 0" >venix
- else
-     echo " "
-     if xenix; then
- 	: null
-     else
- 	echo "Nor is it Venix..."
-     fi
-     echo "exit 1" >venix
- fi
- chmod +x bsd usg v7 eunice venix
- $eunicefix bsd usg v7 eunice venix
- rm -rf foo
- rmlist="$rmlist bsd usg v7 eunice venix xenix"
- 
- : see if sh knows # comments
- echo " "
- echo "Checking your sh to see if it knows about # comments..."
- if sh -c '#' >/dev/null 2>&1 ; then
-     echo "Your sh handles # comments correctly."
-     shsharp=true
-     spitshell=cat
-     echo " "
-     echo "Okay, let's see if #! works on this system..."
-     echo "#!/bin/echo hi" > try
-     $eunicefix try
-     chmod +x try
-     try > today
-     if $contains hi today >/dev/null 2>&1; then
- 	echo "It does."
- 	sharpbang='#!'
-     else
- 	echo "#! /bin/echo hi" > try
- 	$eunicefix try
- 	chmod +x try
- 	try > today
- 	if test -s today; then
- 	    echo "It does."
- 	    sharpbang='#! '
- 	else
- 	    echo "It doesn't."
- 	    sharpbang=': use '
- 	fi
-     fi
- else
-     echo "Your sh doesn't grok # comments--I will strip them later on."
-     shsharp=false
-     echo "exec grep -v '^#'" >spitshell
-     chmod +x spitshell
-     $eunicefix spitshell
-     spitshell=`pwd`/spitshell
-     echo "I presume that if # doesn't work, #! won't work either!"
-     sharpbang=': use '
- fi
- 
- : figure out how to guarantee sh startup
- echo " "
- echo "Checking out how to guarantee sh startup..."
- startsh=$sharpbang'/bin/sh'
- echo "Let's see if '$startsh' works..."
- cat >try <<EOSS
- $startsh
- set abc
- test "$?abc" != 1
- EOSS
- 
- chmod +x try
- $eunicefix try
- if try; then
-     echo "Yup, it does."
- else
-     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
- fi
- rm -f try today
- 
  : set up shell script to do ~ expansion
  cat >filexp <<EOSS
  $startsh
--- 579,584 ----
***************
*** 858,863 ****
--- 710,778 ----
      ;;
  esac
  
+ : make some quick guesses about what we are up against
+ echo " "
+ $echo $n "Hmm...  $c"
+ cat /usr/include/signal.h /usr/include/sys/signal.h >foo
+ if test `echo abc | tr a-z A-Z` = Abc ; then
+     echo "Looks kind of like a USG system, but we'll see..."
+     echo exit 1 >bsd
+     echo exit 0 >usg
+     echo exit 1 >v7
+ elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
+     echo "Looks kind of like a BSD system, but we'll see..."
+     echo exit 0 >bsd
+     echo exit 1 >usg
+     echo exit 1 >v7
+ else
+     echo "Looks kind of like a version 7 system, but we'll see..."
+     echo exit 1 >bsd
+     echo exit 1 >usg
+     echo exit 0 >v7
+ fi
+ case "$eunicefix" in
+ *unixtovms*)
+     cat <<'EOI'
+ There is, however, a strange, musty smell in the air that reminds me of
+ something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
+ EOI
+     echo "exit 0" >eunice
+     d_eunice="$define"
+     ;;
+ *)
+     echo " "
+     echo "Congratulations.  You aren't running Eunice."
+     d_eunice="$undef"
+     echo "exit 1" >eunice
+     ;;
+ esac
+ if test -f /xenix; then
+     echo "Actually, this looks more like a XENIX system..."
+     echo "exit 0" >xenix
+ else
+     echo " "
+     echo "It's not Xenix..."
+     echo "exit 1" >xenix
+ fi
+ chmod +x xenix
+ $eunicefix xenix
+ if test -f /venix; then
+     echo "Actually, this looks more like a VENIX system..."
+     echo "exit 0" >venix
+ else
+     echo " "
+     if xenix; then
+ 	: null
+     else
+ 	echo "Nor is it Venix..."
+     fi
+     echo "exit 1" >venix
+ fi
+ chmod +x bsd usg v7 eunice venix
+ $eunicefix bsd usg v7 eunice venix
+ rm -rf foo
+ rmlist="$rmlist bsd usg v7 eunice venix xenix"
+ 
  : see what memory models we can support
  case "$models" in
  '')
***************
*** 1078,1083 ****
--- 993,999 ----
      ;;
  esac
  cat <<EOH
+ 
  Some C compilers have problems with their optimizers, by default, $package
  compiles with the -O flag to use the optimizer.  Alternately, you might
  want to use the symbolic debugger, which uses the -g flag (on traditional
***************
*** 1096,1108 ****
  
  case "$ccflags" in
  '') case "$cc" in
!     gcc) dflt='-fpcc-struct-return';;
      *) dflt='none';;
      esac
      ;;
  *) dflt="$ccflags";;
  esac
! echo " "
  rp="Any additional cc flags? [$dflt]"
  $echo $n "$rp $c"
  . myread
--- 1012,1045 ----
  
  case "$ccflags" in
  '') case "$cc" in
!     *gcc*) dflt='-fpcc-struct-return';;
      *) dflt='none';;
      esac
      ;;
  *) dflt="$ccflags";;
  esac
! if test -d /usr/netinclude; then
!     case "$dflt" in
!     *netinclude*);;
!     *) dflt="$dflt -I/usr/netinclude";;
!     esac
! fi
! case "$optimize" in
! -g*)
!     case "$dflt" in
!     *DEBUGGING*);;
!     *) dflt="$dflt -DDEBUGGING";;
!     esac
!     ;;
! esac
! cat <<EOH
! 
! Your C compiler may want other flags.  For this question you should
! include -I/whatever and -DWHATEVER flags and any other flags used by
! the C compiler, but you should NOT include libraries or ld flags like
! -lwhatever.  To use no flags, specify the word "none".
!   
! EOH
  rp="Any additional cc flags? [$dflt]"
  $echo $n "$rp $c"
  . myread
***************
*** 1111,1116 ****
--- 1048,1073 ----
  esac
  ccflags="$ans"
  
+ : the following weeds options from ccflags that are of no interest to cpp
+ cppflags="$ccflags"
+ case "$cc" in
+ *gcc*) cppflags="$cppflags -D__GNUC__";;
+ esac
+ case "$cppflags" in
+ '');;
+ *)  set X $cppflags
+     cppflags=''
+     for flag do
+ 	case $flag in
+ 	-D*|-I*) cppflags="$cppflags $flag";;
+ 	esac
+     done
+     case "$cppflags" in
+     *-*)  echo "(C preprocessor flags: $cppflags)";;
+     esac
+     ;;
+ esac
+ 
  case "$ldflags" in
  '') if venix; then
  	dflt='-i -z'
***************
*** 1130,1139 ****
  ldflags="$ans"
  rmlist="$rmlist pdp11"
  
  case "$libs" in
! '') dflt='none';;
  *) dflt="$libs";;
  esac
  
  $cat <<EOM
   
--- 1087,1124 ----
  ldflags="$ans"
  rmlist="$rmlist pdp11"
  
+ echo " "
+ echo "Checking for optional libraries..."
  case "$libs" in
! '') dflt='';;
  *) dflt="$libs";;
  esac
+ case "$libswanted" in
+ '') libswanted='c_s';;
+ esac
+ for thislib in $libswanted; do
+     if xxx=`loc lib$thislib.a X /usr/lib /usr/local/lib /lib`; then
+ 	echo "Found -l$thislib."
+ 	case "$dflt" in
+ 	*-l$thislib*);;
+ 	*) dflt="$dflt -l$thislib";;
+ 	esac
+     elif xxx=`loc lib$thislib.a X $libpth`; then
+ 	echo "Found $xxx."
+ 	case "$dflt" in
+ 	*$xxx*);;
+ 	*) dflt="$dflt $xxx";;
+ 	esac
+     else
+ 	echo "No -l$thislib."
+     fi
+ done
+ set X $dflt
+ shift
+ dflt="$*"
+ case "$dflt" in
+ '') dflt='none';;
+ esac
  
  $cat <<EOM
   
***************
*** 1165,1172 ****
  In the following, larger digits indicate more significance.  A big-endian
  machine like a Pyramid or a Motorola 680?0 chip will come out to 4321.  A
  little-endian machine like a Vax or an Intel 80?86 chip would be 1234.  Other
! machines may have weird orders like 3412.  If the test program works the
! default is probably right.  I'm now running the test program...
  EOM
      $cat >try.c <<'EOCP'
  #include <stdio.h>
--- 1150,1158 ----
  In the following, larger digits indicate more significance.  A big-endian
  machine like a Pyramid or a Motorola 680?0 chip will come out to 4321.  A
  little-endian machine like a Vax or an Intel 80?86 chip would be 1234.  Other
! machines may have weird orders like 3412.  A Cray will report 87654321.  If
! the test program works the default is probably right.
! I'm now running the test program...
  EOM
      $cat >try.c <<'EOCP'
  #include <stdio.h>
***************
*** 1175,1191 ****
      int i;
      union {
  	unsigned long l;
! 	char c[4];
      } u;
  
!     u.l = 0x04030201;
!     printf("%c%c%c%c\n", u.c[0]+'0', u.c[1]+'0', u.c[2]+'0', u.c[3]+'0');
  }
  EOCP
      if $cc try.c -o try >/dev/null 2>&1 ; then
  	dflt=`try`
  	case "$dflt" in
! 	????) echo "(The test program ran ok.)";;
  	*) echo "(The test program didn't run right for some reason.)";;
  	esac
      else
--- 1161,1179 ----
      int i;
      union {
  	unsigned long l;
! 	char c[8];
      } u;
  
!     u.l = 0x0807060504030201;
!     for (i=0; i < sizeof(long); i++)
! 	printf("%c",u.c[i]+'0');
!     printf("\n");
  }
  EOCP
      if $cc try.c -o try >/dev/null 2>&1 ; then
  	dflt=`try`
  	case "$dflt" in
! 	????|????????) echo "(The test program ran ok.)";;
  	*) echo "(The test program didn't run right for some reason.)";;
  	esac
      else
***************
*** 1214,1219 ****
--- 1202,1224 ----
  EOT
  echo 'Maybe "'"$cc"' -E" will work...'
  $cc -E <testcpp.c >testcpp.out 2>&1
+ : try to force gcc preprocessor if that is the compiler they are using
+ case $? in
+ 0) cppstdin="$cc -E";;
+ *) case "$cc" in
+     *gcc*)
+ 	cd ..
+ 	echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
+ 	echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
+ 	chmod 755 cppstdin
+ 	cppstdin=`pwd`/cppstdin
+ 	cppminus='';
+ 	cd UU
+ 	$cppstdin <testcpp.c >testcpp.out 2>&1
+ 	;;
+     esac
+     ;;
+ esac
  if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
      echo "Yup, it does."
      cppstdin="$cc -E"
***************
*** 1296,1301 ****
--- 1301,1437 ----
  fi
  rm -f testcpp.c testcpp.out
  
+ : get list of predefined functions in a handy place
+ echo " "
+ case "$libc" in
+ '') libc=unknown;;
+ esac
+ case "$libpth" in
+ '') libpth='/lib /usr/lib /usr/local/lib';;
+ esac
+ case "$libs" in
+ *-lc_s*) libc=`loc libc_s.a $libc $libpth`
+ esac
+ libnames='';
+ case "$libs" in
+ '') ;;
+ *)  for thislib in $libs; do
+ 	case "$thislib" in
+ 	-l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
+ 	    try=`loc lib$thislib.a blurfl/dyick $libpth`
+ 	    if test ! -f $try; then
+ 		try=`loc lib$thislib blurfl/dyick $libpth`
+ 		if test ! -f $try; then
+ 		    try=`loc $thislib blurfl/dyick $libpth`
+ 		    if test ! -f $try; then
+ 			try=''
+ 		    fi
+ 		fi
+ 	    fi
+ 	    libnames="$libnames $try"
+ 	    ;;
+ 	*) libnames="$libnames $thisname" ;;
+ 	esac
+     done
+     ;;
+ esac
+ set /usr/lib/libc.so.[0-9]*
+ eval set \$$#
+ if test -f "$1"; then
+     echo "Your shared C library is in $1."
+     libc="$1"
+ elif test -f $libc; then
+     echo "Your C library is in $libc, like you said before."
+ elif test -f /lib/libc.a; then
+     echo "Your C library is in /lib/libc.a.  You're normal."
+     libc=/lib/libc.a
+ else
+     ans=`loc libc.a blurfl/dyick $libpth`
+     if test ! -f "$ans"; then
+ 	ans=`loc libc blurfl/dyick $libpth`
+     fi
+     if test ! -f "$ans"; then
+ 	ans=`loc clib blurfl/dyick $libpth`
+     fi
+     if test ! -f "$ans"; then
+ 	ans=`loc Slibc.a blurfl/dyick /usr/lib/386 /lib/386 $libpth`
+     fi
+     if test ! -f "$ans"; then
+ 	ans=`loc Mlibc.a blurfl/dyick $libpth`
+     fi
+     if test ! -f "$ans"; then
+ 	ans=`loc Llibc.a blurfl/dyick $libpth`
+     fi
+     if test -f "$ans"; then
+ 	echo "Your C library is in $ans, of all places."
+ 	libc=$ans
+     else
+ 	cat <<EOM
+  
+ I can't seem to find your C library.  I've looked in the following places:
+ 
+ 	$libpth
+ 
+ None of these seems to contain your C library.  What is the full name
+ EOM
+ 	dflt=None
+ 	$echo $n "of your C library? $c"
+ 	rp='C library full name?'
+ 	. myread
+ 	libc="$ans"
+     fi
+ fi
+ echo " "
+ set $libc $libnames
+ $echo $n "Extracting names from $* for later perusal...$c"
+ nm $* 2>/dev/null >libc.tmp
+ $sed -n -e 's/^.* [AT]  *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
+ if $contains '^printf$' libc.list >/dev/null 2>&1; then
+     echo "done"
+ else
+     $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
+     $contains '^printf$' libc.list >/dev/null 2>&1 || \
+ 	$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list
+     $contains '^printf$' libc.list >/dev/null 2>&1 || \
+        $sed -n -e 's/^_//' \
+ 	      -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list
+     if $contains '^printf$' libc.list >/dev/null 2>&1; then
+ 	echo "done"
+     else
+ 	echo " "
+ 	echo "nm didn't seem to work right."
+ 	echo "Trying ar instead..."
+ 	if ar t $libc > libc.tmp; then
+ 	    for thisname in $libnames; do
+ 		ar t $thisname >>libc.tmp
+ 	    done
+ 	    $sed -e 's/\.o$//' < libc.tmp > libc.list
+ 	    echo "Ok."
+ 	else
+ 	    echo "ar didn't seem to work right."
+ 	    echo "Maybe this is a Cray...trying bld instead..."
+ 	    if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
+ 		for thisname in $libnames; do
+ 		    bld t $libnames | \
+ 			$sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
+ 		    ar t $thisname >>libc.tmp
+ 		done
+ 		echo "Ok."
+ 	    else
+ 	    	echo "That didn't work either.  Giving up."
+ 	    	exit 1
+ 	    fi
+ 	fi
+     fi
+ fi
+ 
+ inlibc='echo " ";
+ if $contains "^$1\$" libc.list >/dev/null 2>&1;
+ then echo "$1() found"; eval "$2=$define";
+ else echo "$1() not found"; eval "$2=$undef"; fi'
+ 
+ rmlist="$rmlist libc.tmp libc.list"
+ 
  : see if bcmp exists
  set bcmp d_bcmp
  eval $inlibc
***************
*** 1383,1388 ****
--- 1519,1530 ----
      fi
  fi
  
+ : get csh whereabouts
+ case "$csh" in
+ 'csh') d_csh="$undef" ;;
+ *)     d_csh="$define" ;;
+ esac
+ 
  : see if this is a dirent system
  echo " "
  if $test -r /usr/include/dirent.h ; then
***************
*** 1529,1535 ****
  
  : see if ndbm is available
  echo " "
! if $test -r /usr/include/ndbm.h || $test -r /usr/local/include/ndbm.h; then
      d_ndbm="$define"
      echo "ndbm.h found."
  else
--- 1671,1677 ----
  
  : see if ndbm is available
  echo " "
! if xxx=`loc ndbm.h x /usr/include /usr/local/include /usr/netinclude`; then
      d_ndbm="$define"
      echo "ndbm.h found."
  else
***************
*** 1539,1545 ****
  
  : see if we have the old dbm
  echo " "
! if $test -r /usr/include/dbm.h ; then
      d_odbm="$define"
      echo "dbm.h found."
  else
--- 1681,1687 ----
  
  : see if we have the old dbm
  echo " "
! if xxx=`loc dbm.h x /usr/include /usr/local/include /usr/netinclude`; then
      d_odbm="$define"
      echo "dbm.h found."
  else
***************
*** 1552,1582 ****
  if $test -r /usr/include/pwd.h ; then
      i_pwd="$define"
      echo "pwd.h found."
!     if $contains 'pw_quota' /usr/include/pwd.h >/dev/null 2>&1; then
  	d_pwquota="$define"
      else
  	d_pwquota="$undef"
      fi
!     if $contains 'pw_age' /usr/include/pwd.h >/dev/null 2>&1; then
  	d_pwage="$define"
      else
  	d_pwage="$undef"
      fi
!     if $contains 'pw_change' /usr/include/pwd.h >/dev/null 2>&1; then
  	d_pwchange="$define"
      else
  	d_pwchange="$undef"
      fi
!     if $contains 'pw_class' /usr/include/pwd.h >/dev/null 2>&1; then
  	d_pwclass="$define"
      else
  	d_pwclass="$undef"
      fi
!     if $contains 'pw_expire' /usr/include/pwd.h >/dev/null 2>&1; then
  	d_pwexpire="$define"
      else
  	d_pwexpire="$undef"
      fi
  else
      i_pwd="$undef"
      d_pwquota="$undef"
--- 1694,1726 ----
  if $test -r /usr/include/pwd.h ; then
      i_pwd="$define"
      echo "pwd.h found."
!     $cppstdin $cppflags </usr/include/pwd.h >$$.h
!     if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
  	d_pwquota="$define"
      else
  	d_pwquota="$undef"
      fi
!     if $contains 'pw_age' $$.h >/dev/null 2>&1; then
  	d_pwage="$define"
      else
  	d_pwage="$undef"
      fi
!     if $contains 'pw_change' $$.h >/dev/null 2>&1; then
  	d_pwchange="$define"
      else
  	d_pwchange="$undef"
      fi
!     if $contains 'pw_class' $$.h >/dev/null 2>&1; then
  	d_pwclass="$define"
      else
  	d_pwclass="$undef"
      fi
!     if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
  	d_pwexpire="$define"
      else
  	d_pwexpire="$undef"
      fi
+     rm -f $$.h
  else
      i_pwd="$undef"
      d_pwquota="$undef"
***************
*** 1636,1642 ****
  eval $inlibc
  
  socketlib=''
- sockethdr=''
  : see whether socket exists
  echo " "
  if $contains socket libc.list >/dev/null 2>&1; then
--- 1780,1785 ----
***************
*** 1665,1671 ****
  	    if $contains socket libc.list >/dev/null 2>&1; then
  		echo "but the Wollongong group seems to have hacked it in."
  		socketlib="-lnet"
- 		sockethdr="-I/usr/netinclude"
  		d_socket="$define"
  		: now check for advanced features
  		if $contains setsockopt libc.list >/dev/null 2>&1; then
--- 1808,1813 ----
***************
*** 1767,1772 ****
--- 1909,1919 ----
      d_tminsys="$define"
      i_systime="$define"
  fi
+ if $contains '^#.*include.*<time\.h>' /usr/include/sys/time.h >/dev/null 2>&1 ; then
+     i_timetoo="$undef"
+ else
+     i_timetoo="$define"
+ fi
  
  : see if this is a varargs system
  echo " "
***************
*** 1792,1797 ****
--- 1939,1948 ----
      d_voidsig="$undef"
  fi
  
+ : see if there is a wait4
+ set wait4 d_wait4
+ eval $inlibc
+ 
  : check for void type
  echo " "
  $cat <<EOM
***************
*** 1880,1886 ****
  esac
  cont=true
  echo " "
! rp="What type are the group ids are returned by getgroups()? [$dflt]"
  $echo $n "$rp $c"
  . myread
  gidtype="$ans"
--- 2031,2038 ----
  esac
  cont=true
  echo " "
! echo "(The following only matters if you have getgroups().)"
! rp="What type are the group ids returned by getgroups()? [$dflt]"
  $echo $n "$rp $c"
  . myread
  gidtype="$ans"
***************
*** 1907,1913 ****
  
  : see if this is a netinet/in.h system
  echo " "
! if $test -r /usr/include/netinet/in.h ; then
      i_niin="$define"
      echo "netinet/in.h found."
  else
--- 2059,2065 ----
  
  : see if this is a netinet/in.h system
  echo " "
! if xxx=`loc netinet/in.h x /usr/include /usr/local/include /usr/netinclude`; then
      i_niin="$define"
      echo "netinet/in.h found."
  else
***************
*** 2047,2057 ****
  case "$sig_name" in
  '')
      echo "Generating a list of signal names..."
!     set X `kill -l 2>/dev/null`
      shift
      case $# in
      0)  echo 'kill -l' >/tmp/foo$$
! 	set X `/bin/csh -f </tmp/foo$$`
  	shift
  	case $# in
  	0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
--- 2199,2228 ----
  case "$sig_name" in
  '')
      echo "Generating a list of signal names..."
!     set X `cat /usr/include/signal.h /usr/include/sys/signal.h 2>&1 | awk '
! $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
!     sig[$3] = substr($2,4,20)
!     if (max < $3 && $3 < 60) {
! 	max = $3
!     }
! }
! 
! END {
!     for (i=1; i<=max; i++) {
! 	if (sig[i] == "")
! 	    printf "%d", i
! 	else
! 	    printf "%s", sig[i]
! 	if (i < max)
! 	    printf " "
!     }
!     printf "\n"
! }
! '`
      shift
      case $# in
      0)  echo 'kill -l' >/tmp/foo$$
! 	set X `$csh -f </tmp/foo$$`
  	shift
  	case $# in
  	0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
***************
*** 2102,2156 ****
  Header='$Header'
  
  
- : see if we should include -ldbm
- echo " "
- if $test -r /usr/lib/libdbm.a || $test -r /usr/local/lib/libdbm.a ; then
-     echo "-ldbm found."
-     libdbm='-ldbm'
- else
-     ans=`loc libdbm.a x $libpth`
-     case "$ans" in
-     x)
- 	echo "No dbm library found."
- 	libdbm=''
- 	;;
-     *)
- 	echo "DBM library found in $ans."
- 	libdbm="$ans"
- 	;;
-     esac
- fi
- 
- : see if we should include -lndir
- echo " "
- if $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a ; then
-     echo "New directory library found."
-     libndir='-lndir'
- else
-     ans=`loc libndir.a x $libpth`
-     case "$ans" in
-     x)
- 	echo "No ndir library found."
- 	libndir=''
- 	;;
-     *)
- 	echo "New directory library found in $ans."
- 	libndir="$ans"
- 	;;
-     esac
- fi
- case "$libndir" in
- '') ;;
- *)
-     case "$d_readdir" in
-     $define)
- 	echo "Since you have readdir in the C library, I'll ignore $libndir"
- 	libndir=''
- 	;;
-     esac
-     ;;
- esac
- 
  : see if we should include -lnm
  echo " "
  if $test -r /usr/lib/libnm.a || $test -r /usr/local/lib/libnm.a ; then
--- 2273,2278 ----
***************
*** 2211,2218 ****
  # This file was produced by running the Configure script.
  
  d_eunice='$d_eunice'
- eunicefix='$eunicefix'
  define='$define'
  loclist='$loclist'
  expr='$expr'
  sed='$sed'
--- 2333,2340 ----
  # This file was produced by running the Configure script.
  
  d_eunice='$d_eunice'
  define='$define'
+ eunicefix='$eunicefix'
  loclist='$loclist'
  expr='$expr'
  sed='$sed'
***************
*** 2263,2268 ****
--- 2385,2391 ----
  touch='$touch'
  make='$make'
  date='$date'
+ csh='$csh'
  Log='$Log'
  Header='$Header'
  bin='$bin'
***************
*** 2275,2280 ****
--- 2398,2404 ----
  d_charsprf='$d_charsprf'
  d_crypt='$d_crypt'
  cryptlib='$cryptlib'
+ d_csh='$d_csh'
  d_dosuid='$d_dosuid'
  d_dup2='$d_dup2'
  d_fchmod='$d_fchmod'
***************
*** 2311,2317 ****
  d_sockpair='$d_sockpair'
  d_oldsock='$d_oldsock'
  socketlib='$socketlib'
- sockethdr='$sockethdr'
  d_statblks='$d_statblks'
  d_stdstdio='$d_stdstdio'
  d_strctcpy='$d_strctcpy'
--- 2435,2440 ----
***************
*** 2319,2329 ****
--- 2442,2454 ----
  d_syscall='$d_syscall'
  d_tminsys='$d_tminsys'
  i_systime='$i_systime'
+ i_timetoo='$i_timetoo'
  d_varargs='$d_varargs'
  d_vfork='$d_vfork'
  d_voidsig='$d_voidsig'
  d_vprintf='$d_vprintf'
  d_charvspr='$d_charvspr'
+ d_wait4='$d_wait4'
  gidtype='$gidtype'
  i_dirent='$i_dirent'
  d_dirnamlen='$d_dirnamlen'
***************
*** 2333,2338 ****
--- 2458,2466 ----
  i_pwd='$i_pwd'
  d_pwquota='$d_pwquota'
  d_pwage='$d_pwage'
+ d_pwchange='$d_pwchange'
+ d_pwclass='$d_pwclass'
+ d_pwexpire='$d_pwexpire'
  i_sysdir='$i_sysdir'
  i_sysioctl='$i_sysioctl'
  i_varargs='$i_varargs'
***************
*** 2339,2346 ****
  i_vfork='$i_vfork'
  intsize='$intsize'
  libc='$libc'
- libdbm='$libdbm'
- libndir='$libndir'
  libnm='$libnm'
  mallocsrc='$mallocsrc'
  mallocobj='$mallocobj'
--- 2467,2472 ----
***************
*** 2355,2360 ****
--- 2481,2487 ----
  huge='$huge'
  optimize='$optimize'
  ccflags='$ccflags'
+ cppflags='$cppflags'
  ldflags='$ldflags'
  cc='$cc'
  libs='$libs'

Index: Makefile.SH
Prereq: 3.0.1.1
*** Makefile.SH.old	Sat Nov 11 05:10:31 1989
--- Makefile.SH	Sat Nov 11 05:10:36 1989
***************
*** 25,33 ****
  
  echo "Extracting Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 3.0.1.1 89/10/26 23:00:38 lwall Locked $
  #
  # $Log:	Makefile.SH,v $
  # Revision 3.0.1.1  89/10/26  23:00:38  lwall
  # patch1: Makefile.SH needed some more .h dependecies
  # 
--- 25,37 ----
  
  echo "Extracting Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 3.0.1.2 89/11/11 04:07:30 lwall Locked $
  #
  # $Log:	Makefile.SH,v $
+ # Revision 3.0.1.2  89/11/11  04:07:30  lwall
+ # patch2: $sockethdr incorporated into $ccflags
+ # patch2: $libs now has most of the -l libraries
+ # 
  # Revision 3.0.1.1  89/10/26  23:00:38  lwall
  # patch1: Makefile.SH needed some more .h dependecies
  # 
***************
*** 40,46 ****
  privlib = $privlib
  mansrc = $mansrc
  manext = $manext
! CFLAGS = $ccflags $optimize $sockethdr
  LDFLAGS = $ldflags
  SMALL = $small
  LARGE = $large $split
--- 44,50 ----
  privlib = $privlib
  mansrc = $mansrc
  manext = $manext
! CFLAGS = $ccflags $optimize
  LDFLAGS = $ldflags
  SMALL = $small
  LARGE = $large $split
***************
*** 48,54 ****
  mallocobj = $mallocobj
  SLN = $sln
  
! libs = $libnm -lm $libdbm $libs $libndir $socketlib
  
  public = perl taintperl $suidperl
  
--- 52,58 ----
  mallocobj = $mallocobj
  SLN = $sln
  
! libs = $libs -lm
  
  public = perl taintperl $suidperl