*BSD News Article 58667


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.cis.okstate.edu!col.hp.com!usenet.eel.ufl.edu!news.mathworks.com!uunet!in1.uu.net!cygnus.com!cygnus.com!not-for-mail
From: hsu@cygnus.com (Jeffrey Hsu)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: SML/NJ on FreeBSD
Date: 31 Dec 1995 20:11:47 -0800
Organization: Cygnus Support
Lines: 412
Message-ID: <4c7mu3$40r@cygnus.com>
NNTP-Posting-Host: cygnus.com

Grab SMl 0.93 and apply these patches:

*** ./makeml	Tue Feb 22 16:01:20 1994
--- ./makeml.0	Fri Sep 24 17:40:07 1993
***************
*** 215,228 ****
  	    case $1 in
  		bsd)    OPSYS=BSD ;;
  		bsd386) OPSYS=BSD; DEFS="$DEFS -DBSD386";;
- 		FreeBSD)
- 		  CPP=/usr/bin/cpp
- 		  OPSYS=BSD
- 		  DEFS="$DEFS -DFreeBSD"
- 		  ;;
  		mach)   OPSYS=MACH; DEFS="$DEFS -DBSD";;
  		*)
! 		    echo "$CMD must specify opsys arg for i386/i486 (bsd, bsd386, FreeBSD or mach)"
  		    exit 1
  		;;
  	    esac
--- 215,223 ----
  	    case $1 in
  		bsd)    OPSYS=BSD ;;
  		bsd386) OPSYS=BSD; DEFS="$DEFS -DBSD386";;
  		mach)   OPSYS=MACH; DEFS="$DEFS -DBSD";;
  		*)
! 		    echo "$CMD must specify opsys arg for i386/i486 (bsd, bsd386 or mach)"
  		    exit 1
  		;;
  	    esac
*** ./runtime/export.c	Tue Feb 22 16:42:34 1994
--- ./runtime/export.c.0	Fri Sep 24 17:42:13 1993
***************
*** 178,188 ****
  #  if defined(NS32)
      E.a_magic = NS32GMAGIC;
  #  else
! #    if defined(FreeBSD)
!       E.a_magic = QMAGIC;
! #    else
!       E.a_magic = ZMAGIC;
! #    endif
  #  endif
  #endif
  #endif
--- 178,184 ----
  #  if defined(NS32)
      E.a_magic = NS32GMAGIC;
  #  else
!     E.a_magic = ZMAGIC;
  #  endif
  #endif
  #endif
***************
*** 257,263 ****
      lseek(filid,N_DATADDR(E),0);
      bulletproofWrite(filid,CEIL(ETEXT,getpagesize()),E.a_data);
  #else
! #if defined(SPARC) && defined(MACH) || defined(BSD386) || defined(FreeBSD)
      bulletproofWrite(filid,textstart+sizeof(E),E.a_text-sizeof(E));
  #else
  # if defined(DYNIX)
--- 253,259 ----
      lseek(filid,N_DATADDR(E),0);
      bulletproofWrite(filid,CEIL(ETEXT,getpagesize()),E.a_data);
  #else
! #if defined(SPARC) && defined(MACH) || defined(BSD386)
      bulletproofWrite(filid,textstart+sizeof(E),E.a_text-sizeof(E));
  #else
  # if defined(DYNIX)
*** ./runtime/cfuns.c	Tue Sep 28 23:21:11 1993
--- ./runtime/cfuns.c.0	Sat Sep 25 12:41:52 1993
***************
*** 7,50 ****
  
  #include "ml_os.h"
  #ifdef THINK_C
!   #include <unix.h>
!   #include <fcntl.h>
!   #include <errno.h>
!   #include "MacOS.dep.h"
! #else
!   #include <sys/socket.h>
!   #include <sys/un.h>
!   #include <netinet/in.h>
!   #include <sys/stat.h>
!   #include <sys/errno.h>
!   #ifdef V9
!     #include <sys/filio.h>
!     #include <sys/ttyio.h>
!   #else
!     #include <sys/ioctl.h>
!     #include <sys/file.h>
!     #ifndef HPUX
!     #include <sys/time.h>
!   #endif
  #endif
  #ifndef HPUX
!   #include <sys/param.h>
  #endif
  #if (defined(SPARC) && !defined(MACH))
!   #ifdef SOLARIS
!     #include <unistd.h>
!     #include <sys/filio.h>
!     #include <fcntl.h>
!     #include <signal.h>
!     extern sigset_t emptyMask;
!   #else
!     #include <vfork.h>	/* tells sparc optimizer about vfork */
!   #endif
  #endif
  #include <sys/wait.h>
!   #endif THINK_C
  #ifdef HPUX
!   #include <sys/utsname.h>
  #endif
  
  #include "ml_state.h"
--- 7,50 ----
  
  #include "ml_os.h"
  #ifdef THINK_C
! #include <unix.h>
! #include <fcntl.h>
! #include <errno.h>
! #include "MacOS.dep.h"
! #else
! #include <sys/socket.h>
! #include <sys/un.h>
! #include <netinet/in.h>
! #include <sys/stat.h>
! #include <sys/errno.h>
! #ifdef V9
! #include <sys/filio.h>
! #include <sys/ttyio.h>
! #else
! #include <sys/ioctl.h>
! #include <sys/file.h>
! #ifndef HPUX
! #include <sys/time.h>
! #endif
  #endif
  #ifndef HPUX
! #include <sys/param.h>
  #endif
  #if (defined(SPARC) && !defined(MACH))
! #ifdef SOLARIS
! #include <unistd.h>
! #include <sys/filio.h>
! #include <fcntl.h>
! #include <signal.h>
! extern sigset_t emptyMask;
! #else
! #include <vfork.h>	/* tells sparc optimizer about vfork */
! #endif
  #endif
  #include <sys/wait.h>
! #endif THINK_C
  #ifdef HPUX
! #include <sys/utsname.h>
  #endif
  
  #include "ml_state.h"
***************
*** 257,263 ****
   	return (sz - pos);
  }
  
! #endif /* THINK_C */
  
  
  #define MAX_SYSCALL_ARGS	6
--- 257,263 ----
   	return (sz - pos);
  }
  
! #endif
  
  
  #define MAX_SYSCALL_ARGS	6
***************
*** 274,280 ****
      raise_syserror (msp, "ml_syscall: Not implemented");
      return;
  }
! #else /* !AIX */
  void ml_syscall (msp, arg)
      MLState_ptr	    msp;
      ML_val_t	    arg;
--- 274,280 ----
      raise_syserror (msp, "ml_syscall: Not implemented");
      return;
  }
! #else
  void ml_syscall (msp, arg)
      MLState_ptr	    msp;
      ML_val_t	    arg;
***************
*** 454,464 ****
  	len = strlen(path)+sizeof(sock.sun_len)+sizeof(sock.sun_family)+1;
  	sock.sun_len = len;
  #else
- #ifndef FreeBSD
  	len = strlen(path)+sizeof(sock.sun_family);
- #else
- 	len = SUN_LEN(&sock);
- #endif
  #endif
  	DO_SYSCALL (connect(fd, (struct sockaddr *)&sock, len), sts);
  	if (sts != -1) {
--- 454,460 ----
***************
*** 509,515 ****
      struct sockaddr_in saddr;
      int		    fd, s, i, sts;
  
! #if defined(SUNOS) || (defined(BSD) && defined(MIPS)) || defined(NeXT) || defined(AUX) || defined(HPPA) || defined (FreeBSD)
      DO_SYSCALL (socket(PF_INET, SOCK_STREAM, 0), fd);
      if (fd != -1) {
  	saddr.sin_family = AF_INET;
--- 505,511 ----
      struct sockaddr_in saddr;
      int		    fd, s, i, sts;
  
! #if defined(SUNOS) || (defined(BSD) && defined(MIPS)) || defined(NeXT) || defined(AUX) || defined(HPPA)
      DO_SYSCALL (socket(PF_INET, SOCK_STREAM, 0), fd);
      if (fd != -1) {
  	saddr.sin_family = AF_INET;
***************
*** 615,621 ****
      /*
      raise_ThinkC_error(msp);
      */
! #else /* !THINK_C */
      fd_set	    rfds;
  
      if (msp->inSigHandler || msp->maskSignals
--- 611,617 ----
      /*
      raise_ThinkC_error(msp);
      */
! #else
      fd_set	    rfds;
  
      if (msp->inSigHandler || msp->maskSignals
***************
*** 628,638 ****
  #ifdef RISCos
  	/* problem with select and pipes */
  	sts = 0;
! #else /* !RISCos */
  	FD_ZERO(&rfds);
  	FD_SET(fd, &rfds);
  	sts = select(fd+1, &rfds, 0, 0, 0);
! #endif /* RISCos */
  	msp->ioWaitFlag = 0;
      }
      else {
--- 624,634 ----
  #ifdef RISCos
  	/* problem with select and pipes */
  	sts = 0;
! #else
  	FD_ZERO(&rfds);
  	FD_SET(fd, &rfds);
  	sts = select(fd+1, &rfds, 0, 0, 0);
! #endif
  	msp->ioWaitFlag = 0;
      }
      else {
***************
*** 654,660 ****
      }
  
      RETURN(msp, ML_unit);
! #endif /* THINK_C */
  } /* end of ml_wait_for_in. */
  
  
--- 650,656 ----
      }
  
      RETURN(msp, ML_unit);
! #endif
  } /* end of ml_wait_for_in. */
  
  
***************
*** 1064,1070 ****
      int		    sts;
  
      if (OBJ_isBOXED(f))
! #if defined(SOLARIS) || defined(FreeBSD)
  	sts = truncate((char *)PTR_MLtoC(f), len);
  #else
  	sts = truncate(PTR_MLtoC(f), len);
--- 1060,1066 ----
      int		    sts;
  
      if (OBJ_isBOXED(f))
! #ifdef SOLARIS
  	sts = truncate((char *)PTR_MLtoC(f), len);
  #else
  	sts = truncate(PTR_MLtoC(f), len);
***************
*** 1601,1607 ****
  	raise_syserror (msp, 0);
      else
  	RETURN(msp, INT_CtoML(sz));
! #else /* !THINK_C */
  #ifdef SOLARIS
      int		    fd = INT_MLtoC(arg);
      off_t           cnt;
--- 1597,1603 ----
  	raise_syserror (msp, 0);
      else
  	RETURN(msp, INT_CtoML(sz));
! #else
  #ifdef SOLARIS
      int		    fd = INT_MLtoC(arg);
      off_t           cnt;
***************
*** 1630,1636 ****
      }
      else
          raise_syserror (msp, 0);
! #else /* !SOLARIS */
      int		fd = INT_MLtoC(arg);
      struct stat	buf;
      int		pos;
--- 1626,1632 ----
      }
      else
          raise_syserror (msp, 0);
! #else
      int		fd = INT_MLtoC(arg);
      struct stat	buf;
      int		pos;
***************
*** 1656,1663 ****
  	raise_syserror (msp, 0);
      else
  	RETURN(msp, INT_CtoML(buf.st_size - pos));
! #endif /* SOLARIS */
! #endif /* THINK_C */
  } /* end of ml_fionread */
  
  
--- 1652,1659 ----
  	raise_syserror (msp, 0);
      else
  	RETURN(msp, INT_CtoML(buf.st_size - pos));
! #endif
! #endif
  } /* end of ml_fionread */
  
  
*** ./runtime/signal.c	Sat Feb  5 13:07:39 1994
--- ./runtime/signal.c.0	Tue Sep 28 16:51:53 1993
***************
*** 444,450 ****
  {
      MLState_ptr MLState = find_self();
  
! #if defined(BSD386)
      /* Due to an OS bug, SIGBUS is generated by an INTO instruction */
      if (sig == SIGBUS) {
         sig = SIGFPE; 
--- 444,450 ----
  {
      MLState_ptr MLState = find_self();
  
! #ifdef BSD386
      /* Due to an OS bug, SIGBUS is generated by an INTO instruction */
      if (sig == SIGBUS) {
         sig = SIGFPE; 
***************
*** 595,601 ****
      set_fsr();  /* enable floating-point exceptions */
  #endif
  
! #if defined(BSD386)
      /* Due to OS bug, SIGBUS is generated by an INTO instruction. */
      SETSIG(SIGBUS, trap_handler, SIGMASKALL);
  #endif   
--- 595,601 ----
      set_fsr();  /* enable floating-point exceptions */
  #endif
  
! #ifdef BSD386
      /* Due to OS bug, SIGBUS is generated by an INTO instruction. */
      SETSIG(SIGBUS, trap_handler, SIGMASKALL);
  #endif   
*** ./runtime/Makefile	Sat Feb  5 13:08:23 1994
--- ./runtime/Makefile.0	Tue Sep 28 16:57:25 1993
***************
*** 69,75 ****
  
  perv.o: ../../mo.c/perv.c
  	$(CC) $(CFLAGS) -c ../../mo.c/perv.c
! 
  clean:
  	rm -f *.o lint.out prim.s linkdata allmo.s run crc
  
--- 69,75 ----
  
  perv.o: ../../mo.c/perv.c
  	$(CC) $(CFLAGS) -c ../../mo.c/perv.c
!        
  clean:
  	rm -f *.o lint.out prim.s linkdata allmo.s run crc