[comp.sources.bugs] Xenix patches for Perl3 patchlevel 4

chip@ateng.com (Chip Salzenberg) (11/18/89)

These patches are the Xenix port of Perl 3.0 patchlevel 4.  Features:

    1.  Support for directory reading via <sys/ndir.h> and -lx.
	(Xenix users, *avoid* <dirent.h> and -ldirent!
	They're buggy in Xenix 2.3.1.)

    2.  Support for finding all Xenix libraries, including -lx and -ldbm.

    3.  Support for SCO TCP/IP, particularly -lsocket.  Note that you must
	manually add the required -Di386 and -DLAI_TCP, though I suppose
	that I could have made these flags automatic.

    4.  Separation of the library directories into variable xlibpth, just
	in case you want to compile for the '286 on a '386.

Generic bug fixes:

    1.  Fix of a typo in perl.h:  TIMETOO should be I_TIMETOO.

    2.  Makefile.SH mentions perly.o twice on the left side of a ":".

    3.  BYTEORDER is an octal number, but it can have an "8" in it!
	And it can be long.  Change it to a decimal number with an "L".


# This file contains patches for Perl 3.0.
# (Be sure to use the "-p" option of patch.)
# Patches are enclosed for the following file(s):
#	Makefile.SH
#	config.h.SH
#	perl.h
#	Configure

Index: Makefile.SH
*** Makefile.SH.P	Fri Nov 17 19:20:34 1989
--- Makefile.SH	Fri Nov 17 19:54:53 1989
***************
*** 345,349 ****
  
  # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
! perly.o $(obj):
  	@ echo "You haven't done a "'"make depend" yet!'; exit 1
  makedepend: makedepend.SH
--- 345,349 ----
  
  # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
! $(obj):
  	@ echo "You haven't done a "'"make depend" yet!'; exit 1
  makedepend: makedepend.SH

Index: config.h.SH
*** config.h.SH.P	Fri Nov 17 19:20:44 1989
--- config.h.SH	Fri Nov 17 19:56:21 1989
***************
*** 47,53 ****
  /* BYTEORDER:
   *	This symbol contains an encoding of the order of bytes in a long.
!  *	Usual values (in octal) are 01234, 04321, 02143, 03412...
   */
! #define BYTEORDER 0$byteorder		/**/
  
  /* CPPSTDIN:
--- 47,53 ----
  /* BYTEORDER:
   *	This symbol contains an encoding of the order of bytes in a long.
!  *      Usual values are 1234, 4321, 2143, 3412...
   */
! #define BYTEORDER ${byteorder}L         /**/
  
  /* CPPSTDIN:
***************
*** 437,441 ****
  /* I_DIRENT:
   *	This symbol, if defined, indicates to the C program that it should
!  *	include dirent.h.
   */
  /* DIRNAMLEN:
--- 437,441 ----
  /* I_DIRENT:
   *	This symbol, if defined, indicates to the C program that it should
!  *      include <dirent.h>.
   */
  /* DIRNAMLEN:
***************
*** 502,505 ****
--- 502,511 ----
  #$i_sysdir	I_SYSDIR		/**/
  
+ /* I_SYSNDIR:
+  *	This symbol, if defined, indicates to the C program that it should
+  *      include sys/ndir.h.
+  */
+ #$i_sysndir     I_SYSNDIR               /**/
+ 
  /* I_SYSIOCTL:
   *	This symbol, if defined, indicates that sys/ioctl.h exists and should

Index: perl.h
*** perl.h.P	Fri Nov 17 19:21:08 1989
--- perl.h	Fri Nov 17 20:16:31 1989
***************
*** 68,72 ****
  #if defined(TMINSYS) || defined(I_SYSTIME)
  #include <sys/time.h>
! #ifdef TIMETOO
  #include <time.h>
  #endif
--- 68,72 ----
  #if defined(TMINSYS) || defined(I_SYSTIME)
  #include <sys/time.h>
! #ifdef I_TIMETOO
  #include <time.h>
  #endif
***************
*** 129,132 ****
--- 129,136 ----
  #endif
  
+ #ifdef I_SYSNDIR
+ #include <sys/ndir.h>
+ #define DIRENT direct
+ #else
  #ifdef I_DIRENT
  #include <dirent.h>
***************
*** 142,145 ****
--- 146,150 ----
  #endif
  #endif
+ #endif
  
  typedef struct arg ARG;
***************
*** 255,259 ****
  #endif
  #ifndef HTONL
! #if (BYTEORDER != 04321) && (BYTEORDER != 087654321)
  #define HTONS
  #define HTONL
--- 260,264 ----
  #endif
  #ifndef HTONL
! #if (BYTEORDER != 4321L) && (BYTEORDER != 87654321L)
  #define HTONS
  #define HTONL
***************
*** 267,271 ****
  #endif
  #else
! #if (BYTEORDER == 04321) || (BYTEORDER == 087654321)
  #undef HTONS
  #undef HTONL
--- 272,276 ----
  #endif
  #else
! #if (BYTEORDER == 4321L) || (BYTEORDER == 87654321L)
  #undef HTONS
  #undef HTONL

Index: Configure
*** Configure.P	Fri Nov 17 19:20:34 1989
--- Configure	Fri Nov 17 20:04:03 1989
***************
*** 169,172 ****
--- 169,173 ----
  d_pwexpire=''
  i_sysdir=''
+ i_sysndir=''
  i_sysioctl=''
  i_varargs=''
***************
*** 218,222 ****
  define='define'
  undef='undef'
! libpth='/usr/lib /usr/local/lib /usr/lib/386 /usr/lib/large /lib /lib/386 /lib/large /usr/lib/small /lib/small'
  smallmach='pdp11 i8086 z8000 i80286 iAPX286'
  rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
--- 219,225 ----
  define='define'
  undef='undef'
! : change this if compiling for Xenix/286
! xlibpth="/usr/lib/386 /lib/386"
! libpth="/usr/lib /usr/local/lib /usr/lib/large /lib $xlibpth /lib/large /usr/lib/small /lib/small'
  smallmach='pdp11 i8086 z8000 i80286 iAPX286'
  rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
***************
*** 248,252 ****
  d_newshome="/usr/NeWS"
  defvoidused=7
! libswanted="net nm ndir ndbm dbm c_s"
  
  : some greps do not return status, grrr.
--- 251,255 ----
  d_newshome="/usr/NeWS"
  defvoidused=7
! libswanted="net socket nm ndir ndbm dbm x c_s"
  
  : some greps do not return status, grrr.
***************
*** 1098,1102 ****
  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
--- 1101,1106 ----
  esac
  for thislib in $libswanted; do
!     if xxx=`loc lib$thislib.a X /usr/lib /usr/local/lib /lib` ||
!        xxx=`loc Slib$thislib.a X $xlibpth`; then
  	echo "Found -l$thislib."
  	case "$dflt" in
***************
*** 1321,1333 ****
  	    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" ;;
--- 1325,1339 ----
  	    try=`loc lib$thislib.a blurfl/dyick $libpth`
  	    if test ! -f $try; then
+ 		try=`loc Slib$thislib.a blurfl/dyick $xlibpth`
+ 	    fi
+ 	    if test ! -f $try; then
  		try=`loc lib$thislib blurfl/dyick $libpth`
  	    fi
! 	    if test ! -f $try; then
! 		try=`loc $thislib blurfl/dyick $libpth`
! 	    fi
! 	    if test -f $try; then
! 		libnames="$libnames $try"
! 	    fi
  	    ;;
  	*) libnames="$libnames $thisname" ;;
***************
*** 1355,1359 ****
      fi
      if test ! -f "$ans"; then
! 	ans=`loc Slibc.a blurfl/dyick /usr/lib/386 /lib/386 $libpth`
      fi
      if test ! -f "$ans"; then
--- 1361,1365 ----
      fi
      if test ! -f "$ans"; then
! 	ans=`loc Slibc.a blurfl/dyick $xlibpth $libpth`
      fi
      if test ! -f "$ans"; then
***************
*** 1496,1502 ****
      cryptlib=''
  else
!     cryptlib=`loc Slibcrypt.a "" /lib/386 /lib`
      if $test -z "$cryptlib"; then
! 	cryptlib=`loc Mlibcrypt.a "" /lib/386 /lib`
      else
  	cryptlib=-lcrypt
--- 1502,1508 ----
      cryptlib=''
  else
!     cryptlib=`loc Slibcrypt.a "" $xlibpth`
      if $test -z "$cryptlib"; then
! 	cryptlib=`loc Mlibcrypt.a "" /lib`
      else
  	cryptlib=-lcrypt
***************
*** 1503,1507 ****
      fi
      if $test -z "$cryptlib"; then
! 	cryptlib=`loc Llibcrypt.a "" /lib/386 /lib`
      else
  	cryptlib=-lcrypt
--- 1509,1513 ----
      fi
      if $test -z "$cryptlib"; then
! 	cryptlib=`loc Llibcrypt.a "" /lib`
      else
  	cryptlib=-lcrypt
***************
*** 1529,1534 ****
  echo " "
  if $test -r /usr/include/dirent.h ; then
-     i_dirent="$define"
      echo "dirent.h found."
      if $contains 'd_namlen' /usr/include/sys/dirent.h >/dev/null 2>&1; then
  	d_dirnamlen="$define"
--- 1535,1540 ----
  echo " "
  if $test -r /usr/include/dirent.h ; then
      echo "dirent.h found."
+     i_dirent="$define"
      if $contains 'd_namlen' /usr/include/sys/dirent.h >/dev/null 2>&1; then
  	d_dirnamlen="$define"
***************
*** 2072,2081 ****
  if $test -r /usr/include/sys/dir.h ; then
      i_sysdir="$define"
!     echo "sysdir.h found."
  else
      i_sysdir="$undef"
!     echo "No sysdir.h found."
  fi
  
  : see if ioctl defs are in sgtty/termio or sys/ioctl
  echo " "
--- 2078,2097 ----
  if $test -r /usr/include/sys/dir.h ; then
      i_sysdir="$define"
!     echo "sys/dir.h found."
  else
      i_sysdir="$undef"
!     echo "No sys/dir.h found."
  fi
  
+ : see if this is a sys/ndir.h system
+ echo " "
+ if $test -r /usr/include/sys/ndir.h ; then
+     i_sysndir="$define"
+     echo "sys/ndir.h found."
+ else
+     i_sysndir="$undef"
+     echo "No sys/ndir.h found."
+ fi
+ 
  : see if ioctl defs are in sgtty/termio or sys/ioctl
  echo " "
***************
*** 2463,2466 ****
--- 2479,2483 ----
  d_pwexpire='$d_pwexpire'
  i_sysdir='$i_sysdir'
+ i_sysndir='$i_sysndir'
  i_sysioctl='$i_sysioctl'
  i_varargs='$i_varargs'
-- 
You may redistribute this article only to those who may freely do likewise.
Chip Salzenberg at A T Engineering;  <chip@ateng.com> or <uunet!ateng!chip>
    "Did I ever tell you the Jim Gladding story about the binoculars?"