UCB SPIM - source building instructions

0. Untar the sources using the command:
  % gunzip -c spimsal.tar.gz | tar xvf - 
1. Edit the Makefile as necessary for your environment:
  1a.   Change the TRAP_PATH to be appropriate for your system.   Examples:
  For a personal Unix workstation: 
  TRAP_PATH = \"/usr/local/lib/spim/trap.handler\"

  For a Windows box: 
  TRAP_PATH = \"/cygdrive/c/Program\ Files/spim/trap.handler\"

  For Instructional Unix class master accounts (could use $MASTERDIR instead of 'cs61c', etc): 
  TRAP_PATH = \"/home/ff/cs61c/lib/spim/trap.handler\"
  1b.   Make TOPDIR the installation prefix for X11.   Examples:
  For your personal Unix workstation:
  TOPDIR = /usr/X11R6

  For a Windows box: 
  TOPDIR = . (it doesn't matter, because xspim won't compile)

  For Instructional Unix, use the Software Warehouse:
  TOPDIR = /usr/sww/X11R6

  On a Solaris box, you will want to set 
  TOPDIR = /usr/openwin 
  and add -lsocket -lnsl to XLDFLAGS.
2. Set your path to select the correct gcc and make programs.

3. Type "make".

4. There is no "make install" target; you have to install it yourself. Put "spim" and "xspim" in /usr/local/bin or wherever is appropriate, and put "trap.handler" where you said you would (in TRAP_PATH). On Windows, you will want to put it all in C:\Program Files\spim.

5. Here are code changes for compiling on FreeBSD.   This was submitted by a user:

	filename="spimsal.freebsd.diff"
	
	--- spimsal.orig/spim-utils.c	Mon Apr 23 16:23:13 2001
	+++ spimsal/spim-utils.c	Fri Oct  1 15:31:37 2004
	@@ -260,7 +260,15 @@
	 #ifndef NOMEMIO
	 #include "sys/ioctl.h"
	 #ifdef TERMIO
	+#  ifdef __FreeBSD__
	+/* BSD */
	+#include 
	+#include 
	+#define TCSETA TIOCSETA
	+#define TCGETA TIOCGETA
	+#  else
	 #include "termio.h"
	+#  endif
	 #else
	 #include "sgtty.h"
	 #endif /* TERMIO */
	@@ -287,7 +295,11 @@
	   /* Note stdin is file number 0. */
	   if (console_uses_stdin && memio && isatty(0)) {
	 #ifdef TERMIO
	+#  ifdef __FreeBSD__
	+    struct termios arg;
	+#  else
	     struct termio arg;
	+#  endif
	     ioctl(0, TCGETA, &arg);
	     arg.c_lflag &= ~ICANON;
	     arg.c_lflag &= ~ECHO;
	@@ -315,7 +327,11 @@
	 #ifndef NOMEMIO
	   if (console_uses_stdin && memio && isatty(0)) {
	 #ifdef TERMIO
	+#  ifdef __FreeBSD__
	+    struct termios arg;
	+#  else
	     struct termio arg;
	+#  endif
	     ioctl(0, TCGETA, &arg);
	     arg.c_lflag |= ICANON;
	     arg.c_lflag |= ECHO;
  

Go back to the main UCB SPIM site.
spim@inst.EECS.Berkeley.EDU