[comp.sources.d] Perl 3.0 on my 3b1

jdc@naucse.UUCP (John Campbell) (09/14/89)

Has anyone ported perl 3.0 (beta) to a unix-pc (3b1)?  It almost seems
to work--when I have more time I'll double check the config files by
hand.  I made some changes to get it to compile (diffs below) and then my 
3b1 perl passes all tests but the following (as far as I can tell):

comp.cpp 	fails 2
io.inplace 	fails 1 2
op.array 	core dump
op.magic	fails 3
op.mkdir	fails 3 7
op.pat		fails 35
op.regexp	fails 0 core dump
op.split	hangs forever, infinite loop?
op.stat		fails 4 (mtime != ctime)

----diffs to make it compile-----
*** perl.h.orig	Tue Sep 12 19:02:58 1989
--- perl.h	Tue Sep 12 19:03:42 1989
***************
*** 31,36
  #include <stdio.h>
  #include <ctype.h>
  #include <setjmp.h>
  #include <sys/param.h>	/* if this needs types.h we're still wrong */
  
  #ifndef _TYPES_		/* If types.h defines this it's easy. */

--- 31,37 -----
  #include <stdio.h>
  #include <ctype.h>
  #include <setjmp.h>
+ #include <signal.h>   /* Added for 3b1 */
  #include <sys/param.h>	/* if this needs types.h we're still wrong */
  
  #ifndef _TYPES_		/* If types.h defines this it's easy. */
*** doio.c.orig	Tue Sep 12 19:54:31 1989
--- doio.c	Tue Sep 12 19:55:03 1989
***************
*** 457,462
      else {
  	str_sset(statname,ary->ary_array[sp]);
  	statstab = Nullstab;
  	if (arg->arg_type == O_LSTAT)
  	    i = lstat(str_get(statname),&statcache);
  	else

--- 457,463 -----
      else {
  	str_sset(statname,ary->ary_array[sp]);
  	statstab = Nullstab;
+ #ifdef SYMLINK
  	if (arg->arg_type == O_LSTAT)
  	    i = lstat(str_get(statname),&statcache);
  	else
***************
*** 460,465
  	if (arg->arg_type == O_LSTAT)
  	    i = lstat(str_get(statname),&statcache);
  	else
  	    i = stat(str_get(statname),&statcache);
  	if (i < 0)
  	    max = 0;

--- 461,467 -----
  	if (arg->arg_type == O_LSTAT)
  	    i = lstat(str_get(statname),&statcache);
  	else
+ #endif
  	    i = stat(str_get(statname),&statcache);
  	if (i < 0)
  	    max = 0;
*** util.c.orig	Tue Sep 12 21:45:23 1989
--- util.c	Tue Sep 12 21:49:03 1989
***************
*** 1002,1007
  	that = !this;
  	close(p[that]);
  	if (p[this] != (*mode == 'r')) {
  	    dup2(p[this], *mode == 'r');
  	    close(p[this]);
  	}

--- 1002,1008 -----
  	that = !this;
  	close(p[that]);
  	if (p[this] != (*mode == 'r')) {
+ #ifdef DUP2
  	    dup2(p[this], *mode == 'r');
  	    close(p[this]);
  #else
***************
*** 1004,1009
  	if (p[this] != (*mode == 'r')) {
  	    dup2(p[this], *mode == 'r');
  	    close(p[this]);
  	}
  	if (doexec) {
  	    do_exec(cmd);	/* may or may not use the shell */

--- 1005,1017 -----
  #ifdef DUP2
  	    dup2(p[this], *mode == 'r');
  	    close(p[this]);
+ #else
+ /* Oh boy! I don't have dup2--so what to do? */
+ 	   if (*mode == 'r') close (1);
+ 	   else close (0);
+ 	   (void) dup(p[this]);  /* Hope we get first in list... */
+ 	   close (p[this]);      /* Isn't there a better way? */
+ #endif
  	}
  	if (doexec) {
  	    do_exec(cmd);	/* may or may not use the shell */
-- 
	John Campbell               ...!arizona!naucse!jdc
                                    CAMPBELL@NAUVAX.bitnet
	unix?  Sure send me a dozen, all different colors.