diff -Naur genesis/src/Makefile genesis2.2.1.Panther/src/Makefile
--- genesis/src/Makefile	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/Makefile	Mon May 24 17:44:25 2004
@@ -0,0 +1,2033 @@
+# $Id: Makefile.dist,v 1.146 2001/07/22 17:53:18 mhucka Exp $
+#
+#				G E N E S I S
+#		    The General Neural Simulation System
+#				 Version 2.2
+#
+# SYNOPSIS: This is the top-level Makefile for GENESIS.  
+#           YOU MUST EDIT THIS FILE BEFORE RUNNING "make".
+#           Please follow the procedure given below.
+#
+# TABLE OF CONTENTS
+# A. Procedure for building and installing GENESIS
+# B. Installation configuration settings
+# C. Optional libraries
+# D. Definitions for specific operating system and compiler in use
+# E. Custom settings
+# F. Beginning of non-configurable definitions
+# G. Revision history
+#
+# ----------------------------------------------------------------------
+# A. PROCEDURE FOR BUILDING AND INSTALLING GENESIS
+# ----------------------------------------------------------------------
+#
+# 1) Look through the rest of this file for a block of definitions for
+#    your particular computer operating system and compiler combination.
+#    For example, the definitions suggested for Solaris 2.x when using
+#    the Sun Workshop C compiler begins with lines that look like this:
+#
+#		# System:	Solaris 2.x (A.K.A. SunOS 5.x)
+#		# Compiler:	Sun Workshop "cc"
+#
+#    Note that some system/compiler combinations have several variations
+#    below, so look carefully at all of them before chosing one.
+#
+# 2) Uncomment the definitions for your operating system/compiler
+#    combination.  NOTE: MAKE SURE THAT NO OTHER SYSTEM/COMPILER SECTION
+#    IS UNCOMMENTED.
+#
+# 3) Execute the command "make".
+#
+# 4) Execute the command "make install".
+# 
+# 5) Execute the command "make clean".
+#
+# 
+# ADDITIONAL INFORMATION:
+# If you run into problems compiling this package, consult the "CUSTOM
+# SETTINGS" section below, where you may override the default settings.
+# If one of the optional libraries fails to compile, comment out the
+# library's macros in the "Optional libraries" section.
+#
+# GENESIS can also be built without the XODUS graphics libraries by
+# replacing the commands in steps 2 and 3 with "make nxall" and
+# "make nxinstall".  A GENESIS without any libraries can be built
+# with the commands "make minall" and "make mininstall".
+#
+
+# ----------------------------------------------------------------------
+# B. INSTALLATION CONFIGURATION SETTINGS
+# ----------------------------------------------------------------------
+
+# The following variable determines where GENESIS is placed by the
+# "make install" command.
+
+INSTALL	=	/usr/local/genesis
+# /usr/local/genesis
+# `pwd`/..
+
+# ----------------------------------------------------------------------
+# C. OPTIONAL LIBRARIES
+# ----------------------------------------------------------------------
+#
+# The following libraries are optional.  If you comment the macros for a
+# given library here the library will not be compiled or linked into the
+# executable.
+
+#
+# kinetics --- Kinetic modeling library (necessary for kkit)
+#
+
+KINETICSLIB = kin
+KINETICSDIR = kinetics
+KINETICSOBJ = $(KINETICSDIR)/kinlib.o
+
+#
+# diskio --- Binary file format support library
+#
+
+# Please note that all the macros here need to be uncommented if diskio
+# support is to be included.  FMT1 support is therefore included by
+# default when the diskio library is linked in.
+
+FMT1SUBDIR   = FMT1
+FMT1OBJ      = $(DISKIODIR)/interface/FMT1/FMT1lib.o
+FMT1FLAGS    = -DFMT1
+
+DISKIOLIB    = diskio
+DISKIODIR    = diskio
+DISKIOSUBDIR = $(NETCDFSUBDIR) \
+               $(FMT1SUBDIR)
+DISKIOOBJ    = $(NETCDFOBJ) \
+	       $(FMT1OBJ) \
+	       $(DISKIODIR)/diskiolib.o
+DISKIOFLAGS  = $(NETCDFFLAGS) \
+	       $(FMT1FLAGS)
+
+# Uncomment the following definitions if the netCDF file format needs to
+# be supported by diskio.  netCDF is a system-independent, portable,
+# binary file format.  See the directory src/diskio/interface/netcdf for
+# more information.  NOTE: *only* uncomment the netCDF definitions below
+# if diskio support is included above.
+# 
+# As of June, 2001, the GENESIS developers have not successfully
+# built the netcdf libraries under SunOS 4.1.  If you are running
+# SunOS 4.1, you should comment out all three of the following.
+
+NETCDFSUBDIR = netcdf
+NETCDFOBJ = \
+	$(DISKIODIR)/interface/$(NETCDFSUBDIR)/netcdflib.o \
+	$(DISKIODIR)/interface/$(NETCDFSUBDIR)/netcdf-3.4/src/libsrc/libnetcdf.a
+NETCDFFLAGS = -Dnetcdf
+
+#
+# oldconn --- GENESIS 1.4 network connection compatibility library
+#
+
+# The following is only necessary for GENESIS 1.4 network models
+# minimally ported to GENESIS 2.x.  NOTE: some of the tutorials/demos
+# utilize this library.
+
+OLDCONNLIB = axon synapse personal toolconn simconn
+OLDCONNDIR = oldconn
+OLDCONNOBJ = $(OLDCONNDIR)/axon/axonlib.o \
+	     $(OLDCONNDIR)/synapse/synlib.o \
+	     $(OLDCONNDIR)/personal/perlib.o \
+	     $(OLDCONNDIR)/sim/simconnlib.o \
+	     $(OLDCONNDIR)/tools/toolconnlib.o
+
+# 
+# SPRNG -- Improved random number generation
+#
+
+# The SPRNG library provides five random number generators.  To use
+# SPRNG, you must specify SPRNG as one and only one of lfg, lcg,
+# lcg64, or cmrg here.  Lagged Fibonacci is the default as it is the
+# fastest and has the longest number sequence.
+#
+# Further information about SPRNG can be found at http://sprng.cs.fsu.edu/
+# The link to the users guide to installation on various platforms
+# (http://daniel.scri.fsu.edu/www/version1.0/platforms.html) may be useful
+# to address compilation problems with the SPRNG 1 version used in GENESIS.
+# 
+# As of June, 2001, the GENESIS developers have not successfully
+# built the SPRNG libraries under SunOS 4.1.  If you are running
+# SunOS 4.1, you should disable compiling of SPRNG.
+# -- The above also applies to MacOSX and, probably, Darwin.
+#
+# If you are compiling on a 64-bit SGI, change "lfg" to "lcg64" below.
+
+SPRNG_LIB = lfg
+
+# Disable compiling of SPRNG by uncommenting the following line and
+# commenting out all the other SPRNG lines below.  If GENESIS has
+# already been compiled, you'll have to do "make clean" before making
+# GENESIS again.
+#
+# SPRNG_FLAG=
+#
+
+SPRNG_FLAG = -DINCSPRNG
+SPRNGLIB   = sprng/lib/lib$(SPRNG_LIB).a
+SPRNGDIR   = sprng
+
+
+# ----------------------------------------------------------------------
+# D. DEFINITIONS FOR SPECIFIC OPERATING SYSTEM AND COMPILER IN USE
+# ----------------------------------------------------------------------
+#
+# Below are some compiler dependent settings for various system/compiler
+# combinations. Uncomment the appropriate macro settings for your system
+# and compiler combination.
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:      SunOS 4.1.x
+# Compiler:    SunOS 4.1.x "cc"
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=sun4
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-O
+# LD=ld
+
+## NOTE: If you get unresolved references for X11 library symbols in the
+## final link step during compilation, add
+##
+##    -Bstatic
+##
+## to the LDFLAGS definition here.  This is a documented problem with
+## X11 and SunOS shared libraries.  If you want information on fixes for
+## this problem look for faq #112 in:
+##
+##    http://www.x.org/ftp/contrib/faqs/x-faq-multipart/x-faq-5
+##
+
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO
+
+# end SunOS 4.1.x
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Solaris 2.x (A.K.A. SunOS 5.x)
+# Compiler:	Sun Workshop "cc"
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=Solaris
+# OS=SYSV
+
+# XINCLUDE=/usr/openwin/include
+# XLIB=/usr/openwin/lib
+
+## Note: Do not increase the optimization level higher than -xO1, at least
+## for version "WorkShop Compilers 5.0 98/12/15 C 5.0".  Higher levels cause
+## at least one of the XODUS widgets to fail to work properly, even though no
+## compilation errors are reported.  GCC at higher optimization levels does
+## not exhibit this problem.
+
+# CC=cc
+# CFLAGS=-Xt -xO1 -xlibmil -xprefetch -DBIGENDIAN
+# CPP = /usr/ccs/lib/cpp -P
+
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+## NOTE: In Solaris 2.4 through Solaris 2.6, the Sun-issued "yacc"
+## appears to produce code that interacts badly with the Sun Workshop
+## "cc" compiler when compiling the GENESIS yacc files.  If you are
+## running a version of Solaris prior to Solaris 2.7, you will need to
+## obtain the GNU bison distribution (see ftp://ftp.gnu.org), compile
+## it, install it on your system, then uncomment the following lines
+## (the ones with "bison" in them) and also comment out the use of
+## "yacc" further below.  (We have successfully compiled GENESIS on
+## Solaris 2.7 using the Sun-supplied yacc, so we don't believe you need
+## to use bison for Solaris 2.7.)
+##
+## If you have a version of Solaris before 2.7, you will also need to
+## obtain the GNU "flex" distribution (see ftp://ftp.gnu.org), compile
+## it, install it, then uncomment the following lines and comment out
+## the use of "lex" below.  Substitute the location of the flex library
+## on your system for <flex-lib-path> (or remove -L<flex-lib-path> if
+## the library is installed in a standard library path).
+##
+## YACC = bison -y
+## PARSER = bison
+##
+## LEX = flex -l
+## LEXLIB = -L<flex-lib-path> -lfl
+## LIBS= $(LEXLIB) -lm
+##
+## If you are using Solaris 2.7, leave the YACC and LEX lines above
+## commented out, and uncomment the following lines instead:
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# end	Solaris 2.x (aka SunOS 5.x) using Sun Workshop C compiler
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Solaris 2.x (A.K.A. SunOS 5.x)
+# Compiler:	GCC 2.8.1
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=Solaris
+# OS=SYSV
+
+# XINCLUDE=/usr/openwin/include
+# XLIB=/usr/openwin/lib
+
+# CC=gcc
+# CFLAGS=-O2 -DBIGENDIAN
+# CPP = /usr/ccs/lib/cpp -P
+
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+## You may choose to use bison and/or flex here instead of the
+## Sun-supplied yacc and/or lex.  If so, uncomment the following lines,
+## and comment out the default yacc/lex definitions further below.
+##
+## YACC = bison -y
+## PARSER = bison
+##
+## LEX = flex -l
+## LEXLIB = -L<flex-lib-path> -lfl
+## LIBS= $(LEXLIB) -lm
+
+# YACC=yacc
+# PARSER=lex
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+# end	Solaris 2.x (aka SunOS 5.x) using GCC 2.8.1 compiler
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	SGI IRIX 6.5
+# Compiler:	SGI C compiler (producing new-style 32 bit executables)
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## The settings in this section are for N32 mode, the SGI "new" style
+## 32-bit executables with N64 calling conventions and optimizations.
+## They are current as of IRIX 6.5.3 and 6.5.8, tested on R10000-based
+## Octane and O2 systems using the MIPSPro compiler version 7.30.
+## There is a separate section below for 64-bit executables.
+
+# MACHINE = irix
+# OS = SYSV
+
+# XINCLUDE = /usr/include
+# XLIB = .
+
+# CC = cc
+# CPP = /lib/cpp -P
+
+# CFLAGS = -n32 -xansi -signed -O2 -DBIGENDIAN -OPT:Olimit=6000 $(IRIX_WARN)
+
+# IRIX_HACK = -w
+# LDFLAGS = -n32 -L/usr/lib32 -LD_MSG:off=85,134
+# LD = ld
+
+# RANLIB = ranlib
+# AR = ar
+
+# YACC = yacc
+# PARSER = yacc
+# LEX = lex
+# LEXLIB = -ll
+# LIBS = $(LEXLIB) -lm
+
+# TERMCAP = -lcurses
+# TERMOPT = -DTERMIO -DDONT_USE_SIGIO
+
+## UNCOMMENT ONLY ONE OF THE FOLLOWING.
+##
+## If you are using IRIX 6.5.8, uncomment the next IRIX_WARN line:
+##
+# IRIX_WARN = -woff 1116,1552,1174,3434
+##
+## If you are using IRIX above 6.5.3 but less than 6.5.8, use the following:
+##
+# IRIX_WARN = -woff 1048,1116,1155,3170
+##
+## Explanation of the above: the CFLAGS and LDFLAGS settings
+## purposefully disable reporting of certain kinds of warnings via the
+## -woff option, because they are either silly warnings, or else things
+## we cannot fix because they are in code imported from elsewhere (e.g.,
+## netCDF), or else things that could be fixed but are not worth it at
+## this time.  Yes, we know this is poor practice, but given limited
+## resources, it's the best we can do.
+
+# end SGI IRIX 6.5.x new-style 32-bit
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	SGI IRIX 6.5
+# Compiler:	SGI C compiler (producing old-style 32-bit executables)
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## The settings in this section are for O32 mode, the SGI "old" style
+## 32-bit executables.  They are current as of IRIX 6.5.3 and 6.5.8,
+## tested on R10000-based Octane and O2 systems.
+
+# MACHINE = irix
+# OS = SYSV
+
+# XINCLUDE = /usr/include
+# XLIB = .
+
+# CC = cc
+# CPP = /lib/cpp -P
+
+# CFLAGS = -o32 -xansi -signed -O2 -DBIGENDIAN -Olimit 6000 -Wl,-woff,85 -Wl,-woff,134
+# IRIX_HACK = -w
+# LDFLAGS = -o32 -cckr
+# LD = ld
+
+# RANLIB = ranlib
+# AR = ar
+
+# YACC = yacc
+# PARSER = yacc
+# LEX = lex
+# LEXLIB = -ll
+# LIBS = $(LEXLIB) -lm
+
+# TERMCAP = -lcurses
+# TERMOPT = -DTERMIO -DDONT_USE_SIGIO
+
+## end SGI IRIX 6.5.x old-style 32-bit
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	SGI IRIX 6.4
+# Compiler:	SGI C compiler (producing old-style 32-bit executables)
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## This configuration has not been tested by the Caltech GENESIS group since
+## the introduction of IRIX 6.5.  If you have a 6.4 system and encounter
+## trouble here, please mail genesis@bbb.caltech.edu.
+
+# MACHINE=irix
+# OS=SYSV
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc -32
+# CPP=/lib/cpp -P
+# CFLAGS=-cckr -O -G 0 -DBIGENDIAN
+# IRIX_HACK = -w
+
+# LD=ld -32
+# LDFLAGS= -O
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=
+# TERMOPT=-DPLAINTERM
+
+## end SGI IRIX 6.4 32-bit
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	SGI IRIX 6.5
+# Compiler:	SGI C compiler (producing 64-bit executables)
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## This configuration is known to work for (and has only been tested on)
+## SGI Origin 2000 running IRIX 6.5.10 with MIPSPro compiler 7.3.1.1m.  It
+## may work for other architectures and OS versions, but the GENESIS
+## maintainers do not have experience with other combinations.  Please mail
+## genesis@bbb.caltech.edu if you use these settings and tell us about it.
+## If these settings do not work for you, the "new-style 32-bit binary"
+## settings above should still work (but more slowly).
+##
+## If you are using these settings, you *must* also change the file
+## src/sprng/SRC/make.irix to (1) comment out the indicated 32-bit
+## sections and (2) uncomment the indicated 64-bit sections.
+
+# MACHINE=irix
+# OS=SYSV
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib64
+
+# CC=cc -cckr -mips4 -64 -LNO -G 0 -r10000
+# CPP=/lib/cpp -P
+# CFLAGS=-O2 -Ddecalpha -DBIGENDIAN -DLONGWORDS
+# IRIX_HACK = -w
+# LD=ld -mips4 -64 -G 0
+# LDFLAGS=-O2 -LNO -r10000 -mips4 -64 -G 0
+
+# RANLIB=ranlib
+# AR=ar
+
+## It appears safest to use bison and flex instead of yacc and lex.
+## See the README file for information on obtaining bison and flex.
+
+# YACC=bison -y
+# PARSER=bison
+# LEX=flex -l
+# LEXLIB=-lfl
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=
+# TERMOPT=-DPLAINTERM
+
+# end SGI IRIX 6.x 64-bit
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	SGI IRIX 4.x
+# Compiler:	SGI C compiler
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=irix
+# OS=SYSV
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc -cckr -G 5
+# CPP=/lib/cpp -P
+# CFLAGS=-O -DBIGENDIAN
+# IRIX_HACK = -w
+# LD=ld
+# LDFLAGS=-G 5
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=
+# TERMOPT=-DPLAINTERM
+
+# end SGI IRIX 4.x
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	DECStation running Ultrix 4.x or 3.x
+# Compiler:	DEC C compiler
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=mips
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+## You might have to play with the value of the -G option to get
+## GENESIS to compile/link properly.
+
+# CC=cc -G 5
+# CPP=/lib/cpp -P
+# CFLAGS=-O
+# LD=ld
+# LDFLAGS=-G 5
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO
+
+# end DECStation running Ultrix 4.x or 3.x
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	DEC Alpha running Digital UNIX version 4
+# Compiler:	DEC cc compiler
+#
+# This combination is known to FAIL.  Support is presently unavailable.
+# If you succeed in getting this to work yourself, please send your
+# changes back to the GENESIS developers.
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=alpha
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc -std
+# CPP=/lib/cpp -P
+# CFLAGS=-O2 -DLONGWORDS
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= -ldnet_stub $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+# end	DEC Alpha running OSF/1 release 2 or higher
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	DEC Alpha running Digital UNIX version 3.2
+# Compiler:	DEC cc compiler
+#
+# This combination is known to FAIL.  Support is presently unavailable.
+# If you succeed in getting this to work yourself, please send your
+# changes back to the GENESIS developers.
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=alpha
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-g -std0 -taso -DLONGWORDS # -Olimit 5000
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= -ldnet_stub $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+# end	DEC Alpha running OSF/1 release 2 or higher
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	DEC Alpha OSF1/Digital UNIX version 3.2
+# Compiler:	GNU GCC (egcs-2.91.66, egcs-1.1.2 release)
+#
+# This combination is known to FAIL.  Support is presently unavailable.
+# If you succeed in getting this to work yourself, please send your
+# changes back to the GENESIS developers.
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=alpha
+# OS=BSD
+
+# XINCLUDE=/usr/X11R6/include
+# XLIB=/usr/lib
+
+# CC=gcc
+# CPP=/lib/cpp -P
+# CFLAGS=-g -DLONGWORDS
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= -ldnet_stub $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+# end	DEC Alpha running OSF/1 release 2 or higher
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	DEC Alpha running OSF/1 release 2 or higher
+# Compiler:	DEC cc compiler
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=alpha
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+## The c89 compiler doesn't compile cleanly across alpha OS releases.
+## Under OSF/1 v2  the -O option results in runtime problems in Xodus.
+## The -O problem may also exist for OSF/1 v3 systems.
+
+# CC=cc -std0
+# CPP=/lib/cpp -P
+# CFLAGS=-O -DLONGWORDS
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= -ldnet_stub $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+# end	DEC Alpha running OSF/1 release 2 or higher
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Cray T3D (as installed at Pittsburgh Supercomputing Center)
+# Compiler:	UNICOS "cc"
+#
+#	see Makefile.t3d for other important settings
+#
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=t3d
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-O -DCRAY
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=
+# TERMOPT=-DPLAINTERM
+
+# end	Cray T3D (as installed at Pittsburgh Supercomputing Center)
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Cray T3E (as installed at Pittsburgh Supercomputing Center)
+# Compiler:	UNICOS "cc"
+#
+#	see Makefile.t3e for other important settings
+#
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# MACHINE=t3e
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc
+# CPP=cpp -P
+# CFLAGS=-O -DCRAY -DT3E
+# LD=cld
+# LDFLAGS=-Xm
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=
+# TERMOPT=-DPLAINTERM
+
+# end	Cray T3E (as installed at Pittsburgh Supercomputing Center)
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Intel Paragon (as installed at Caltech)
+# Compiler:	Intel "icc" compiler
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## NOTE: icc has trouble cross compiling using the standard make as it
+##       insists on adding "-target sun4" in the default .c.o rule
+##       and some of the Xodus makefiles don't overide this.  We
+##	 suggest using GNU make, which doesn't have this problem.
+
+# MACHINE=paragon
+# OS=SYSV
+
+# XINCLUDE=/usr/include
+# XLIB=.
+
+# CC=icc
+# CPP=cpp860 -P
+# CFLAGS=-nx -O
+# LD=ld860
+# LDFLAGS=-nx
+
+# RANLIB=ranlib
+# AR=ar860
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=
+# TERMOPT=-DPLAINTERM
+
+# end Intel Paragon (as installed at Caltech)
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Linux 1.2.x and up on Intel x86-based systems
+# Compiler:	GCC
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## 2000-05-23
+## Termcap/ncurses issues: The shell library makes reference to the
+## termcap library.  Some Linux distributions have an ncurses library
+## which is includes termcap emulation.  GENESIS appears to work
+## properly with the ncurses supplied with Red Hat Linux 5.1 and higher
+## and Debian Linux (glibc2.1, egcs-2.91.66).  However, linking with
+## ncurses is known to have resulted in core dumps in GENESIS in older
+## Linux versions.
+##
+## If you encounter problems linking with the TERMCAP flags listed below
+## or the GENESIS command line interface does not work, try the
+## following alternatives:
+##
+## 1) TERMCAP = -ltermcap
+##
+## 2) (If you are using SuSE Linux)
+##    TERMCAP = /usr/lib/termcap/libtermcap.a
+##
+## 3) (If you are using Red Hat Linux prior to version 6.0)
+##    TERMCAP = /usr/lib/libtermcap.a
+
+# MACHINE=Linux
+# OS=BSD
+
+# XINCLUDE=/usr/X11R6/include
+# XLIB=/usr/X11R6/lib
+
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-O2 -D__GLIBC -D__NO_MATH_INLINES
+
+# LD=ld
+# LDFLAGS=-L/usr/lib
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=bison -y
+# PARSER=bison
+# LEX=flex -l
+# LEXLIB=-lfl
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=-lncurses
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+## For Linux using gcc, usually there will be a link from /lib/cpp to
+## wherever cpp is installed.  If not, try to find the gcc-lib
+## installation, perhaps under /usr/lib/gcc-lib, and either create a
+## symlink from /lib/cpp or change the CPP define below to use the full
+## path to where cpp lives.
+##
+## CPP = /full/path/to/cpp -P
+
+# end	Linux 1.2.x and up on Intel x86-based systems
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Linux 2.x and up on PPC-based systems (LinuxPPC)
+# Compiler:	GCC
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## This configuration was provided by a GENESIS user, Alfonso
+## Delgado-Reyes.  Please make sure that you have up-to-date and
+## complete installations of flex and bison if you are using this
+## configuration.
+
+## If you encounter problems linking with the TERMCAP flags listed below
+## or the GENESIS command line interface does not work, try the
+## following alternatives:
+##
+## 1) TERMCAP = -ltermcap
+##
+## 2) TERMCAP = /usr/lib/termcap/libtermcap.a
+##
+## 3) TERMCAP = /usr/lib/libtermcap.a
+
+# MACHINE=LinuxPPC
+# OS=BSD
+
+# XINCLUDE=/usr/X11R6/include
+# XLIB=/usr/X11R6/lib
+
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-O2 -D__GLIBC -D__NO_MATH_INLINES
+
+# LD=ld
+# LDFLAGS=-L/usr/lib
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=bison -y
+# PARSER=bison
+# LEX=flex -l
+# LEXLIB=-lfl
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=-lncurses
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+
+# end	Linux 2.x and up on PPC-based systems (LinuxPPC)
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:       MacOS X and Darwin (PPC-based systems)
+# Compiler:     Apple Computer, Inc. v.gcc-932.1, based on gcc v.2.95.2
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## This configuration was provided by a GENESIS user, Alfonso
+## Delgado-Reyes.  Please make sure that you have up-to-date and 
+## complete installations of flex and bison if you are using this 
+## configuration. If you don not have bison grab it from: 
+## http://www.ibiblio.org/pub/gnu/bison/
+
+MACHINE=MacOSXDarwin
+OS=BSD
+
+XINCLUDE=/usr/X11R6/include
+XLIB=/usr/X11R6/lib
+
+CC=cc
+CPP=/usr/libexec/gcc/darwin/`/usr/bin/arch`/default/cpp -E -P -traditional
+CFLAGS=-I/usr/include/sys -O2 -pipe -D__NO_MATH_INLINES -DBIGENDIAN
+
+LD=ld
+LDFLAGS=
+
+RANLIB=ranlib
+AR=ar
+
+YACC=bison -y
+PARSER=bison
+
+LEX=lex
+LEXLIB=-ll
+LIBS= $(LEXLIB)
+ 
+TERMCAP=-lcurses
+TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+ 
+# end  MacOS X and Darwin (PPC-based systems)
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	FreeBSD 4.1
+# Compiler:	GCC C compiler
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## FreeBSD comes with Berkeley yacc and is used here.  A fix in the yacc
+## specs allows this version of yacc to work where it failed under Linux
+## systems with Berkeley yacc.  The default settings for yacc and lex
+## should work.
+
+# MACHINE=FreeBSD
+# OS=BSD
+
+# XINCLUDE=/usr/X11R6/include
+# XLIB=/usr/X11R6/lib
+
+# CC=cc
+# CPP=/usr/libexec/cpp -P
+# CFLAGS=-O2 -D__GLIBC -D__NO_MATH_INLINES
+
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP=-ltermcap
+# TERMOPT=-DTERMIO
+
+# end	FreeBSD
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	HP running HPUX (versions unknown)
+# Compiler:	HP C compiler
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## The GENESIS maintainers have very little experience with HPUX and the
+## status of this configuration is unknown.  There have been reports of
+## display problems under HPUX. 
+
+# MACHINE=hpux
+# OS=SYSV
+
+# XINCLUDE=/usr/include/X11R5
+# XLIB=/usr/lib/X11R5
+
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-O
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP =
+# TERMOPT =	-DPLAINTERM
+
+# end	HP running HPUX (versions unknown)
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	IBM AIX 4.x
+# Compiler:	IBM 'xlc' C compiler version 5
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+#
+# This combination of flags has been tested on IBM RS/6000 computers
+# running AIX 4.2 and 4.3, as well as the teraflop-scale Blue Horizon
+# Power3 system at SDSC.  We thank Chuck Charman and Giri Chukkpalli
+# for their help.
+
+# MACHINE = aix
+# OS = SYSV
+
+# XINCLUDE = /usr/include
+# XLIB = /usr/lib
+
+# CC = xlc
+# CPP = /lib/cpp -P
+##
+## If you are using an IBM Power3 system, such as the Teraflops, add the
+## following to CFLAGS for better optimization:   -qarch=pwr3 -qtune=pwr3
+##
+# CFLAGS = -DBIGENDIAN -U__STR__ -ma -O2 -qchars=signed -qmaxmem=8192
+# LD = ld
+# LDFLAGS =
+
+# RANLIB = ranlib
+# AR = ar
+
+# YACC = yacc
+# PARSER = yacc
+# LEX = lex
+# LEXLIB = -ll -lcurses -lcur
+# LIBS = $(LEXLIB)  -lm -lrs2 -lbsd -lc
+
+# TERMCAP = -lcurses -lcur
+# TERMOPT = -DDONT_USE_SIGIO
+
+# end	IBM RS6000 running AIX
+
+
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:	Other UNIX system
+# Compiler:	Other compiler
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+# Other UNIX systems
+#
+# Settings are general and the underlying makefile tries to set certain
+# system dependent macros to something which will work everywhere.
+#
+# Note: you'll have to at least set the OS macro to either SYSV or
+#       BSD to indicate either a System V or a Berkeley variant OS
+#       respectively.  Also probably need to set RANLIB to echo if
+#       there is no ranlib command on your system.
+#
+
+# MACHINE=other
+
+# !!! OS must be set properly !!!  Uncomment *one* of the following.
+
+# OS=SYSV
+# OS=BSD
+
+# XINCLUDE=/usr/include
+# XLIB=/usr/lib
+
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-O
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB) -lm
+
+# TERMCAP =
+# TERMOPT =	-DDONT_USE_SIGIO
+
+# end	System specific suggested settings
+
+
+# ----------------------------------------------------------------------
+# E. CUSTOM SETTINGS
+#
+# Here is the place to overide macro settings from above selectively.
+# You should uncomment one of the above sections and uncomment items in
+# this section to override the standard settings.
+# ----------------------------------------------------------------------
+
+## This is one of SYSV for System V UNIX varients and BSD for Berkeley
+## vartients.
+
+# OS =		BSD
+
+
+##
+## X11 settings
+##
+
+## Typical settings:
+
+# XLIB	=	/usr/lib
+# XINCLUDE =	.
+
+## For some versions of XFree86 (PC's with Linux) XLIB will need to be
+## set as follows
+
+# XLIB	=	/usr/X11/lib
+
+
+## For SUN OpenWindows:
+#
+# XLIB	=	/usr/openwin/lib
+# XINCLUDE =	/usr/openwin/include
+#
+
+##
+## TMPDIR is a directory for temp files during making of GENESIS libraries.
+## change as needed if the default doesn't have enough space.  The CCTMPDIR
+## is a compiler specific option for compiler temp files.  The commented line
+## below is the SunOS cc option.
+##
+
+TMPDIR = /tmp
+
+## For SunOS 4.x
+# CCTMPDIR = -temp=$(TMPDIR)
+
+
+##
+## C compiler
+##
+
+## Typical settings:
+#
+# CC=cc
+# CPP=/lib/cpp -P
+# CFLAGS=-O
+# LD=ld
+
+## GCC C compiler:
+##
+## For gcc, usually there will be a link from /lib/cpp to wherever cpp
+## is installed.  If not, try to find the gcc-lib installation, perhaps
+## under /usr/lib/gcc-lib and either create a symlink from /lib/cpp or
+## change the CPP define below to use the full path to where cpp lives.
+##
+## Later versions of gcc compile GENESIS (with many warnings) without
+## using the -traditional option.  If the compile fails you might try
+## adding -traditional to CFLAGS or updating your compiler.
+
+# CC=gcc
+# CPP=/lib/cpp -P
+# CFLAGS=-O
+# LD=ld
+
+
+##
+## LDFLAGS are the final link options
+##
+
+# LDFLAGS=
+
+
+##
+## RANLIB
+##
+
+## Set the RANLIB macro to "RANLIB = echo" on systems without ranlib.
+## (Only important to set for MACHINE=other and perhaps Linux; all other
+##  MACHINEs will ignore the value set here.)
+##
+## AR is the library archive program used to build the Xodus widget
+## libraries
+
+# RANLIB=ranlib
+# AR=ar
+
+
+##
+## YACC and LEX options.
+##
+
+# YACC=yacc
+# PARSER=yacc
+# LEX=lex
+# LEXLIB=-ll
+
+## If you have GNU bison and flex uncomment the following lines.
+##
+## YACC=bison -y
+## PARSER=bison
+## LEX=flex -l
+## LEXLIB=-lfl
+##
+## Solaris 2.4 users note: the yacc for Solaris 2.4 produces an
+## bad parse table which causes the parser to fail.  Please use
+## bison/flex.
+##
+## Linux users note: use flex and bison rather than yacc and lex.
+## lex and yacc are scripts which use bison and flex on some systems
+## while others have an independent yacc in addition to bison.
+## The independent yacc output will fail to compile.
+##
+## SGI user note: the SGI lex defines a relatively small token text
+## buffer of 200 characters.  Lex will exit if a token's text exceeds
+## this limit (e.g. a very long command argument like shape coords
+## lists).  Changes have been made to avoid this problem.  If you
+## encounter it anyway then using flex will fix it.
+##
+## Other users: if you don't have bison, flex, yacc or lex, see the
+## section in src/README about getting bison and flex or using the
+## preprocessed yacc and lex output.
+
+
+##
+## LIBS the link libraries (not including X11)
+##
+
+# LIBS 	= 	$(LEXLIB) -lm
+
+
+# ----------------------------------------------------------------------
+# F. BEGINNING OF NON-CONFIGURABLE DEFINITIONS
+#
+# This end the user configurable part of the Makefile.  You shouldn't
+# have to change things below this point.
+# ----------------------------------------------------------------------
+
+INSTALLBIN     = $(INSTALL)/bin
+
+#
+# X11 libraries
+#
+
+XLIBS =		-L$(XLIB) \
+		-lXt \
+		-lX11
+
+RCSRELEASE =	DR2-2-P1
+MF = 		Makefile.$(MACHINE)
+SHELL = 	/bin/sh
+
+SIMLIB	=	../lib
+
+XODUSLIB = 	Xodus
+
+INTERP =	ss/ss.o shell/shelllib.o
+
+BASECODE =	sim/simlib.o sys/utillib.o $(INTERP)
+
+OBJLIBS =	buffer/buflib.o \
+		segment/seglib.o \
+		hh/hhlib.o \
+		device/devlib.o \
+		out/outlib.o \
+		olf/olflib.o \
+		tools/toollib.o \
+		concen/conclib.o \
+		hines/hineslib.o \
+		user/userlib.o \
+		param/paramlib.o \
+		pore/porelib.o \
+		$(OLDCONNOBJ) \
+		$(DISKIOOBJ) \
+		$(KINETICSOBJ) \
+		newconn/newconnlib.o
+
+XODUS 	=	$(XODUSLIB)/xo/xolib.o \
+		$(XODUSLIB)/widg/widglib.o \
+		$(XODUSLIB)/draw/drawlib.o \
+		$(XODUSLIB)/Draw/libDraw.a \
+		$(XODUSLIB)/Widg/libWidg.a \
+		$(XODUSLIB)/Xo/libXo.a
+
+EXTRALIBS =  	$(SPRNGLIB) $(TERMCAP)
+
+SUBDIR =        sys ss sim $(SPRNGDIR) shell newconn $(OLDCONNDIR) \
+		buffer concen device hh hines olf out segment \
+                tools user param pore convert $(DISKIODIR) \
+                $(KINETICSDIR) Xodus
+
+NXSUBDIR =	sys ss shell sim $(SPRNGDIR) newconn oldconn \
+		buffer concen device hh hines olf out segment \
+                tools user param pore convert $(DISKIODIR) \
+		$(KINETICSDIR)
+
+MINSUBDIR =	sys ss shell sim $(SPRNGDIR)
+
+LIBLIST =	output \
+		hh \
+		devices \
+		buffer \
+		segment \
+		user \
+		xo \
+		draw \
+		widg \
+		olf \
+		tools \
+		concen \
+		hines \
+		param \
+		pore \
+		newconn \
+		$(DISKIOLIB) \
+		$(OLDCONNLIB) \
+		$(KINETICSLIB)
+
+NXLIBLIST = 	output \
+		hh \
+		devices \
+		buffer \
+		segment \
+		user \
+		olf \
+		tools \
+		concen \
+		hines \
+		param \
+		pore \
+		newconn \
+		$(DISKIOLIB) \
+		$(OLDCONNLIB) \
+		$(KINETICSLIB)
+
+#
+# all is now the default target
+#
+
+all: code_g default
+
+genesis: all
+
+default: liblist
+	@make -f $(MF) CC_IN="$(CC)" TMPDIR="$(TMPDIR)" LD_IN="$(LD)" AR_IN="$(AR)" RANLIB_IN="$(RANLIB)" CPP_IN="$(CPP)" YACC_IN="$(YACC)" LEX_IN="$(LEX)" LEXLIB_IN="$(LEXLIB)" OS_IN="$(OS)" MACHINE_IN="$(MACHINE)" INSTALL="$(INSTALL)" INSTALLBIN="$(INSTALLBIN)" COPT="$(CFLAGS) $(CCTMPDIR) -D$(PARSER) $(DISKIOFLAGS) $(SPRNG_FLAG)" IRIX_HACK_IN="$(IRIX_HACK)" LDFLAGS_IN="$(LDFLAGS)" SPRNG_LIB="$(SPRNG_LIB)" XLIBS="$(XLIBS)" XINCLUDE="$(XINCLUDE)" LIBS="$(LIBS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" MF="$(MF)" SUBDIR="$(SUBDIR)" DISKIOSUBDIR="$(DISKIOSUBDIR)" BASECODE="$(BASECODE)" OBJLIBS="$(OBJLIBS)" EXTRALIBS="$(EXTRALIBS)" XODUS="$(XODUS)" RCSRELEASE="$(RCSRELEASE)" libs genesis
+
+nxdefault: nxliblist
+	@make -f $(MF) CC_IN="$(CC)" TMPDIR="$(TMPDIR)" LD_IN="$(LD)" AR_IN="$(AR)" RANLIB_IN="$(RANLIB)" CPP_IN="$(CPP)" YACC_IN="$(YACC)" LEX_IN="$(LEX)" LEXLIB_IN="$(LEXLIB)" OS_IN="$(OS)" MACHINE_IN="$(MACHINE)" INSTALL="$(INSTALL)" INSTALLBIN="$(INSTALLBIN)" COPT="$(CFLAGS) $(CCTMPDIR) -D$(PARSER) $(DISKIOFLAGS) $(SPRNG_FLAG)" IRIX_HACK_IN="$(IRIX_HACK)" LDFLAGS_IN="$(LDFLAGS)" SPRNG_LIB="$(SPRNG_LIB)" LIBS="$(LIBS)" MF="$(MF)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" SUBDIR="$(SUBDIR)" NXSUBDIR="$(NXSUBDIR)" MINSUBDIR="$(MINSUBDIR)" DISKIOSUBDIR="$(DISKIOSUBDIR)" BASECODE="$(BASECODE)" OBJLIBS="$(OBJLIBS)" EXTRALIBS="$(EXTRALIBS)" nxlibs nxgenesis
+
+mindefault: minliblist
+	@make -f $(MF) CC_IN="$(CC)" TMPDIR="$(TMPDIR)" LD_IN="$(LD)" AR_IN="$(AR)" RANLIB_IN="$(RANLIB)" CPP_IN="$(CPP)" YACC_IN="$(YACC)" LEX_IN="$(LEX)" LEXLIB_IN="$(LEXLIB)" OS_IN="$(OS)" MACHINE_IN="$(MACHINE)" INSTALL="$(INSTALL)" INSTALLBIN="$(INSTALLBIN)" COPT="$(CFLAGS) $(CCTMPDIR) -D$(PARSER) $(SPRNG_FLAG)" IRIX_HACK_IN="$(IRIX_HACK)" LDFLAGS_IN="$(LDFLAGS)" SPRNG_LIB="$(SPRNG_LIB)" LIBS="$(LIBS)" MF="$(MF)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" SUBDIR="$(SUBDIR)" NXSUBDIR="$(NXSUBDIR)" MINSUBDIR="$(MINSUBDIR)" BASECODE="$(BASECODE)" OBJLIBS="$(OBJLIBS)" EXTRALIBS="$(EXTRALIBS)" minlibs mingenesis
+
+code_g:
+	@make -f $(MF) CC_IN="$(CC)" TMPDIR="$(TMPDIR)" LD_IN="$(LD)" CPP_IN="$(CPP)" YACC_IN="$(YACC)" LEX_IN="$(LEX)" LEXLIB_IN="$(LEXLIB)" OS_IN="$(OS)" MACHINE_IN="$(MACHINE)" INSTALL="$(INSTALL)" INSTALLBIN="$(INSTALLBIN)" COPT="$(CFLAGS) $(CCTMPDIR) -D$(PARSER)" IRIX_HACK_IN="$(IRIX_HACK)" LDFLAGS_IN="$(LDFLAGS)" LIBS="$(LIBS)" MF="$(MF)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" SUBDIR="$(SUBDIR)" NXSUBDIR="$(NXSUBDIR)" MINSUBDIR="$(MINSUBDIR)" BASECODE="$(BASECODE)" OBJLIBS="$(OBJLIBS)" EXTRALIBS="$(EXTRALIBS)" code_g
+
+nxgenesis: code_g nxdefault
+nxall: code_g nxdefault
+
+mingenesis: code_g mindefault
+minall: code_g mindefault
+
+liblist: Makefile
+	@echo "# liblist - This file is generated automatically." > liblist
+	@echo "#           DO NOT EDIT unless you are sure you" >> liblist
+	@echo "#           know what you are doing.  Generally" >> liblist
+	@echo "#           Makefile should be edited instead." >> liblist
+	@echo $(LIBLIST) | tr ' ' '\012' >> liblist
+
+nxliblist: Makefile
+	@echo "# nxliblist - This file is generated automatically." > nxliblist
+	@echo "#             DO NOT EDIT unless you are sure you" >> nxliblist
+	@echo "#             know what you are doing.  Generally" >> nxliblist
+	@echo "#             Makefile should be edited instead." >> nxliblist
+	@echo $(NXLIBLIST) | tr ' ' '\012' >> nxliblist
+
+minliblist: Makefile
+	@echo "# minliblist - This file is generated automatically." > minliblist
+	@echo "#              DO NOT EDIT unless you are sure you" >> minliblist
+	@echo "#              know what you are doing.  Generally" >> minliblist
+	@echo "#              Makefile should be edited instead." >> minliblist
+
+cleandist: clean
+	-(rm -rf $(INSTALL)/startup/*)
+	-(rm -rf $(INSTALL)/startup/.*simrc)
+	-(rm -rf $(INSTALL)/startup)
+	-(rm -rf $(INSTALL)/lib/*)
+	-(rm -rf $(INSTALL)/lib)
+	-(rm -rf $(INSTALL)/include/*)
+	-(rm -rf $(INSTALL)/include)
+	-(rm -f  $(INSTALL)/genesis)
+	-(rm -f  $(INSTALL)/nxgenesis)
+	-(rm -f  $(INSTALL)/mingenesis)
+	-(rm -rf $(INSTALL)/.*simrc)
+	-(rm -f  $(INSTALLBIN)/convert)
+	-(rm -f TAGS)
+	-(find . -name '*~' -exec rm -f {} ';')
+	@echo "Done with full clean"
+
+# -(rm -f `find . -name '*~'`)
+# @echo "Done with full clean"
+
+clean:
+	@make -f $(MF) MF="$(MF)" DISKIOSUBDIR="$(DISKIOSUBDIR)" SUBDIR="$(SUBDIR)" RCSRELEASE="$(RCSRELEASE)" SPRNG_LIB="$(SPRNG_LIB)" clean
+
+rcsclean:
+	@make -f $(MF) MF="$(MF)" SUBDIR="$(SUBDIR)" RCSRELEASE="$(RCSRELEASE)" rcsclean
+
+makedirs:
+	-@mkdir -p $(INSTALL)
+	-@mkdir -p $(INSTALLBIN)
+	-@mkdir -p $(INSTALL)/Doc
+	-@mkdir -p $(INSTALL)/Hyperdoc
+	-@mkdir -p $(INSTALL)/Scripts
+	-@mkdir -p $(INSTALL)/lib
+	-@mkdir -p $(INSTALL)/include
+	-@mkdir -p $(INSTALL)/startup
+	-@mkdir -p $(INSTALL)/src
+
+tags:
+	etags `find . /usr/include/X11/ -name '*.[chg]' ! -name '*@*'`
+	etags -a `find /usr/include -name '*.h'`
+
+install: makedirs
+	@make -f $(MF) MF="$(MF)" INSTALL="$(INSTALL)" INSTALLBIN="$(INSTALLBIN)" DISKIOSUBDIR="$(DISKIOSUBDIR)" SPRNG_LIB="$(SPRNG_LIB)" SUBDIR="$(SUBDIR)" RANLIB_IN="$(RANLIB)" install
+
+nxinstall: makedirs
+	@make -f $(MF) MF="$(MF)" INSTALL="$(INSTALL)" INSTALLBIN="$(INSTALLBIN)" DISKIOSUBDIR="$(DISKIOSUBDIR)" SPRNG_LIB="$(SPRNG_LIB)" NXSUBDIR="$(NXSUBDIR)" RANLIB_IN="$(RANLIB)" nxinstall
+
+mininstall: makedirs
+	@make -f $(MF) MF="$(MF)" INSTALL="$(INSTALL)" INSTALLBIN="$(INSTALLBIN)" SPRNG_LIB="$(SPRNG_LIB)" MINSUBDIR="$(MINSUBDIR)" RANLIB_IN="$(RANLIB)" mininstall
+
+
+# ----------------------------------------------------------------------
+# G. REVISION HISTORY
+# ----------------------------------------------------------------------
+
+# $Log: Makefile.dist,v $
+# Revision 1.146  2001/07/22 17:53:18  mhucka
+# Final updates for 2.2 release.
+#
+# Revision 1.145  2001/06/29 22:03:21  mhucka
+# Updates for more systems.
+#
+# Revision 1.144  2001/05/10 16:13:56  mhucka
+# More work on LinuxPPC.
+#
+# Revision 1.143  2001/05/10 16:12:03  mhucka
+# First version of PPC support, based on work by Alfonso Delgado-Reyes.
+#
+# Revision 1.142  2001/05/09 15:16:02  mhucka
+# Changes for IBM AIX and DEC Alpha.
+#
+# Revision 1.141  2001/03/30 05:20:00  mhucka
+# Updates for FreeBSD.
+#
+# Revision 1.140  2000/10/12 22:06:22  mhucka
+# Added minor comment to AIX section, and made the "makedirs" directive
+# ignore errors.
+#
+# Revision 1.139  2000/10/10 16:55:06  mhucka
+# Turns out that compiling with optimization settings higher than -xO1 with
+# the Solaris Workshop 5.0 cc compiler causes some widgets in Xodus to fail
+# to work properly.  So had to revise the compiler flags for Solaris case.
+#
+# Revision 1.138  2000/10/09 23:55:02  mhucka
+# More updates to several platforms.
+#
+# Revision 1.137  2000/09/21 19:39:58  mhucka
+# 1) Now using -O2 for gcc.
+# 2) Updated definitions for AIX
+#
+# Revision 1.136  2000/09/11 21:46:05  mhucka
+# nxinstall and mininstall weren't running the makedirs directive.
+#
+# Revision 1.135  2000/09/11 16:24:45  mhucka
+# Moved where TERMCAP is used, to EXTRALIBS.
+#
+# Revision 1.134  2000/07/12 08:52:02  mhucka
+# Fixed IRIX config to work for 6.5.8.
+# Added INSTALL/src to directories created by makedirs directive.
+#
+# Revision 1.133  2000/07/03 21:10:07  mhucka
+# Made a number of changes to the IRIX compilation flags, including changing
+# from using -cckr to -xansi.  The previous combination of flags didn't turn
+# out to work properly for both n32 and o32 and non-GNU make on the SGI.
+# Making it all work required changes to a lot of other files too.
+#
+# Revision 1.132  2000/06/23 04:18:48  mhucka
+# Added partial AIX support from Giri Chukkpalli and Chuck Charman @ SDSC.
+#
+# Revision 1.131  2000/06/21 23:44:02  mhucka
+# Fixed up some of the make clean directives.
+#
+# Revision 1.130  2000/06/21 23:43:07  mhucka
+# Additional changes to the ld flags under IRIX, plus some comments for the
+# IRIX section.
+#
+# Revision 1.129  2000/06/12 04:01:42  mhucka
+# 1) Added IRIX_HACK defines that were missing from previous check-in.
+# 2) Updated cc compiler options for irix.
+# 3) Made "make cleandist" remove TAGS file, made "make clean" leave it.
+#
+# Revision 1.128  2000/06/12 03:57:37  mhucka
+# Added an awful, bletcherous hack.  The variable IRIX_HACK is used in only two
+# places, ss/Makefile and convert/Makefile, to pass the -w option to the IRIX
+# cc compiler when y.tab.c is being compiled.  The reason is to avoid getting
+# two hundred warnings under the IRIX cc compiler.  The warnings are generated
+# for things like "statement is unreachable", but it's in code (y.tab.c) that's
+# generated by lex, so there's nothing we can do.  I wish there was a cleaner
+# way of supplying a flag selectively like this, without resorting to passing
+# IRIX_HACK all over the place just for this one thing.
+#
+# Revision 1.127  2000/06/07 05:51:04  mhucka
+# 1) Changed LINKFLAGS to LDFLAGS.
+# 2) Fixed IRIX flags to work with current version of GENESIS.
+# 3) Not using MACH_DEP_FLAGS anymore.
+# 4) Added missing param library to definition of LIBLIST.
+# 5) Don't delete liblist after all.
+#
+# Revision 1.126  2000/05/26 23:39:09  mhucka
+# Added new INSTALLBIN for things like the convert program (and other
+# utilities in the future).
+#
+# Revision 1.125  2000/05/26 22:42:12  mhucka
+# The target for genesis should make "all", not just "default".
+#
+# Revision 1.124  2000/05/26 22:18:55  mhucka
+# 1) Solaris needs -DBIGENDIAN in CFLAGS.
+# 2) There was an -I in the CFLAGS for Solaris.
+# 3) Added genesis, nxgenesis, mingenesis as make targets.
+# 4) Added more directories to make makedirs actions.
+#
+# Revision 1.123  2000/05/25 03:11:41  mhucka
+# Fixed a comment in the linux section.
+#
+# Revision 1.122  2000/05/25 03:07:50  mhucka
+# 1) Minor clean up of make clean actions.
+# 2) Added /usr/include/X11 to list of directories used for make tags
+# 3) Added SPRNG_LIB to list of vars passed for make install, so that
+#    the SPRNG library is installed.
+#
+# Revision 1.118  2000/04/19 07:34:13  mhucka
+# Added a remove of liblist; made the makedirs use -p.
+#
+# Revision 1.117  1999/12/31 08:30:06  mhucka
+# Tons of updates -- more than I can remember.
+#
+# Revision 1.113  1999/10/13 02:27:02  mhucka
+# Added changes for Red Hat 6.0.
+# Added changes for SGI IRIX.
+# Did major overhaul of comments througout file in an attempt
+# to improve clarity and visual impact.
+#
+# Revision 1.112  1999/08/22 04:42:13  mhucka
+# Various fixes, mostly for Red Hat Linux 6.0
+#
+# Revision 1.111  1999/08/22 03:22:09  mhucka
+# Tiny comment about where one of the Sun Solaris sections ends.
+#
+# Revision 1.110  1999/05/06 01:03:06  mhucka
+# Changed the configuration for SGI IRIX to match what I used to successfully
+# compile GENESIS 2.1 under IRIX 6.5.3 using SGI's C compiler version 7.2.1.
+#
+# Revision 1.109  1999/04/26 03:45:59  mhucka
+# Added a section for Solaris 2.x using GCC 2.8.1.  This seemed reasonable
+# to have in addition to the existing section for Solaris 2.x using the
+# SunPro C compiler.
+#
+# Revision 1.108  1998/08/28 17:11:02  dhb
+# Added comments for working around libtermcap.a not in /usr/lib for
+# some Linux variants.
+#
+# DR2-2-P1
+#
+# Revision 1.107  1998/07/22 06:03:34  dhb
+# Fix for conditional diskio library flags; prevents empty -D
+# options on compile lines
+#
+# Revision 1.106  1998/07/22  05:31:25  dhb
+# DR2-2
+#
+# Revision 1.105  1998/04/21  22:41:46  dhb
+# Support for excluding SPRNG
+#
+# Revision 1.104  1998/01/20 02:40:31  venkat
+# Cleaned up settings for SGI 5.x and 6.x . Used CFLAGS and LINKFLAGS instead of
+# crowding up the CC macro.
+#
+# Revision 1.103  1998/01/20 01:50:31  venkat
+# Added the -32 flag to CC for O32 settings on the SGI.
+# This is needed on later 6.x systems to explicitly
+# compile for 32-bit.
+#
+# Revision 1.102  1998/01/20  01:38:20  venkat
+# Removed extra tab in a blank line.
+#
+# Revision 1.101  1998/01/20  01:04:19  venkat
+# SGI Irix settings changes for 32 and 64-bit executables
+#
+# Revision 1.100  1998/01/15  01:16:28  venkat
+# Added the missing DISKIOSUBDIR macro in the default and nxdefault
+# command lines
+#
+# Revision 1.99  1998/01/14  23:27:40  venkat
+# Fixed error in addition of diskio specific flag settings in CFLAGS
+# for default and nxdefault targets.
+#
+# Revision 1.98  1998/01/14 21:52:33  venkat
+# diskio library enhancements to include FMT1 support. User can as before
+# opt to exclude the diskio library entirely. If included, FMT1 support
+# is incorporated by default. netcdf support is optional.
+#
+# Revision 1.97  1998/01/08  23:54:52  dhb
+# Support for SPRNG random number library.  User can select
+# which of the SPRNG generators is used.  All default SPRNG
+# generators are compiled and installed.
+#
+# Revision 1.96  1997/10/03 00:05:11  dhb
+# REL2-1-P1
+#
+# Revision 1.95  1997/08/12 22:04:39  dhb
+# Moved -lcurses from LIBS to LEXLIB to get code_g to link.
+#
+# Revision 1.94  1997/08/12 19:08:55  dhb
+# Additional comments at top to suggest commenting optional libraries
+# when having compile problems.
+#
+# Removed Linux a.out from diskio problem systems.
+#
+# Added -lcurses for aix compiles.
+#
+# Revision 1.93  1997/08/11 22:23:55  dhb
+# REL2-1
+#
+# Revision 1.92  1997/08/08 21:43:15  dhb
+# Added comments about requiring bison and flex for 64-bit IRIX
+#
+# Revision 1.91  1997/08/08 21:39:33  dhb
+# Added IRIX 6.x 64-bit settings from Elliot Menschik.
+#
+# Revision 1.90  1997/08/08 19:30:59  dhb
+# DR2-1-P4
+#
+# Revision 1.89  1997/08/01 18:54:25  dhb
+# Added comments on diskio compile problems for Paragon and T3E.
+#
+# Revision 1.88  1997/07/31 20:18:19  dhb
+# Fix to nxliblist actions so that comments appear in nxliblist
+#
+# Revision 1.87  1997/07/31 19:16:09  dhb
+# DR2-0-P3
+#
+# Revision 1.86  1997/07/25 23:36:14  dhb
+# Moved addtional oldconn library names to OLDCONNLIB (i.e.
+# axon synapse and personal).
+#
+# Revision 1.85  1997/07/25 01:33:52  dhb
+# Added kinetics and diskio as optional libraries
+# Added automatic generation of liblist files
+#
+# Revision 1.84  1997/07/18 19:02:13  dhb
+# Support for Cray T3E.
+#
+# Fix to paragon MACHINE macro setting
+#
+# Small comment changes
+#
+# Revision 1.83  1997/07/18 14:41:25  dhb
+# Simplified Makefile configuration by creating complete sets of
+# macro sets for various systems and compilers.  Corresponding
+# changes to make instructions.
+#
+# Revision 1.82  1997/06/30 18:50:21  dhb
+# Updated to DR2-1
+#
+# Revision 1.81  1997/06/12 23:57:56  dhb
+# Removed -traditional from several gcc CFLAGS lines and added
+# prominent comment about trying -traditional if a compile fails
+#
+# Revision 1.80  1997/06/12 23:47:26  dhb
+# Added -P to CPP defines in machine specific sections.
+#
+# Separated CPP define and explanation about finding cpp and
+# setting the CPP macro from the main Linux specific settings
+#
+# Made the all target the default so users can just type "make"
+#
+# Revision 1.79  1997/06/12 22:37:23  dhb
+# Added machine specific section for IRIX 6.x
+#
+# Revision 1.78  1996/11/01 23:53:15  dhb
+# REL2-0-P2
+#
+# Revision 1.77  1996/10/28  23:36:16  dhb
+# DR2-0-P7
+#
+# Added a new target called "nodefault" which is actually the default
+# Makefile target.  Prints a message that there is no default target
+# and to use "make all" instead.
+#
+# Revision 1.76  1996/10/07  21:25:25  dhb
+# DR2-0-P6
+#
+# Revision 1.75  1996/10/05  17:49:21  dhb
+# Added comments regarding use of ncurses on Linux systems.
+#
+# Revision 1.74  1996/08/10  22:36:04  dhb
+# DR2-0-P5
+#
+# Revision 1.73  1996/07/29  23:14:59  dhb
+# DR2-0-P4
+#
+# Revision 1.72  1996/07/09  06:30:29  dhb
+# Added PARSER=yacc as default value of PARSER; avoids empty
+# -D compiler argument
+#
+# Revision 1.71  1996/06/28  22:53:18  dhb
+# Additional mods for Paragon.
+#
+# DR2-0-P3
+#
+# Revision 1.70  1996/06/26  18:20:09  venkat
+# Added the PARSER macro to identify the parser (yacc / bison) used and passedf
+# it along with the COPTS macro to the sub-makes.
+#
+# Revision 1.69  1996/06/18  07:07:08  dhb
+# Support for AR macro.
+#
+# Revision 1.68  1996/05/24  22:44:38  dhb
+# Changed RCSRELEASE to DR2-0-P2
+#
+# Revision 1.67  1996/05/23  23:13:55  dhb
+# Added -P to default cpp command line.
+#
+# Removed t3d specific settings for LD and LDFLAGS as these are
+# handled in the lower level makefile.
+#
+# Revision 1.66  1996/05/17  21:14:04  dhb
+# T3D changes
+#
+# Revision 1.65  1995/12/13  23:18:08  dhb
+# REL2-0-P2
+#
+# Revision 1.64  1995/11/10  23:17:54  dhb
+# Updated RCSRELEASE for REL2-0-P1
+#
+# Revision 1.63  1995/11/08  00:10:44  dhb
+# Added -P option to cpp for hpux.
+#
+# Revision 1.62  1995/11/04  18:57:24  dhb
+# Additional comments for Solaris 2.4 yacc problem
+#
+# CCTMPDIR is added to the CFLAGS by passing it with the CFLAGS
+# macro via COPT macro on the sub make command line.
+#
+# Revision 1.61  1995/11/03  01:59:37  dhb
+# Added TMPDIR macro to allow setting an alternate temp directory
+# during the compile.
+#
+# Added instructions for:
+# 	SunOS 4.1.[234] unresolved X11 symbols problem
+#
+# 	Solaris 2.4 yacc problem
+#
+# Now we pass down LEXLIB on make code_g so we don't hardcode the
+# lex library in sys/Makefile.
+#
+# Revision 1.60  1995/09/27  20:35:05  dhb
+# DR2-0-P1
+#
+# Revision 1.59  1995/08/09  17:30:56  dhb
+# REL2-0
+#
+# Revision 1.58  1995/08/05  18:26:58  dhb
+# Small changes to flex comments regarding SGIs.
+#
+# Revision 1.57  1995/08/05  02:35:42  dhb
+# BETA2-0-P18
+#
+# Revision 1.56  1995/08/03  20:15:30  dhb
+# BETA2-0-P17
+#
+# Revision 1.55  1995/08/02  01:55:41  dhb
+# BETA2-0-P16
+#
+# Revision 1.54  1995/07/29  17:50:21  dhb
+# Added comments about using flex for SGI machines.
+#
+# BETA2-0-P15
+#
+# Revision 1.53  1995/07/21  19:47:06  dhb
+# HPUX changes.  Old comments regarding the need for special X11
+# libraries removed.  Machine specific settings added.
+#
+# BETA2-0-P14
+# /
+#
+# Revision 1.52  1995/07/08  19:28:40  dhb
+# Removed X11R3 support as Xodus will no longer compile with
+# anything less than X11R4.
+#
+# BETA2-0-P13
+#
+# Revision 1.51  1995/06/24  00:19:01  dhb
+# Addition FreeBSD related changes.
+#
+# Revision 1.50  1995/06/23  23:49:49  venkat
+# BETA2-0-P12
+#
+# Revision 1.49  1995/06/16  23:35:11  venkat
+# BETA2-0-P11
+#
+# Revision 1.48  1995/06/16  17:11:27  dhb
+# Added support for FreeBSD.
+#
+# Revision 1.47  1995/06/12  17:16:25  dhb
+# BETA2-0-P10
+#
+# Revision 1.46  1995/06/03  00:20:12  dhb
+# BETA2-0-P9
+#
+# Revision 1.45  1995/05/31  01:10:29  dhb
+# BETA2-0-P8
+#
+# Revision 1.44  1995/05/26  17:01:44  dhb
+# Additional comments about XLIB for Linux systems.
+# BETA2-0-P7
+#
+# Revision 1.43  1995/05/17  21:30:07  dhb
+# BETA2-0-P6
+#
+# Revision 1.42  1995/05/11  20:41:48  dhb
+# Changed install targets to pass RANLIB value down to system makefiles
+# as RANLIB_IN.
+#
+# Revision 1.41  1995/05/08  22:43:03  dhb
+# Additional comments for Solaris using gcc.
+# BETA2-0-P5
+#
+# Revision 1.40  1995/04/29  01:11:24  dhb
+# Added handling of YACC, LEX and LEXLIB macros to define the
+# yacc and lex programs and the lex libraries respectively.
+#
+# Revision 1.39  1995/04/28  19:43:38  dhb
+# Various system dependent suggestion changes.
+# BETA2-0-P4
+#
+# Revision 1.38  1995/04/16  01:22:37  dhb
+# Modified suggested alpha macro settings to use cc -std0 -DGETOPT_PROBLEM
+# which hopefullly will be portable across alpha platforms.
+#
+# Revision 1.37  1995/04/13  20:55:22  dhb
+# Added info about the -DGETOPT_PROBLEM define.
+#
+# BETA2-0-P3
+#
+# Revision 1.36  1995/04/11  23:09:53  dhb
+# Removed -lICE and -lSM suggestion for Linux compiles.
+#
+# Revision 1.35  1995/04/07  22:42:17  dhb
+# BETA2-0-P2
+#
+# Revision 1.34  1995/04/05  00:55:00  dhb
+# Added stuff for MACHINE=aix
+#
+# Revision 1.33  1995/04/01  17:11:13  dhb
+# BETA2-0-P1
+#
+# Revision 1.32  1995/03/29  16:45:20  dhb
+# BETA2-0
+#
+# Revision 1.31  1995/03/28  18:29:38  dhb
+# Added CPP macro setting for Solaris SUNPro cc.
+#
+# Revision 1.30  1995/03/27  18:41:41  dhb
+# Added DEC Alpha as an option for MACHINE with compiler
+# specific macro settings.
+#
+# Revision 1.29  1995/03/27  18:23:28  dhb
+# Missing backslash in XLIBS macro definition.
+# DEVREL2-0-9-P5
+#
+# Revision 1.28  1995/03/24  22:00:20  dhb
+# - Changed X11 libraries from full path specs to use -L and -l
+# - Added additional comments for Linux settings
+# - DEVREL2-0-9-P4
+#
+# Revision 1.27  1995/03/23  18:31:18  dhb
+# Modified suggested macro setting for SGI and Decstation.
+#
+# Revision 1.26  1995/03/21  21:12:58  dhb
+# DEVREL2-0-9-P3
+#
+# Revision 1.25  1995/03/02  18:46:16  dhb
+# DEVREL2-0-9-P2
+#
+# Revision 1.24  1995/02/23  00:15:54  dhb
+# Updated to DEVREL2-0-9-P1
+#
+# Revision 1.23  1995/02/22  19:04:53  dhb
+# Linux support.
+#
+# Revision 1.22  1995/02/14  01:08:28  dhb
+# cleandist now removed convert and X1compat scripts
+#
+# Revision 1.21  1995/02/11  06:49:12  dhb
+# Added convert to the SUBDIRS and NXSUBDIRS.
+#
+# Revision 1.20  1995/02/11  06:35:15  dhb
+# Updated RCSRELEASE to DEVREL2-0-9.
+#
+# Revision 1.19  1995/01/25  02:24:09  dhb
+# Updated for X11R6.
+#
+# Revision 1.18  1995/01/18  01:49:46  dhb
+# 2.0.8 patch 3 update
+#
+# Revision 1.17  1995/01/14  01:02:46  dhb
+# Update to 2.0.8 patch 2
+#
+# Revision 1.16  1995/01/09  23:04:55  dhb
+# Made the default XINCLUDE directory . instead of nothing.  Some
+# compilers will complain if given an empty -I option.
+#
+# Revision 1.15  1995/01/09  19:34:38  dhb
+# RCSRELEASE macro change in 1.14 was wrong.
+#
+# Revision 1.14  1995/01/09  18:31:11  dhb
+# Changed inconsistent instructions at end of user changable part of
+# Makefile.
+#
+# Updated RCSRELEASE macro to reflect current release.
+#
+# Revision 1.13  1994/12/21  00:36:05  dhb
+# Moved RCS log information to the end of the file.
+#
+# Revision 1.12  1994/12/20  23:23:26  dhb
+# Added all, nxall and minall targets and updated instructions in
+# Makefile to use the all targets.
+#
+# Revision 1.11  1994/12/06  01:45:40  dhb
+# Added the XINCLUDE macro
+#
+# Revision 1.10  1994/09/23  17:09:28  dhb
+# Added a 'make code_g' to the users instruction comments.
+#
+# Revision 1.9  1994/09/23  16:22:04  dhb
+# Changes for move of connections out of main libraries into oldconn.
+#
+# Revision 1.8  1994/04/14  14:51:50  dhb
+# Now passes RANLIB macro down in install targets
+#
+# Revision 1.7  1994/04/13  20:07:39  dhb
+# Changed the makefile comments for compiler dependent options
+#
+# Revision 1.6  1994/04/04  21:25:45  dhb
+# Added RANLIB macro to handle systems without ranlib.
+#
+# Moved compiler depended macro settings to src/Makefile.
+#
+# Revision 1.5  1994/03/23  00:23:11  dhb
+# Changes for Xodus version 2 and the newconn library.
+#
+# Revision 1.4  1994/03/22  23:56:31  dhb
+# Changed codeg target to code_g (the actual program name).
+#
+# Revision 1.3  1994/03/21  18:25:36  dhb
+# Changes to make code_g program
+#
+# Revision 1.2  1993/10/19  18:53:27  dhb
+# RCS changes and libsh --> ./libsh
+#
diff -Naur genesis/src/Makefile.MacOSXDarwin genesis2.2.1.Panther/src/Makefile.MacOSXDarwin
--- genesis/src/Makefile.MacOSXDarwin	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/Makefile.MacOSXDarwin	Mon May 24 17:44:24 2004
@@ -0,0 +1,143 @@
+# $Id: Makefile.MacOSXDarwin,v 1.1 2001/05/10 16:09:13 mhucka Exp $
+#
+# GENESIS/XODUS : network simulator
+#
+#       Make tree altered June 1991
+#       Last altered 2001-05-10 8:59 PDT <mhucka@caltech.edu>
+#
+# YOU MUST NOT EDIT THIS MAKEFILE TO CONFIGURE GENESIS!
+# All configuration is in the file Makefile.
+#
+# $Log: Makefile.MacOSXDarwin,v $
+# Revision 1.1  2001/05/10 16:09:13  mhucka
+# First version of PPC support, based on work by Alfonso Delgado-Reyes.
+#
+#
+
+MACHINE         =       MacOSXDarwin
+OS              =       $(OS_IN)
+CC              =       $(CC_IN)
+CPP             =       $(CPP_IN)
+LD              =       $(LD_IN)
+LDFLAGS         =       $(LDFLAGS_IN)
+AR              =       $(AR_IN)
+RANLIB          =       $(RANLIB_IN)
+CFLAGS          =       $(COPT)
+LLIBS           =       $(LIBS) $(EXTRALIBS)
+
+YACC            =       $(YACC_IN)
+LEX             =       $(LEX_IN)
+LEXLIB          =       $(LEXLIB_IN)
+
+GENESIS =       $(BASECODE) \
+                $(OBJLIBS) \
+                loadlib.o
+
+NXGENESIS =     $(BASECODE) \
+                $(OBJLIBS) \
+                nxloadlib.o
+
+MINGENESIS =    $(BASECODE) \
+                minloadlib.o
+
+FULLDIR =       startup $(SUBDIR)
+NXDIR =         startup $(NXSUBDIR)
+MINDIR =        startup $(MINSUBDIR)
+
+# =========================================================================
+
+default:
+	@echo "This is not the top level makefile"
+
+nxdefault:
+	@echo "This is not the top level makefile"
+
+mindefault:
+	@echo "This is not the top level makefile"
+
+genesis: libs $(GENESIS) $(XODUS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -flat_namespace \
+	$(GENESIS) $(XODUS) $(XLIBS) $(LLIBS) -o genesis
+	@echo "Full GENESIS Compiled -- All Done"
+
+nxgenesis: nxlibs $(NXGENESIS)
+	$(CC) $(CFLAGS) $(LDFLAGS) $(NXGENESIS) $(LLIBS) -flat_namespace -o nxgenesis
+	@echo "Non-X GENESIS Compiled -- All Done"
+
+mingenesis: minlibs $(MINGENESIS)
+	$(CC) $(CFLAGS) $(LDFLAGS) $(MINGENESIS) $(LLIBS) -flat_namespace -o mingenesis
+	@echo "Minimal GENESIS Compiled -- All Done"
+
+code_g:
+	@(echo cd sys; cd sys; make CC="$(CC)" LD="$(LD)" CPP="$(CPP)" TMPDIR="$(TMPDIR)" LDFLAGS="$(LDFLAGS)" OS="$(OS)" MACHINE="$(MACHINE)" INSTALL="$(INSTALL)" COPT="$(CFLAGS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" RCSRELEASE="$(RCSRELEASE)"; cd ..)
+	@(echo cd ss; cd ss; make CC="$(CC)" LD="$(LD)" CPP="$(CPP)" YACC="$(YACC)" LEX="$(LEX)" LEXLIB="$(LEXLIB)" TMPDIR="$(TMPDIR)" LDFLAGS="$(LDFLAGS)" OS="$(OS)" MACHINE="$(MACHINE)" INSTALL="$(INSTALL)" COPT="$(CFLAGS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" RCSRELEASE="$(RCSRELEASE)"; cd ..)
+	@(echo cd shell; cd shell; make CC="$(CC)" LD="$(LD)" CPP="$(CPP)" TMPDIR="$(TMPDIR)" LDFLAGS="$(LDFLAGS)" OS="$(OS)" MACHINE="$(MACHINE)" INSTALL="$(INSTALL)" COPT="$(CFLAGS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" RCSRELEASE="$(RCSRELEASE)" code_g; cd ..)
+	@(echo cd sys; cd sys; make CC="$(CC)" LD="$(LD)" CPP="$(CPP)" TMPDIR="$(TMPDIR)" LEXLIB="$(LEXLIB)" LDFLAGS="$(LDFLAGS)" OS="$(OS)" MACHINE="$(MACHINE)" INSTALL="$(INSTALL)" COPT="$(CFLAGS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)" RCSRELEASE="$(RCSRELEASE)" code_g; cd ..)
+	@echo "code_g Compiled"
+
+libs:
+	@(for i in $(SUBDIR); do echo cd $$i; cd $$i; make CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" CPP="$(CPP)" YACC="$(YACC)" LEX="$(LEX)" LEXLIB="$(LEXLIB)" TMPDIR="$(TMPDIR)" LDFLAGS="$(LDFLAGS)" OS="$(OS)" MACHINE="$(MACHINE)" DISKIOSUBDIR="$(DISKIOSUBDIR)" INSTALL="$(INSTALL)" COPT="$(CFLAGS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)"; cd ..;done)
+	@echo "All Libs Compiled"
+
+nxlibs:
+	@(for i in $(NXSUBDIR); do echo cd $$i; cd $$i; make CC="$(CC)" LD="$(LD)" YACC="$(YACC)" LEX="$(LEX)" LEXLIB="$(LEXLIB)" TMPDIR="$(TMPDIR)" LDFLAGS="$(LDFLAGS)" CPP="$(CPP)" AR="$(AR)" RANLIB="$(RANLIB)" OS="$(OS)" MACHINE="$(MACHINE)" INSTALL="$(INSTALL)" DISKIOSUBDIR="$(DISKIOSUBDIR)" COPT="$(CFLAGS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)"; cd ..;done)
+	@echo "Non-X Libs Compiled"
+
+minlibs:
+	@(for i in $(MINSUBDIR); do echo cd $$i; cd $$i; make CC="$(CC)" LD="$(LD)" YACC="$(YACC)" LEX="$(LEX)" LEXLIB="$(LEXLIB)" TMPDIR="$(TMPDIR)" LDFLAGS="$(LDFLAGS)" CPP="$(CPP)" AR="$(AR)" RANLIB="$(RANLIB)" OS="$(OS)" MACHINE="$(MACHINE)" INSTALL="$(INSTALL)" COPT="$(CFLAGS)" TERMCAP="$(TERMCAP)" TERMOPT="$(TERMOPT)"; cd ..;done)
+	@echo "Minimal Libs Compiled"
+
+.c.o:
+	$(CC) $(CFLAGS) -D$(MACHINE) -c $(SIMINCLUDE) $<
+
+loadlib.c: liblist
+	./libsh < liblist > loadlib.c
+
+nxloadlib.c: nxliblist
+	./libsh < nxliblist > nxloadlib.c
+
+minloadlib.c: minliblist
+	./libsh < minliblist > minloadlib.c
+
+cleandist:
+	@echo "You must run cleandist from the toplevel makefile"
+
+clean:
+	@(for i in $(SUBDIR); do echo cd $$i; cd $$i; make DISKIOSUBDIR="$(DISKIOSUBDIR)" MACHINE="$(MACHINE)" SPRNG_LIB="$(SPRNG_LIB)" clean; cd ..;done)
+	-rm -rf genesis       loadlib.o    loadlib.c
+	-rm -rf nxgenesis   nxloadlib.o  nxloadlib.c
+	-rm -rf mingenesis minloadlib.o minloadlib.c
+	@echo "Done with Cleaning"
+
+copydirs:
+	@(if /usr/bin/test ! ../Scripts -ef $(INSTALL)/Scripts ; then \
+                echo "Copying Scripts directory to $(INSTALL) ..."; \
+                cp -rp ../Scripts $(INSTALL); \
+        fi)
+	@(if /usr/bin/test ! ../Doc -ef $(INSTALL)/Doc ; then \
+                echo "Copying Doc directory to $(INSTALL) ..."; \
+                cp -rp ../Doc $(INSTALL); \
+        fi)
+	@(if /usr/bin/test ! ../Hyperdoc -ef $(INSTALL)/Hyperdoc ; then \
+                echo "Copying Hyperdoc directory to $(INSTALL) ..."; \
+                cp -rp ../Hyperdoc $(INSTALL); \
+        fi)
+	@(if /usr/bin/test ! ../src -ef $(INSTALL)/src ; then \
+                echo "Copying src directory to $(INSTALL) ..."; \
+                cp -rp ../src $(INSTALL); \
+        fi)
+
+install: copydirs
+	@(for i in $(FULLDIR); do echo cd $$i; cd $$i; make MACHINE=$(MACHINE) DISKIOSUBDIR="$(DISKIOSUBDIR)" INSTALL=$(INSTALL) INSTALLBIN=$(INSTALLBIN) RANLIB="$(RANLIB)" install; cd ..;done)
+	@cp genesis $(INSTALL)
+	@echo "Done with full install"
+
+nxinstall: copydirs
+	@(for i in $(NXDIR); do echo cd $$i; cd $$i; make MACHINE=$(MACHINE) DISKIOSUBDIR="$(DISKIOSUBDIR)" INSTALL=$(INSTALL) INSTALLBIN=$(INSTALLBIN) RANLIB="$(RANLIB)" install; cd ..;done)
+	-cp nxgenesis $(INSTALL)
+	@echo "Done with non-X install"
+
+mininstall: copydirs
+	@(for i in $(MINDIR); do echo cd $$i; cd $$i; make MACHINE=$(MACHINE) INSTALL=$(INSTALL) INSTALLBIN=$(INSTALLBIN) RANLIB="$(RANLIB)" install; cd ..;done)
+	-cp mingenesis $(INSTALL)
+	@echo "Done with minimal install"
diff -Naur genesis/src/Makefile.dist genesis2.2.1.Panther/src/Makefile.dist
--- genesis/src/Makefile.dist	Fri May 30 00:07:29 2003
+++ genesis2.2.1.Panther/src/Makefile.dist	Mon May 24 17:44:25 2004
@@ -151,6 +151,7 @@
 # As of June, 2001, the GENESIS developers have not successfully
 # built the SPRNG libraries under SunOS 4.1.  If you are running
 # SunOS 4.1, you should disable compiling of SPRNG.
+# -- The above also applies to MacOSX and, probably, Darwin.
 #
 # If you are compiling on a 64-bit SGI, change "lfg" to "lcg64" below.
 
@@ -965,6 +966,44 @@
 
 # end	Linux 2.x and up on PPC-based systems (LinuxPPC)
 
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+# System:       MacOS X and Darwin (PPC-based systems)
+# Compiler:     Apple Computer, Inc. v.gcc-932.1, based on gcc v.2.95.2
+# ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
+
+## This configuration was provided by a GENESIS user, Alfonso
+## Delgado-Reyes.  Please make sure that you have up-to-date and 
+## complete installations of flex and bison if you are using this 
+## configuration. If you don not have bison grab it from: 
+## http://www.ibiblio.org/pub/gnu/bison/
+
+# MACHINE=MacOSXDarwin
+# OS=BSD
+
+# XINCLUDE=/usr/X11R6/include
+# XLIB=/usr/X11R6/lib
+
+# CC=cc
+# CPP=/usr/libexec/gcc/darwin/`/usr/bin/arch`/default/cpp -E -P -traditional
+# CFLAGS=-I/usr/include/sys -O2 -traditional-cpp -pipe -D__NO_MATH_INLINES -DBIGENDIAN
+
+# LD=ld
+# LDFLAGS=
+
+# RANLIB=ranlib
+# AR=ar
+
+# YACC=bison -y
+# PARSER=bison
+
+# LEX=lex
+# LEXLIB=-ll
+# LIBS= $(LEXLIB)
+ 
+# TERMCAP=-lcurses
+# TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+ 
+# end  MacOS X and Darwin (PPC-based systems)
 
 # ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~  ~
 # System:	FreeBSD 4.1
@@ -1433,8 +1472,11 @@
 	-(rm -rf $(INSTALL)/.*simrc)
 	-(rm -f  $(INSTALLBIN)/convert)
 	-(rm -f TAGS)
-	-(rm -f `find . -name '*~'`)
+	-(find . -name '*~' -exec rm -f {} ';')
 	@echo "Done with full clean"
+
+# -(rm -f `find . -name '*~'`)
+# @echo "Done with full clean"
 
 clean:
 	@make -f $(MF) MF="$(MF)" DISKIOSUBDIR="$(DISKIOSUBDIR)" SUBDIR="$(SUBDIR)" RCSRELEASE="$(RCSRELEASE)" SPRNG_LIB="$(SPRNG_LIB)" clean
diff -Naur genesis/src/README genesis2.2.1.Panther/src/README
--- genesis/src/README	Fri May 30 00:03:49 2003
+++ genesis2.2.1.Panther/src/README	Mon May 24 17:44:24 2004
@@ -91,7 +91,7 @@
 BUILDING THE DISTRIBUTION:
 
 	From the src directory type:
-
+		(if you are using MacOS X/Darwin: limit stacksize 4096)
 		make clean
 		make > & ! make.out &
 		(or for the Bourne shell: make all > make.out 2>&1 & )
diff -Naur genesis/src/Xodus/Draw/Gif.c genesis2.2.1.Panther/src/Xodus/Draw/Gif.c
--- genesis/src/Xodus/Draw/Gif.c	Mon Sep 11 17:44:16 2000
+++ genesis2.2.1.Panther/src/Xodus/Draw/Gif.c	Mon May 24 17:44:24 2004
@@ -246,7 +246,7 @@
     GifObject gw = (GifObject) w;
    
     if (XtIsRealized(w) && gw->gif.image) {
-	XPutImage(XgDisplay(), XtWindow(gw->object.parent),
+	XPutImage((Display *)XgDisplay(), XtWindow(gw->object.parent),
 		  gw->pix.gc, gw->gif.image,
 		  /* src coords */
 		  gw->gif.srcx, gw->gif.srcy, 
diff -Naur genesis/src/Xodus/Draw/Shape.c genesis2.2.1.Panther/src/Xodus/Draw/Shape.c
--- genesis/src/Xodus/Draw/Shape.c	Tue Oct 10 00:59:32 2000
+++ genesis2.2.1.Panther/src/Xodus/Draw/Shape.c	Mon May 24 17:44:24 2004
@@ -280,7 +280,7 @@
 		shape->shape.textmode != TEXTNODRAW)
 		shape->shape.textmode = TEXTDRAW;
 
-	shape->shape.textcolor = XBlackPixel(XgDisplay(),0);
+	shape->shape.textcolor = XBlackPixel((Display *)XgDisplay(),0);
 		
   shape->pix.gc=NULL;
   ResetGC(shape);
diff -Naur genesis/src/Xodus/Draw/Tree.c genesis2.2.1.Panther/src/Xodus/Draw/Tree.c
--- genesis/src/Xodus/Draw/Tree.c	Mon Jun 12 06:28:18 2000
+++ genesis2.2.1.Panther/src/Xodus/Draw/Tree.c	Mon May 24 17:44:24 2004
@@ -302,7 +302,7 @@
 
   /* Check that the initial values are reasonable */
 	tree->tree.treemode = XoTreeTreeMode;
-	tree->tree.textcolor = XBlackPixel(XgDisplay(),0);
+	tree->tree.textcolor = XBlackPixel((Display *)XgDisplay(),0);
 		
   tree->pix.gc=XCreateGC(disp,d,mask,&values);
   mask = GCForeground;
diff -Naur genesis/src/Xodus/Draw/Var.c genesis2.2.1.Panther/src/Xodus/Draw/Var.c
--- genesis/src/Xodus/Draw/Var.c	Mon Jun 12 06:28:18 2000
+++ genesis2.2.1.Panther/src/Xodus/Draw/Var.c	Mon May 24 17:44:24 2004
@@ -250,7 +250,7 @@
 
   /* Check that the initial values are reasonable */
 	var->var.varmode = XoVarShapeMode;
-	var->var.textcolor = XBlackPixel(XgDisplay(),0);
+	var->var.textcolor = XBlackPixel((Display *)XgDisplay(),0);
 		
   var->pix.gc=XCreateGC(disp,d,mask,&values);
   mask = GCForeground;
diff -Naur genesis/src/Xodus/Draw/View.c genesis2.2.1.Panther/src/Xodus/Draw/View.c
--- genesis/src/Xodus/Draw/View.c	Mon Jun 12 06:28:18 2000
+++ genesis2.2.1.Panther/src/Xodus/Draw/View.c	Mon May 24 17:44:24 2004
@@ -276,7 +276,7 @@
 
   /* Check that the initial values are reasonable */
 	view->view.viewmode = XoVarShapeMode;
-	view->view.textcolor = XBlackPixel(XgDisplay(),0);
+	view->view.textcolor = XBlackPixel((Display *)XgDisplay(),0);
 		
   view->pix.gc=XCreateGC(disp,d,mask,&values);
   mask = GCForeground;
diff -Naur genesis/src/Xodus/Draw/XodusMacOSXDarwinMakefile genesis2.2.1.Panther/src/Xodus/Draw/XodusMacOSXDarwinMakefile
--- genesis/src/Xodus/Draw/XodusMacOSXDarwinMakefile	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/Xodus/Draw/XodusMacOSXDarwinMakefile	Mon May 24 17:44:24 2004
@@ -0,0 +1,88 @@
+# $Id: Makefile,v 1.11 2000/07/03 18:09:55 mhucka Exp $
+# $Log: Makefile,v $
+# Revision 1.11  2000/07/03 18:09:55  mhucka
+# Removed RCS directives and added c flag to ar command invocation.
+#
+# Revision 1.10  1999/11/29 07:50:08  mhucka
+# Removed needless subshell () wrappers and performed other related cleanup.
+#
+# Revision 1.9  1996/06/18 06:51:56  dhb
+# Removed redundant define for CC macro which causes recursive
+# macro definition errors on some machines.
+#
+# Revision 1.8  1996/06/06  23:03:35  dhb
+# New use AR macro for archiving command.
+#
+# Revision 1.7  1995/07/17  20:44:54  dhb
+# Added DrawUtil.o to OBJS line.
+#
+# Revision 1.6  1995/02/13  21:16:25  dhb
+# Removed checkout of RCSRELEASE verions.
+#
+# Revision 1.5  1995/01/09  23:38:44  dhb
+# Commented nonportable COMPILE.c macro and added CPPFLAGS to CFLAGS.
+#
+# Revision 1.4  1994/12/19  22:22:01  dhb
+# Added rules for RCS subdirectory.
+#
+# Revision 1.3  1994/12/06  02:03:23  dhb
+# Added install target and ranlib handling.
+#
+# Revision 1.2  1994/12/06  00:17:22  dhb
+# Nov 8 1994 changes from Upi Bhalla
+#
+# Revision 1.1.1.4  1994/04/11  22:30:14  dhb
+# Missing some include dirs on RCS checkout actions
+#
+# Revision 1.1.1.3  1994/04/11  21:22:02  dhb
+# Needed tabs on RCS checkout actions
+#
+# Revision 1.1.1.2  1994/04/11  21:14:14  dhb
+# Added RCS checkout rules
+#
+# Revision 1.1.1.1  1994/04/11  17:36:01  dhb
+# Update from Dave Bilitch
+#
+CPPFLAGS  = -I..
+#CFLAGS    = -g -temp=../temp
+CFLAGS    = $(TOPFLAGS) $(CPPFLAGS)
+LIBS      = -lXt -lXext -lX11 -lm -ldl -lw
+#COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
+
+WIDGETS   = \
+	CoreDraw.o \
+	DumbDraw.o \
+	Graph.o \
+	Draw.o \
+	Pix.o \
+	Sphere.o \
+	Shape.o \
+	Plot.o \
+	Axis.o \
+	Cell.o \
+	Var.o \
+	View.o \
+	Tree.o \
+	Gif.o
+OBJS      = $(WIDGETS) DrawUtil.o
+
+.SUFFIXES: .c,v .c .h,v .h
+
+.h,v.h:
+	co $*.h
+
+.c,v.o:
+	co $*.c
+	cc -c $(CFLAGS) $(CPPFLAGS) $*.c
+	rm -f $*.c
+
+libDraw.a: $(OBJS)
+	$(AR) rc libDraw.a $(OBJS)
+	ranlib libDraw.a
+
+clean:
+	-rm -f *.[oa]
+
+install:
+	cp libDraw.a $(INSTALL)/lib
+	ranlib $(INSTALL)/lib/libDraw.a
diff -Naur genesis/src/Xodus/Makefile genesis2.2.1.Panther/src/Xodus/Makefile
--- genesis/src/Xodus/Makefile	Sun Apr  1 21:24:53 2001
+++ genesis2.2.1.Panther/src/Xodus/Makefile	Mon May 24 17:44:24 2004
@@ -19,19 +19,29 @@
 	./Xo/libXo.a \
 	./Widg/libWidg.a \
 	./Draw/libDraw.a
-INSTALL_DIR = $(INSTALL)
-DISPLIB =	$(INSTALL)/src/Xodus
 
-XODUS_DIR	= \
-		./xo \
-		./widg \
-		./draw
+INSTALL_DIR 	= $(INSTALL)
+DISPLIB 	= $(INSTALL)/src/Xodus
+
+ifeq (,$(findstring MacOSXDarwin, $(MAKEFLAGS)))
+WIDGET_DIR      = \
+                ./Xo \
+                ./Widg \
+                ./Draw
+
+XODUS_DIR       = $(WIDGET_DIR) 
+XODUSMKF 	= Xodus$(MACHINE)Makefile 
+else
+XODUS_DIR       = \
+                ./xo \
+                ./widg \
+                ./draw
 
 WIDGET_DIR	= \
 		./Xo \
 		./Widg \
 		./Draw
-
+endif
 
 ###################################################################
 # nothing beyond this point should have to be modified by the user
@@ -41,9 +51,12 @@
 
 #==========================================================================
 default: displibs xolibs
-
 xolibs:
+ifeq (,$(findstring MacOSXDarwin, $(MAKEFLAGS)))
+	@(echo making the Xodus widget library; for i in $(WIDGET_DIR); do echo cd $$i;  cd $$i; make -f $(XODUSMKF) MACHINE=$(MACHINE) XVERSION=$(XVERSION) INSTALL=$(INSTALL_DIR)  CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" CPP="$(CPP)" DEC_HACK="$(DEC_HACK)" TOPFLAGS="$(CFLAGS)"; cd ..;done)
+else
 	@(echo making the Xodus widget library; for i in $(WIDGET_DIR); do echo cd $$i;  cd $$i; make MACHINE=$(MACHINE) XVERSION=$(XVERSION) INSTALL=$(INSTALL_DIR)  CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" CPP="$(CPP)" DEC_HACK="$(DEC_HACK)" TOPFLAGS="$(CFLAGS)"; cd ..;done)
+endif
 
 displibs:
 	@(for i in $(XODUS_DIR); do echo cd $$i; cd $$i; make MACHINE=$(MACHINE) XVERSION=$(XVERSION) INSTALL=$(INSTALL_DIR)  CC="$(CC)" LIBEXT="$(LIBEXT)" LIBBUILD="$(LIBBUILD)" LIBBUILDFLAGS="$(LIBBUILDFLAGS)" LIBORDER="$(LIBORDER)" TMPDIR="$(TMPDIR)" CPP="$(CPP)" DEC_HACK="$(DEC_HACK)" TOPFLAGS="$(CFLAGS)"; cd ..;done)
@@ -52,4 +65,9 @@
 	@(for i in $(XODUS_DIR) $(WIDGET_DIR) ; do echo cd $$i; cd $$i; make clean; cd ..;done)
 
 install:
+ifeq (,$(findstring MacOSXDarwin, $(MAKEFLAGS)))
+	@(for i in $(XODUS_DIR) $(WIDGET_DIR) ; do echo cd $$i; cd $$i; make MACHINE=$(MACHINE) XVERSION=$(XVERSION) INSTALL=$(INSTALL_DIR) LIBORDER="$(LIBORDER)" LIBEXT="$(LIBEXT)" RANLIB="$(RANLIB)" DEC_HACK="$(DEC_HACK)" install; cd ..;done)
+	@(for i in $(XODUS_DIR) $(WIDGET_DIR) ; do echo cd $$i; cd $$i; make -f $(XODUSMKF) MACHINE=$(MACHINE) XVERSION=$(XVERSION) INSTALL=$(INSTALL_DIR) LIBORDER="$(LIBORDER)" LIBEXT="$(LIBEXT)" RANLIB="$(RANLIB)" DEC_HACK="$(DEC_HACK)" install; cd ..;done)
+else
 	@(for i in $(XODUS_DIR) $(WIDGET_DIR) ; do echo cd $$i; cd $$i; make MACHINE=$(MACHINE) XVERSION=$(XVERSION) INSTALL=$(INSTALL_DIR) LIBORDER="$(LIBORDER)" LIBEXT="$(LIBEXT)" RANLIB="$(RANLIB)" DEC_HACK="$(DEC_HACK)" install; cd ..;done)
+endif
diff -Naur genesis/src/Xodus/Widg/Text.c genesis2.2.1.Panther/src/Xodus/Widg/Text.c
--- genesis/src/Xodus/Widg/Text.c	Fri Jun 29 23:09:37 2001
+++ genesis2.2.1.Panther/src/Xodus/Widg/Text.c	Mon May 24 17:44:24 2004
@@ -61,7 +61,7 @@
 
 #include <X11/IntrinsicP.h>
 #include <X11/StringDefs.h>
-#include <varargs.h>
+#include <stdarg.h>
 #include <string.h>
 #include "TextP.h"
 #include "Xo/XoDefs.h"
@@ -138,7 +138,7 @@
 
 /* utilities */
 static void
-                IncrementTextMemory(), CallAction(), InsertString();
+                IncrementTextMemory(), CallAction(void (*action) (), Widget widget, XEvent *event, ... ), InsertString();
 void
                 Recalculate();	/* from Label.c */
 void
@@ -287,7 +287,7 @@
 		tnew->text.initial_text = (char *)calloc((int)strlen(temp) + 1,
 			sizeof(char));
 		strcpy(tnew->text.initial_text,temp);
-		CallAction(Insert, tnew, NULL, tnew->text.initial_text, NULL);
+		CallAction(Insert, (Widget)tnew, NULL, tnew->text.initial_text, NULL);
 	} else {
 		tnew->text.initial_text = (char *)calloc(TEXT_ALLOC_INCREMENT,
 			sizeof(char));
@@ -323,7 +323,7 @@
 	tnew->label.label_len = MULTI_LINE_LABEL;
 
 
-	CallAction(Update, tnew, NULL, NULL);
+	CallAction(Update, (Widget)tnew, NULL, NULL);
 }
 
 
@@ -665,17 +665,13 @@
 
 /* VARARGS */
 static void
-CallAction(action, widget, event, va_alist)
-	void            (*action) ();
-	Widget          widget;
-	XEvent         *event;
-va_dcl
+CallAction(void (*action) (), Widget widget, XEvent *event, ... )
 {
 	va_list         args;
 	String          argv[100];
 	Cardinal        argc = 0;
 
-	va_start(args);
+	va_start(args,event);
 	while ((argv[argc++] = va_arg(args, String)));
 	argc--;
 	va_end(args);
diff -Naur genesis/src/Xodus/Widg/XodusMacOSXDarwinMakefile genesis2.2.1.Panther/src/Xodus/Widg/XodusMacOSXDarwinMakefile
--- genesis/src/Xodus/Widg/XodusMacOSXDarwinMakefile	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/Xodus/Widg/XodusMacOSXDarwinMakefile	Mon May 24 17:44:24 2004
@@ -0,0 +1,139 @@
+# $Id: Makefile,v 1.15 2000/09/21 19:22:02 mhucka Exp $
+# $Log: Makefile,v $
+# Revision 1.15  2000/09/21 19:22:02  mhucka
+# Added a public-domain implementation of alloca() for those systems
+# like AIX that don't seem to provide one.
+#
+# Revision 1.14  2000/07/03 18:09:56  mhucka
+# Removed RCS directives and added c flag to ar command invocation.
+#
+# Revision 1.13  2000/05/19 18:20:56  mhucka
+# 1) Some reformatting for consistency with other GENESIS makefiles.
+# 2) Added files for new xgifload.
+#
+# Revision 1.12  1999/11/29 07:50:09  mhucka
+# Removed needless subshell () wrappers and performed other related cleanup.
+#
+# Revision 1.11  1998/07/15 06:18:07  dhb
+# Upi update
+#
+# Revision 1.10  1996/06/18 06:53:22  dhb
+# Removed explicit setting of CC macro which was probably benign
+# since CC is set on the make command line taking precedence over
+# the Makefile setting.
+#
+# Revision 1.9  1996/06/06  23:05:36  dhb
+# Now use AR macro for archive command.
+#
+# Revision 1.8  1995/06/16  05:55:37  dhb
+# Moved comment character commenting lines of the HEADERS macro
+# to the first character of the line.  This is required for some
+# versions of make.
+#
+# Revision 1.7  1995/03/17  23:11:39  venkat
+# Included XoComposit.o to the list of OBJS
+#
+# Revision 1.6  1995/02/22  01:37:23  venkat
+# Added XoCore.o to the list of OBJS
+#
+# Revision 1.5  1995/02/13  21:21:10  dhb
+# Removed checkout of RCSRELEASE versions.
+#
+# Revision 1.4  1995/01/09  23:40:06  dhb
+# Commented nonportable COMPILE.c macro and added CPPFLAGS to CFLAGS.
+#
+# Revision 1.3  1994/12/19  22:22:39  dhb
+# Added rules for RCS subdirectory.
+#
+# Revision 1.2  1994/12/06  02:04:49  dhb
+# Added install target and ranlib handling.
+#
+# Revision 1.1  1994/12/06  00:15:26  dhb
+# Initial revision
+#
+# Revision 1.4  1994/04/11  23:16:50  dhb
+# Missing tab at beginning of RCS checkout actions
+#
+# Revision 1.3  1994/04/11  22:30:47  dhb
+# Missing some include dirs on RCS checkout actions
+#
+# Revision 1.2  1994/04/11  21:15:04  dhb
+# Added RCS checkout rules
+#
+# Revision 1.1  1994/04/11  17:42:49  dhb
+# Initial revision
+#
+
+CPPFLAGS    = -I..
+CFLAGS      = $(TOPFLAGS) $(CPPFLAGS) -I../../shell -I../../sys
+LIBS        = -lXt -lXext -lX11
+# COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
+
+WIDGETS     = \
+		Label.o \
+		Frame.o \
+		Framed.o \
+		XoCore.o \
+		XoComposit.o \
+		Form.o \
+		Button.o \
+		Text.o \
+		Dialog.o \
+		Image.o \
+		xgifload.o \
+		dgif_lib.o \
+		gif_io.o \
+		alloca.o \
+		FastPlot.o
+
+OBJS         = $(WIDGETS) \
+		FormLayout.o
+
+#Label.o: LabelP.h Label.h
+#Frame.o: FrameP.h Frame.h
+#Framed.o:	Framed.h FramedP.h 
+#Form.o:	Form.h FormP.h
+#Button.o:	Button.h ButtonP.h
+#Text.o:	Text.h TextP.h
+#Dialog.o:	Dialog.h DialogP.h
+#Image.o: Image.h ImageP.h
+#
+#HEADERS = \
+#	../Xo/XoDefs.h \
+#	LabelP.h Label.h \
+#	FrameP.h Frame.h \
+#	Framed.h FramedP.h  \
+#	Form.h FormP.h \
+#	Button.h ButtonP.h \
+#	Text.h TextP.h \
+#	Dialog.h DialogP.h \
+#	Image.h ImageP.h
+
+#$(OBJS): ../Xo/XoDefs.h
+
+# I have to force a compile here every time a header is changed
+#.c.o:
+# $(CC) $(CFLAGS) $(CPPFLAGS) $< -c
+
+.SUFFIXES: .c,v .c .h,v .h
+
+.h,v.h:
+	co $*.h
+
+.c,v.o:
+	co $*.c
+	cc -c $(CFLAGS) $(CPPFLAGS) $*.c
+	rm -f $*.c
+
+libWidg.a: $(OBJS) $(HEADERS)
+	$(AR) rc libWidg.a $(OBJS)
+	ranlib libWidg.a
+
+XoFormLayout.o: Form.h
+
+clean:
+	-rm -f *.[oa]
+
+install:
+	cp libWidg.a $(INSTALL)/lib
+	ranlib $(INSTALL)/lib/libWidg.a
diff -Naur genesis/src/Xodus/Widg/xform.c genesis2.2.1.Panther/src/Xodus/Widg/xform.c
--- genesis/src/Xodus/Widg/xform.c	Thu Apr 19 00:39:35 2001
+++ genesis2.2.1.Panther/src/Xodus/Widg/xform.c	Mon May 24 17:44:24 2004
@@ -380,7 +380,7 @@
 
 	if (!(xoIsNestedForm(form) && form->nested)) {
 		XoXtVaSetValues((Widget)form->shell, XtNtitle, form->title, NULL);
-		XSetIconName(XgDisplay(),XtWindow((Widget) form->shell),form->name);
+		XSetIconName((Display *)XgDisplay(),XtWindow((Widget) form->shell),form->name);
 		/* This ugly stuff is here for archaic window managers like twm */
 		XoWMPositionHack((Widget)form->shell,(Position)atoi(form->xgeom),(Position)atoi(form->ygeom));
 	}
diff -Naur genesis/src/Xodus/Widg/xgifload.c genesis2.2.1.Panther/src/Xodus/Widg/xgifload.c
--- genesis/src/Xodus/Widg/xgifload.c	Wed May 30 17:57:09 2001
+++ genesis2.2.1.Panther/src/Xodus/Widg/xgifload.c	Mon May 24 17:44:24 2004
@@ -975,8 +975,8 @@
 	char cp[4];
     } conv;
 
-    disp = XgDisplay();
-    vis = XoGetUsedVisual();
+    disp = (Display *)XgDisplay();
+    vis = (Visual *)XoGetUsedVisual();
     cmap = XoGetUsedColormap();
     depth = XoGetUsedDepth();
 
diff -Naur genesis/src/Xodus/Xo/Error.c genesis2.2.1.Panther/src/Xodus/Xo/Error.c
--- genesis/src/Xodus/Xo/Error.c	Mon Jun 12 06:28:20 2000
+++ genesis2.2.1.Panther/src/Xodus/Xo/Error.c	Mon May 24 17:44:24 2004
@@ -8,7 +8,7 @@
  * Initial revision
  * */
 
-#include <varargs.h>
+#include <stdarg.h>
 #include <stdio.h>
 
 void _XgPrintToStderr ();
@@ -16,14 +16,12 @@
 static void (*error_handler)() = _XgPrintToStderr;
 
 
-void XgError (format, va_alist)
-     char *format;
-     va_dcl
+void XgError (char *format, ... )
 {
   char error[256];
   va_list args;
 
-  va_start(args);
+  va_start(args,format);
   vsprintf (error, format, args);
   va_end(args);
   
diff -Naur genesis/src/Xodus/Xo/TopLevel.c genesis2.2.1.Panther/src/Xodus/Xo/TopLevel.c
--- genesis/src/Xodus/Xo/TopLevel.c	Fri Jun 29 23:10:03 2001
+++ genesis2.2.1.Panther/src/Xodus/Xo/TopLevel.c	Mon May 24 17:44:24 2004
@@ -123,7 +123,7 @@
 
   */
   new->shell = XtVaAppCreateShell("genesis", "Genesis", topLevelShellWidgetClass,
-				  XgDisplay(),
+				  (Display *)XgDisplay(),
 				  XtNmappedWhenManaged, False,
 				  XtNallowShellResize, True,
 				  XtNinput, True,
@@ -161,6 +161,6 @@
   hints.flags = USPosition;
   hints.x = xpos;
   hints.y = ypos; 
-  XSetSizeHints(XgDisplay(),XtWindow(toplevelshell),&hints,
+  XSetSizeHints((Display *)XgDisplay(),XtWindow(toplevelshell),&hints,
 				XA_WM_NORMAL_HINTS);	
 }
diff -Naur genesis/src/Xodus/Xo/XoArgLists.c genesis2.2.1.Panther/src/Xodus/Xo/XoArgLists.c
--- genesis/src/Xodus/Xo/XoArgLists.c	Mon Jun 12 06:28:20 2000
+++ genesis2.2.1.Panther/src/Xodus/Xo/XoArgLists.c	Mon May 24 17:44:24 2004
@@ -27,7 +27,7 @@
 
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
-#include <varargs.h>
+#include <stdarg.h>
 #include <stdio.h>
 
  static String XtNxtConvertVarToArgList = "xtConvertVarToArgList";
@@ -207,9 +207,7 @@
 XoXtVaSetValues(Widget widget, ...)
 #else
 VARARGS1*/
-void XoXtVaSetValues(widget, va_alist)
-    Widget widget;
-    va_dcl
+void XoXtVaSetValues(Widget widget, ... )
 {
     va_list                 var;
     ArgList                 args = NULL;
@@ -218,11 +216,11 @@
 /*     WIDGET_TO_APPCON(widget); */
 
     /* LOCK_APP(app); */
-    va_start(var);
+    va_start(var, widget);
     _XtCountVaList(var, &total_count, &typed_count);
     va_end(var);
 
-    va_start(var);
+    va_start(var, widget);
 
     _XoXtVaToArgList(widget, var, total_count, &args, &num_args);
     XtSetValues(widget, args, num_args);
diff -Naur genesis/src/Xodus/Xo/XodusMacOSXDarwinMakefile genesis2.2.1.Panther/src/Xodus/Xo/XodusMacOSXDarwinMakefile
--- genesis/src/Xodus/Xo/XodusMacOSXDarwinMakefile	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/Xodus/Xo/XodusMacOSXDarwinMakefile	Mon May 24 17:44:24 2004
@@ -0,0 +1,85 @@
+# $Id: Makefile,v 1.10 2000/07/03 18:09:56 mhucka Exp $
+# $Log: Makefile,v $
+# Revision 1.10  2000/07/03 18:09:56  mhucka
+# Removed RCS directives and added c flag to ar command invocation.
+#
+# Revision 1.9  1999/11/29 07:50:09  mhucka
+# Removed needless subshell () wrappers and performed other related cleanup.
+#
+# Revision 1.8  1996/06/18 06:46:15  dhb
+# Removed redundant define for CC macro which on some systems
+# was causing a recursive macro definition error.
+#
+# Revision 1.7  1996/06/06  23:06:29  dhb
+# Now use AR macro for archive command.
+#
+# Revision 1.6  1995/02/13  21:17:42  dhb
+# Removed checkout of RCSRELEASE versions.
+#
+# Revision 1.5  1995/01/09  23:36:25  dhb
+# Commented the COMPILE.c macro and added the CPPFLAGS to the CFLAGS
+# line.  Appears the COMPILE.c is not portable.
+#
+# Revision 1.4  1994/12/19  22:23:32  dhb
+# Added rules for RCS subdirectory.
+#
+# Revision 1.3  1994/12/06  01:59:22  dhb
+# Added install target and support for ranlib.
+#
+# Revision 1.2  1994/12/06  00:09:49  dhb
+# Nov 8 1994 changes from Upi Bhalla
+#
+# Revision 1.1.1.4  1994/04/11  22:29:21  dhb
+# Missing some include dirs on RCS checkout actions
+#
+# Revision 1.1.1.3  1994/04/11  21:28:28  dhb
+# Needed tabs on RCS checkout actions
+#
+# Revision 1.1.1.2  1994/04/11  21:15:38  dhb
+# Added RCS checkout rules
+#
+# Revision 1.1.1.1  1994/04/11  17:44:07  dhb
+# Update from Dave Bilitch.
+#
+# Revision 1.1  1994/01/13  18:34:14  bhalla
+# Initial revision
+#
+
+CPPFLAGS  = -I..
+CFLAGS    = $(TOPFLAGS) $(CPPFLAGS)
+LIBS      = -lXt -lXext -lX11
+#COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
+
+OBJS      = \
+	Initialize.o \
+	Error.o \
+	TopLevel.o \
+	XoGeometry.o \
+	XoUtil.o \
+	XoChildRes.o \
+	XoArgLists.o \
+	XoDraw.o \
+	XoColor.o \
+	XoCursor.o \
+	XoPS.o
+
+.SUFFIXES: .c,v .c .h,v .h
+
+.h,v.h:
+	co $*.h
+
+.c,v.o:
+	co $*.c
+	cc -c $(CFLAGS) $(CPPFLAGS) $(SIMINCLUDE) $*.c
+	rm -f $*.c
+
+libXo.a: $(OBJS)
+	$(AR) rc libXo.a $(OBJS)
+	ranlib libXo.a
+
+clean:
+	-rm -f *.[oa]
+
+install:
+	cp libXo.a $(INSTALL)/lib
+	ranlib $(INSTALL)/lib/libXo.a
diff -Naur genesis/src/Xodus/Xo/xo_cvt.c genesis2.2.1.Panther/src/Xodus/Xo/xo_cvt.c
--- genesis/src/Xodus/Xo/xo_cvt.c	Fri Jun 29 23:12:55 2001
+++ genesis2.2.1.Panther/src/Xodus/Xo/xo_cvt.c	Mon May 24 17:44:24 2004
@@ -700,7 +700,7 @@
 		/* We handle form widgets specially */
 		fW = XtParent(XtParent(XtParent(XtParent(object))));
   		if ( strbegins (field, "xgeom") ) {
-			n=xoConvertGeom(value,0,XDisplayWidth(XgDisplay(),0),1);
+			n=xoConvertGeom(value,0,XDisplayWidth((Display *)XgDisplay(),0),1);
 			/* ugly hack to head off a problem I havent figured out */
 			/*if (n == 0) n = 1;*/
 			if (n>=0) {
@@ -709,7 +709,7 @@
 			}
 		}
   		if ( strbegins (field, "ygeom") ) {
-			n=xoConvertGeom(value,0,XDisplayHeight(XgDisplay(),0),1);
+			n=xoConvertGeom(value,0,XDisplayHeight((Display *)XgDisplay(),0),1);
 			/* ugly hack to head off a problem I havent figured out */
 			/*if (n == 0) n = 1;*/
 			if (n>=0) {
@@ -718,14 +718,14 @@
 			}
 		}
   		if ( strbegins (field, "wgeom") ) {
-			n=xoConvertGeom(value,1,XDisplayWidth(XgDisplay(),0),200);
+			n=xoConvertGeom(value,1,XDisplayWidth((Display *)XgDisplay(),0),200);
 			if (n>1) {
 				XoXtVaSetValues(/*object*/fW,XtNwidth,n,NULL);
 				return(True);
 			}
 		}
   		if ( strbegins (field, "hgeom") ) {
-			n=xoConvertGeom(value,1,XDisplayHeight(XgDisplay(),0),200);
+			n=xoConvertGeom(value,1,XDisplayHeight((Display *)XgDisplay(),0),200);
 			if (n>1) {
 				XoXtVaSetValues(/*object*/fW,XtNheight,n,NULL);
 				return(True);
diff -Naur genesis/src/diskio/diskio_func_ext.h genesis2.2.1.Panther/src/diskio/diskio_func_ext.h
--- genesis/src/diskio/diskio_func_ext.h	Mon Jun 12 07:07:01 2000
+++ genesis2.2.1.Panther/src/diskio/diskio_func_ext.h	Mon May 24 17:44:23 2004
@@ -52,7 +52,7 @@
  extern long ffParseIndexedField(/*char *field */);
  extern long ffParseWhiteSpacedString(/*char *string, char **eachstring*/);
 
- extern void ffError(/* char *format, va_list */);
+ extern void ffError(char *format, ... );
  extern void Expand_And_Copy_String(/* char**, char* */);
 
 #endif
diff -Naur genesis/src/diskio/diskio_utilfunc.c genesis2.2.1.Panther/src/diskio/diskio_utilfunc.c
--- genesis/src/diskio/diskio_utilfunc.c	Mon Jun 12 07:07:01 2000
+++ genesis2.2.1.Panther/src/diskio/diskio_utilfunc.c	Mon May 24 17:44:23 2004
@@ -48,21 +48,19 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <varargs.h>
+#include <stdarg.h>
 #include <sys/types.h>
 
 #include "absff_ext.h"
 #include "diskio_ext.h"
 
 
-void ffError(format, va_alist)
-	char *format;
-va_dcl
+void ffError(char *format, ... )
 {
 	char error[256];
 	va_list args;
 
-	va_start(args);
+	va_start(args, format);
 	vsprintf(error, format, args);
 	va_end(args);	 
 
diff -Naur genesis/src/diskio/interface/netcdf/netcdf-3.4/src/fortran/nfconfig.inc genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/fortran/nfconfig.inc
--- genesis/src/diskio/interface/netcdf/netcdf-3.4/src/fortran/nfconfig.inc	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/fortran/nfconfig.inc	Mon May 24 17:44:23 2004
@@ -0,0 +1,83 @@
+#if 0
+    $Id: nfconfig.in,v 1.1 1999/10/13 02:32:50 mhucka Exp $ 
+#endif
+
+
+#ifndef UD_NETCDF_CPP_INC
+#define UD_NETCDF_CPP_INC
+
+
+#if 0
+    Do not have C-style comments in here because this file is processed
+    by both the FORTRAN compiler (for the nf_test/ stuff) and the C
+    compiler (for the FORTRAN-callable interface routines) and some 
+    FORTRAN preprocessors do not understand the /*...*/ syntax.
+#endif
+
+
+#if 0
+    The following macros define the supplementary FORTRAN arithmetic
+    datatypes beyond the standard INTEGER, REAL, and DOUBLEPRECISION --
+    ostensibly corresponding to 8-bit and 16-bit integers, respectively.
+    For example:
+
+	#define NF_INT1_T        byte
+	#define NF_INT2_T        integer*2
+
+    These are the types of the relevant arguments in the NF_*_INT1() and
+    NF_*_INT2() netCDF FORTRAN function calls.  The word "ostensibly"
+    is used advisedly: on some systems an "integer*2" datatype,
+    nevertheless, occupies 64 bits (we are not making this up).
+
+    If your FORTRAN system does not have the respective supplementary
+    datatype, then do not define the corresponding macro.
+#endif
+#undef NF_INT1_T
+#undef NF_INT2_T
+
+
+#if 0
+   Define the following NF_*_IS_C_* macros appropriatly for your system.
+   The "INT1", "INT2" and "INT" after the "NF_" refer to the NF_INT1_T
+   FORTRAN datatype, the NF_INT2_T FORTRAN datatype, and the INTEGER
+   FORTRAN datatype, respectively.  If the respective FORTRAN datatype
+   does not exist, then do not define the corresponding macro.
+#endif
+#undef NF_INT1_IS_C_SIGNED_CHAR
+#undef NF_INT1_IS_C_SHORT
+#undef NF_INT1_IS_C_INT
+#undef NF_INT1_IS_C_LONG
+#undef NF_INT2_IS_C_SHORT
+#undef NF_INT2_IS_C_INT
+#undef NF_INT2_IS_C_LONG
+#undef NF_INT_IS_C_INT
+#undef NF_INT_IS_C_LONG
+#undef NF_REAL_IS_C_FLOAT
+#undef NF_REAL_IS_C_DOUBLE
+#undef NF_DOUBLEPRECISION_IS_C_DOUBLE
+#undef NF_DOUBLEPRECISION_IS_C_FLOAT
+
+
+#if 0
+   Whether the system uses something besides the IEEE floating-point
+   format to represent floating-point values.
+#endif
+#undef NO_IEEE_FLOAT
+
+
+#if 0
+   END OF CUSTOMIZATION
+#endif
+
+
+#if 0
+    FORTRAN data types corresponding to netCDF version 2 "byte" and "short"
+    data types (e.g. INTEGER*1, INTEGER*2).  See file "ftest.F" for usage.
+#endif
+#if !defined(NO_NETCDF_2)
+#   undef NCBYTE_T
+#   undef NCSHORT_T
+#endif
+
+
+#endif
diff -Naur genesis/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/libvers.c genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/libvers.c
--- genesis/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/libvers.c	Wed Oct 13 04:32:51 1999
+++ genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/libvers.c	Mon May 24 17:44:23 2004
@@ -10,15 +10,16 @@
  * A version string.
  */
 #define SKIP_LEADING_GARBAGE 33	/* # of chars prior to the actual version */
-#define XSTRING(x)	#x
-#define STRING(x)	XSTRING(x)
-static const char nc_libvers[] =
-	"\044Id: \100(#) netcdf library version " STRING(VERSION) " of "__DATE__" "__TIME__" $";
+#define XSTRING(x) #x
+#define STRING(x) XSTRING(x)
+
+static const char nc_libvers[] = "\044Id: \100(#) netcdf library version "STRING(VERSION)" of "__DATE__" "__TIME__" $";
+
 
 const char *
 nc_inq_libvers(void)
 {
-	return &nc_libvers[SKIP_LEADING_GARBAGE];
+	return &nc_libvers[SKIP_LEADING_GARBAGE]; 
 }
 
 #if 0 /* TEST JIG */
diff -Naur genesis/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/ncconfig.h genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/ncconfig.h
--- genesis/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/ncconfig.h	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/libsrc/ncconfig.h	Mon May 24 17:44:23 2004
@@ -0,0 +1,82 @@
+/* libsrc/ncconfig.h.  Generated automatically by configure.  */
+/* libsrc/ncconfig.in.  Generated automatically from configure.in by autoheader.  */
+/* $Id: ncconfig.in,v 1.1 1999/10/13 02:32:51 mhucka Exp $ */
+#ifndef _NCCONFIG_H_
+#define _NCCONFIG_H_
+
+/* Define if you're on an HP-UX system. */
+/* #undef _HPUX_SOURCE */
+
+/* Define if type char is unsigned and you are not using gcc.  */
+#ifndef __CHAR_UNSIGNED__
+/* #undef __CHAR_UNSIGNED__ */
+#endif
+
+/* Define if your struct stat has st_blksize.  */
+#define HAVE_ST_BLKSIZE 1
+
+/* Define to `long' if <sys/types.h> doesn't define.  */
+/* #undef off_t */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* Define if your processor stores words with the most significant
+   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
+#define WORDS_BIGENDIAN 1
+
+/* Define if you don't have the <stdlib.h>.  */
+/* #undef NO_STDLIB_H */
+
+/* Define if you don't have the <sys/types.h>.  */
+/* #undef NO_SYS_TYPES_H */
+
+/* Define if you have the ftruncate function  */
+/* #undef HAVE_FTRUNCATE */
+
+/* Define if you have alloca, as a function or macro.  */
+#define HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+#define HAVE_ALLOCA_H 1
+
+/* Define if you don't have the strerror function  */
+/* #undef NO_STRERROR */
+
+/* The number of bytes in a size_t */
+#define SIZEOF_SIZE_T 4
+
+/* The number of bytes in a off_t */
+#define SIZEOF_OFF_T 8
+
+/* Define to `int' if system doesn't define.  */
+/* #undef ssize_t */
+
+/* Define to `int' if system doesn't define.  */
+/* #undef ptrdiff_t */
+
+/* Define to `unsigned char' if system doesn't define.  */
+#define uchar unsigned char
+
+/* Define if the system does not use IEEE floating point representation */
+/* #undef NO_IEEE_FLOAT */
+
+/* The number of bytes in a double.  */
+#define SIZEOF_DOUBLE 8
+
+/* The number of bytes in a float.  */
+#define SIZEOF_FLOAT 4
+
+/* The number of bytes in a int.  */
+#define SIZEOF_INT 4
+
+/* The number of bytes in a long.  */
+#define SIZEOF_LONG 4
+
+/* The number of bytes in a short.  */
+#define SIZEOF_SHORT 2
+
+#endif /* !_NCCONFIG_H_ */
diff -Naur genesis/src/diskio/interface/netcdf/netcdf-3.4/src/macros.make genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/macros.make
--- genesis/src/diskio/interface/netcdf/netcdf-3.4/src/macros.make	Sun Jul 22 19:53:18 2001
+++ genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/macros.make	Thu Jan  1 01:00:00 1970
@@ -1,88 +0,0 @@
-# $Id: macros.make,v 1.7 2001/07/22 17:53:18 mhucka Exp $
-
-# The purpose of this file is to contain common make(1) macros.
-# It should be processed by every execution of that utility.
-
-
-# POSIX shell.  Shouldn't be necessary -- but is under IRIX 5.3.
-SHELL		= /bin/sh
-
-
-# Installation Directories:
-prefix		= /free/mhucka/genesis/genesis-2/genesis/src/diskio/interface/netcdf/netcdf-3.4
-exec_prefix	= $(prefix)
-INCDIR		= $(exec_prefix)/include
-LIBDIR		= $(exec_prefix)/lib
-BINDIR		= $(exec_prefix)/bin
-MANDIR		= $(prefix)/man
-
-
-# Preprocessing:
-M4		= m4
-M4FLAGS		= -B10000
-CPP		= cc -E
-CPPFLAGS	= $(INCLUDES) $(DEFINES) -DNDEBUG
-FPP		= cc -E
-FPPFLAGS	= 
-CXXCPPFLAGS	= $(CPPFLAGS)
-
-
-# Compilation:
-CC		= cc
-CXX		= 
-FC		= 
-CFLAGS		= -O2 -D__GLIBC -D__NO_MATH_INLINES -Wall -Wno-implicit -Wno-return-type -Wno-unused -Wno-parentheses   -Dbison -Dnetcdf -DFMT1 -DINCSPRNG -DBSD -DLinux 
-CXXFLAGS	= $(CFLAGS) 
-FFLAGS		= -O
-CC_MAKEDEPEND	= false
-COMPILE.c	= $(CC) -c $(CFLAGS) $(CPPFLAGS)
-COMPILE.cxx	= $(CXX) -c $(CXXFLAGS) $(CXXCPPFLAGS)
-COMPILE.f	= $(FC) -c $(FFLAGS)
-# The following command isn't available on some systems; therefore, the
-# `.F.o' rule is relatively complicated.
-COMPILE.F	= 
-
-
-# Linking:
-MATHLIB		= -lm
-FLIBS		=  
-LIBS		= 
-LINK.c		= $(CC) -o $@ $(CFLAGS) $(LDFLAGS)
-LINK.cxx	= $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS)
-LINK.F		= $(FC) -o $@ $(FFLAGS) $(FLDFLAGS)
-LINK.f		= $(FC) -o $@ $(FFLAGS) $(FLDFLAGS)
-
-
-# NetCDF files:
-NCDUMP		= ncdump
-NCGEN		= ncgen
-
-
-# Manual pages:
-WHATIS		= whatis
-# The following macro should be empty on systems that don't
-# allow users to create their own manual-page indexes.
-MAKEWHATIS_CMD	= 
-
-
-# Misc. Utilities:
-AR		= ar
-ARFLAGS		= cru	# NB: SunOS 4 doesn't like `-' option prefix
-RANLIB		= ranlib
-TARFLAGS	= -chf
-
-
-# Dummy macros: used only as placeholders to silence GNU make.  They are
-# redefined, as necessary, in subdirectory makefiles.
-HEADER		= dummy_header
-HEADER1		= dummy_header1
-HEADER2		= dummy_header2
-LIBRARY		= dummy_library.a
-MANUAL		= dummy_manual
-PROGRAM		= dummy_program
-
-
-# Distribution macros:
-FTPDIR		= /home/ftp/pub/$(PACKAGE)
-FTPBINDIR	= /home/ftp/pub/binary/dummy_system
-VERSION		= dummy_version
diff -Naur genesis/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/ncgentab.c genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/ncgentab.c
--- genesis/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/ncgentab.c	Wed Oct 13 04:33:03 1999
+++ genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/ncgentab.c	Mon May 24 17:44:23 2004
@@ -78,11 +78,17 @@
 #include <stdlib.h>
 #include <string.h>
 #else
+#include <sys/types.h>
 #include <malloc.h>
 #include <memory.h>
 #endif
 
+#ifdef __APPLE__
+#include <float.h>
+#include <limits.h>
+#else
 #include <values.h>
+#endif
 
 #ifdef __cplusplus
 
diff -Naur genesis/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.c genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.c
--- genesis/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.c	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.c	Mon May 24 17:44:23 2004
@@ -0,0 +1,1303 @@
+#include <sys/cdefs.h>
+#ifndef lint
+#if 0
+static char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#else
+__IDSTRING(yyrcsid, "$NetBSD: skeleton.c,v 1.14 1997/10/20 03:41:16 lukem Exp $");
+#endif
+#endif
+#include <stdlib.h>
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+#define YYLEX yylex()
+#define YYEMPTY -1
+#define yyclearin (yychar=(YYEMPTY))
+#define yyerrok (yyerrflag=0)
+#define YYRECOVERING (yyerrflag!=0)
+#define YYPREFIX "yy"
+#line 10 "ncgen.y"
+#ifndef lint
+static char SccsId[] = "$Id: ncgen.y,v 1.1 1999/10/13 02:33:03 mhucka Exp $";
+#endif
+#include        <string.h>
+#include	<stdlib.h>
+#include	<netcdf.h>
+#include 	"generic.h"
+#include        "ncgen.h"
+#include	"genlib.h"	/* for grow_darray() et al */
+
+typedef struct Symbol {		/* symbol table entry */
+	char    	*name;
+	struct Symbol   *next;
+	unsigned	is_dim : 1;	/* appears as netCDF dimension */
+	unsigned	is_var : 1;	/* appears as netCDF variable */
+	unsigned	is_att : 1;	/* appears as netCDF attribute */
+	int             dnum;	        /* handle as a dimension */
+	int             vnum;	        /* handle as a variable */
+	} *YYSTYPE1;
+
+/* True if string a equals string b*/
+#define	STREQ(a, b)	(*(a) == *(b) && strcmp((a), (b)) == 0)
+#define NC_UNSPECIFIED ((nc_type)0)	/* unspecified (as yet) type */
+
+#define YYSTYPE YYSTYPE1
+YYSTYPE symlist;		/* symbol table: linked list */
+
+extern int derror_count;	/* counts errors in netcdf definition */
+extern int lineno;		/* line number for error messages */
+
+static int not_a_string;	/* whether last constant read was a string */
+static char termstring[MAXTRST]; /* last terminal string read */
+static double double_val;	/* last double value read */
+static float float_val;		/* last float value read */
+static int int_val;		/* last int value read */
+static short short_val;		/* last short value read */
+static char char_val;		/* last char value read */
+static signed char byte_val;	/* last byte value read */
+
+static nc_type type_code;	/* holds declared type for variables */
+static nc_type atype_code;	/* holds derived type for attributes */
+static char *netcdfname;	/* to construct netcdf file name */
+static void *att_space;		/* pointer to block for attribute values */
+static nc_type valtype;		/* type code for list of attribute values  */
+
+static char *char_valp;		/* pointers used to accumulate data values */
+static signed char *byte_valp;
+static short *short_valp;
+static int *int_valp;
+static float *float_valp;
+static double *double_valp;
+static void *rec_cur;		/* pointer to where next data value goes */
+static void *rec_start;		/* start of space for data */
+#line 74 "y.tab.c"
+#define NC_UNLIMITED_K 257
+#define BYTE_K 258
+#define CHAR_K 259
+#define SHORT_K 260
+#define INT_K 261
+#define FLOAT_K 262
+#define DOUBLE_K 263
+#define IDENT 264
+#define TERMSTRING 265
+#define BYTE_CONST 266
+#define CHAR_CONST 267
+#define SHORT_CONST 268
+#define INT_CONST 269
+#define FLOAT_CONST 270
+#define DOUBLE_CONST 271
+#define DIMENSIONS 272
+#define VARIABLES 273
+#define NETCDF 274
+#define DATA 275
+#define FILLVALUE 276
+#define YYERRCODE 256
+short yylhs[] = {                                        -1,
+    2,    5,    0,    1,    1,    6,    6,    7,    7,    8,
+    8,    9,   10,    3,    3,    3,   11,   11,   13,   13,
+   12,   12,   16,   14,   17,   17,   17,   17,   17,   17,
+   18,   18,   22,   19,   20,   21,   21,   23,   23,   24,
+   26,   15,   25,   25,   28,   29,   27,   27,   30,   31,
+   31,   31,   31,   31,   31,   31,    4,    4,   32,   32,
+   34,   33,   35,   35,   38,   36,   37,   37,   37,   37,
+   37,   37,   37,   37,
+};
+short yylen[] = {                                         2,
+    0,    0,    8,    0,    2,    2,    3,    1,    3,    3,
+    3,    1,    1,    0,    2,    1,    2,    3,    1,    1,
+    2,    3,    1,    2,    1,    1,    1,    1,    1,    1,
+    1,    3,    0,    3,    1,    0,    3,    1,    3,    1,
+    0,    4,    3,    2,    1,    1,    1,    3,    1,    1,
+    1,    1,    1,    1,    1,    1,    0,    2,    2,    3,
+    0,    4,    1,    3,    0,    2,    1,    1,    1,    1,
+    1,    1,    1,    1,
+};
+short yydefred[] = {                                      0,
+    0,    0,    1,    0,    0,    0,   13,    0,    0,    8,
+    0,   12,   35,    0,    0,    2,    0,   23,    0,   45,
+   41,    0,    0,    6,    0,    0,   25,   26,   27,   28,
+   29,   30,    0,    0,   19,   20,    0,   46,   44,    0,
+    0,   21,    0,    0,    7,    9,   11,   10,    0,   17,
+    0,   31,   33,    0,    0,   22,    0,   43,   18,    0,
+    0,   61,    0,    0,    3,   51,   52,   50,   53,   54,
+   55,   56,    0,   47,   49,   32,    0,   34,    0,    0,
+   59,    0,   40,    0,   38,   65,   60,   48,    0,   37,
+    0,   63,    0,   39,   65,   68,   69,   67,   70,   71,
+   72,   73,   74,   66,   64,
+};
+short yydgoto[] = {                                       2,
+    6,    4,   16,   55,   40,    8,    9,   10,   11,   12,
+   33,   17,   34,   35,   18,   19,   37,   51,   52,   20,
+   78,   61,   84,   85,   21,   43,   73,   22,   39,   74,
+   75,   63,   64,   79,   91,   92,  104,   93,
+};
+short yysindex[] = {                                   -261,
+ -109,    0,    0, -253, -242,  -54,    0, -242,  -35,    0,
+  -23,    0,    0,  -38, -225,    0,  -56,    0,  -36,    0,
+    0,  -18,  -34,    0, -242, -241,    0,    0,    0,    0,
+    0,    0,  -38,   -9,    0,    0, -223,    0,    0, -224,
+   -7,    0,   -8, -225,    0,    0,    0,    0,   -5,    0,
+   11,    0,    0, -223,  -69,    0, -222,    0,    0, -223,
+   17,    0, -223,   -1,    0,    0,    0,    0,    0,    0,
+    0,    0,   15,    0,    0,    0, -242,    0,    1,    2,
+    0, -222,    0,  -26,    0,    0,    0,    0, -242,    0,
+   16,    0, -234,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,
+};
+short yyrindex[] = {                                      0,
+    0,    0,    0,  -58,    0, -122,    0,  -57,    0,    0,
+    0,    0,    0,    0,    0,    0, -120,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0, -119,    0,    0,    0,    0,    0,    0,  -62,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    5,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+  -33,    0,  -59,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,  -36,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    6,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,
+};
+short yygindex[] = {                                      0,
+    0,    0,    0,    0,    0,    0,   61,   45,    0,  -60,
+    0,    0,   38,    0,   -6,   55,    0,    0,   13,  -30,
+    0,    0,    0,  -15,    0,    0,    0,  -42,   31,   -4,
+    0,    0,   14,    0,    0,  -19,    0,    0,
+};
+#define YYTABLESIZE 226
+short yytable[] = {                                       4,
+    5,   15,   14,   15,   16,   15,   53,   36,   25,   25,
+   36,   62,    1,    3,   90,   47,   83,   89,    5,   15,
+   62,    7,   42,   24,   45,   36,   36,   48,   83,   53,
+   96,   97,   98,   99,  100,  101,  102,   26,   38,   44,
+   13,  103,   66,   67,   68,   69,   70,   71,   72,   50,
+   54,   56,   57,   59,   60,   65,   77,   81,   82,   95,
+   87,   86,   57,   24,   62,   58,    4,    5,   23,   46,
+   49,   41,   76,   94,   58,  105,   80,   88,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,   14,    0,   16,   15,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    4,    0,   13,    0,   13,
+    0,    0,    0,    0,    4,    5,    4,    5,   14,   27,
+   28,   29,   30,   31,   32,   13,
+};
+short yycheck[] = {                                      58,
+   58,   58,  125,   58,  125,  125,   37,   14,   44,   44,
+   44,   54,  274,  123,   41,  257,   77,   44,  272,   58,
+   63,  264,   59,   59,   59,   59,   33,  269,   89,   60,
+  265,  266,  267,  268,  269,  270,  271,   61,  264,   58,
+  264,  276,  265,  266,  267,  268,  269,  270,  271,   59,
+  275,   59,   61,   59,   44,  125,   40,   59,   44,   44,
+   59,   61,  125,   59,   59,  125,  125,  125,    8,   25,
+   33,   17,   60,   89,   44,   95,   63,   82,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,  275,   -1,  275,  275,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  264,   -1,  264,   -1,  264,
+   -1,   -1,   -1,   -1,  273,  273,  275,  275,  273,  258,
+  259,  260,  261,  262,  263,  264,
+};
+#define YYFINAL 2
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 276
+#if YYDEBUG
+char *yyname[] = {
+"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'","';'",0,"'='",
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+"NC_UNLIMITED_K","BYTE_K","CHAR_K","SHORT_K","INT_K","FLOAT_K","DOUBLE_K",
+"IDENT","TERMSTRING","BYTE_CONST","CHAR_CONST","SHORT_CONST","INT_CONST",
+"FLOAT_CONST","DOUBLE_CONST","DIMENSIONS","VARIABLES","NETCDF","DATA",
+"FILLVALUE",
+};
+char *yyrule[] = {
+"$accept : ncdesc",
+"$$1 :",
+"$$2 :",
+"ncdesc : NETCDF '{' $$1 dimsection vasection $$2 datasection '}'",
+"dimsection :",
+"dimsection : DIMENSIONS dimdecls",
+"dimdecls : dimdecline ';'",
+"dimdecls : dimdecls dimdecline ';'",
+"dimdecline : dimdecl",
+"dimdecline : dimdecline ',' dimdecl",
+"dimdecl : dimd '=' INT_CONST",
+"dimdecl : dimd '=' NC_UNLIMITED_K",
+"dimd : dim",
+"dim : IDENT",
+"vasection :",
+"vasection : VARIABLES vadecls",
+"vasection : gattdecls",
+"vadecls : vadecl ';'",
+"vadecls : vadecls vadecl ';'",
+"vadecl : vardecl",
+"vadecl : attdecl",
+"gattdecls : gattdecl ';'",
+"gattdecls : gattdecls gattdecl ';'",
+"gattdecl : attdecl",
+"vardecl : type varlist",
+"type : BYTE_K",
+"type : CHAR_K",
+"type : SHORT_K",
+"type : INT_K",
+"type : FLOAT_K",
+"type : DOUBLE_K",
+"varlist : varspec",
+"varlist : varlist ',' varspec",
+"$$3 :",
+"varspec : var $$3 dimspec",
+"var : IDENT",
+"dimspec :",
+"dimspec : '(' dimlist ')'",
+"dimlist : vdim",
+"dimlist : dimlist ',' vdim",
+"vdim : dim",
+"$$4 :",
+"attdecl : att $$4 '=' attvallist",
+"att : avar ':' attr",
+"att : ':' attr",
+"avar : var",
+"attr : IDENT",
+"attvallist : aconst",
+"attvallist : attvallist ',' aconst",
+"aconst : attconst",
+"attconst : CHAR_CONST",
+"attconst : TERMSTRING",
+"attconst : BYTE_CONST",
+"attconst : SHORT_CONST",
+"attconst : INT_CONST",
+"attconst : FLOAT_CONST",
+"attconst : DOUBLE_CONST",
+"datasection :",
+"datasection : DATA datadecls",
+"datadecls : datadecl ';'",
+"datadecls : datadecls datadecl ';'",
+"$$5 :",
+"datadecl : avar $$5 '=' constlist",
+"constlist : dconst",
+"constlist : constlist ',' dconst",
+"$$6 :",
+"dconst : $$6 const",
+"const : CHAR_CONST",
+"const : TERMSTRING",
+"const : BYTE_CONST",
+"const : SHORT_CONST",
+"const : INT_CONST",
+"const : FLOAT_CONST",
+"const : DOUBLE_CONST",
+"const : FILLVALUE",
+};
+#endif
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 10000
+#define YYMAXDEPTH 10000
+#endif
+#endif
+#define YYINITSTACKSIZE 200
+int yydebug;
+int yynerrs;
+int yyerrflag;
+int yychar;
+short *yyssp;
+YYSTYPE *yyvsp;
+YYSTYPE yyval;
+YYSTYPE yylval;
+short *yyss;
+short *yysslim;
+YYSTYPE *yyvs;
+int yystacksize;
+#line 753 "ncgen.y"
+
+/* PROGRAMS */
+
+#ifdef vms
+void
+#else
+int
+#endif
+yyerror(	/* called for yacc syntax error */
+     char *s)
+{
+	derror(s);
+#ifndef vms
+	return -1;
+#endif
+}
+
+/* undefine yywrap macro, in case we are using bison instead of yacc */
+#ifdef yywrap
+#undef yywrap
+#endif
+
+int
+yywrap(void)			/* returns 1 on EOF if no more input */
+{
+    return  1;
+}
+
+
+/* Symbol table operations for ncgen tool */
+
+YYSTYPE lookup(       /* find sname in symbol table (linear search) */
+	char *sname)
+{
+    YYSTYPE sp;
+    for (sp = symlist; sp != (YYSTYPE) 0; sp = sp -> next)
+	if (STREQ(sp -> name, sname)) {
+	    return sp;
+	}
+    return 0;			/* 0 ==> not found */
+}
+
+YYSTYPE install(  /* install sname in symbol table */
+	char *sname)
+{
+    YYSTYPE sp;
+
+    sp = (YYSTYPE) emalloc (sizeof (struct Symbol));
+    sp -> name = (char *) emalloc (strlen (sname) + 1);/* +1 for '\0' */
+    (void) strcpy (sp -> name, sname);
+    sp -> next = symlist;	/* put at front of list */
+    sp -> is_dim = 0;
+    sp -> is_var = 0;
+    sp -> is_att = 0;
+    symlist = sp;
+    return sp;
+}
+
+void
+clearout(void)	/* reset symbol table to empty */
+{
+    YYSTYPE sp, tp;
+    for (sp = symlist; sp != (YYSTYPE) 0;) {
+	tp = sp -> next;
+	free (sp -> name);
+	free ((char *) sp);
+	sp = tp;
+    }
+    symlist = 0;
+}
+
+/* get lexical input routine generated by lex  */
+#include "ncgenyy.c"
+#line 416 "y.tab.c"
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+int yyparse __P((void));
+static int yygrowstack __P((void));
+static int yygrowstack()
+{
+    int newsize, i;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize = yystacksize) == 0)
+        newsize = YYINITSTACKSIZE;
+    else if (newsize >= YYMAXDEPTH)
+        return -1;
+    else if ((newsize *= 2) > YYMAXDEPTH)
+        newsize = YYMAXDEPTH;
+    i = yyssp - yyss;
+    if ((newss = (short *)realloc(yyss, newsize * sizeof *newss)) == NULL)
+        return -1;
+    yyss = newss;
+    yyssp = newss + i;
+    if ((newvs = (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs)) == NULL)
+        return -1;
+    yyvs = newvs;
+    yyvsp = newvs + i;
+    yystacksize = newsize;
+    yysslim = yyss + newsize - 1;
+    return 0;
+}
+
+#define YYABORT goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR goto yyerrlab
+int
+yyparse()
+{
+    int yym, yyn, yystate;
+#if YYDEBUG
+    char *yys;
+
+    if ((yys = getenv("YYDEBUG")) != NULL)
+    {
+        yyn = *yys;
+        if (yyn >= '0' && yyn <= '9')
+            yydebug = yyn - '0';
+    }
+#endif
+
+    yynerrs = 0;
+    yyerrflag = 0;
+    yychar = (-1);
+
+    if (yyss == NULL && yygrowstack()) goto yyoverflow;
+    yyssp = yyss;
+    yyvsp = yyvs;
+    *yyssp = yystate = 0;
+
+yyloop:
+    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar = yylex()) < 0) yychar = 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys = 0;
+            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
+            if (!yys) yys = "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
+            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yyssp >= yysslim && yygrowstack())
+        {
+            goto yyoverflow;
+        }
+        *++yyssp = yystate = yytable[yyn];
+        *++yyvsp = yylval;
+        yychar = (-1);
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
+            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
+    {
+        yyn = yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+    goto yynewerror;
+yynewerror:
+    yyerror("syntax error");
+    goto yyerrlab;
+yyerrlab:
+    ++yynerrs;
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag = 3;
+        for (;;)
+        {
+            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
+                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
+#endif
+                if (yyssp >= yysslim && yygrowstack())
+                {
+                    goto yyoverflow;
+                }
+                *++yyssp = yystate = yytable[yyn];
+                *++yyvsp = yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yyssp);
+#endif
+                if (yyssp <= yyss) goto yyabort;
+                --yyssp;
+                --yyvsp;
+            }
+        }
+    }
+    else
+    {
+        if (yychar == 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys = 0;
+            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
+            if (!yys) yys = "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar = (-1);
+        goto yyloop;
+    }
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym = yylen[yyn];
+    yyval = yyvsp[1-yym];
+    switch (yyn)
+    {
+case 1:
+#line 97 "ncgen.y"
+{ init_netcdf(); }
+break;
+case 2:
+#line 100 "ncgen.y"
+{
+		       if (derror_count == 0)
+			 define_netcdf(netcdfname);
+		   }
+break;
+case 3:
+#line 106 "ncgen.y"
+{
+		       if (derror_count == 0)
+			 close_netcdf();
+		   }
+break;
+case 10:
+#line 121 "ncgen.y"
+{ if (int_val <= 0)
+			 derror("dimension length must be positive");
+		     dims[ndims].size = int_val;
+		     ndims++;
+		   }
+break;
+case 11:
+#line 127 "ncgen.y"
+{  if (rec_dim != -1)
+			 derror("only one NC_UNLIMITED dimension allowed");
+		     rec_dim = ndims; /* the unlimited (record) dimension */
+		     dims[ndims].size = NC_UNLIMITED;
+		     ndims++;
+		   }
+break;
+case 12:
+#line 135 "ncgen.y"
+{ if (yyvsp[0]->is_dim == 1) {
+		        derror( "duplicate dimension declaration for %s",
+		                yyvsp[0]->name);
+		     }
+	             yyvsp[0]->is_dim = 1;
+		     yyvsp[0]->dnum = ndims;
+		     /* make sure dims array will hold dimensions */
+		     grow_darray(ndims,  /* must hold ndims+1 dims */
+				 &dims); /* grow as needed */
+		     dims[ndims].name = (char *) emalloc(strlen(yyvsp[0]->name)+1);
+		     (void) strcpy(dims[ndims].name, yyvsp[0]->name);
+		     /* name for use in generated Fortran and C variables */
+		     dims[ndims].lname = decodify(yyvsp[0]->name);
+		   }
+break;
+case 25:
+#line 168 "ncgen.y"
+{ type_code = NC_BYTE; }
+break;
+case 26:
+#line 169 "ncgen.y"
+{ type_code = NC_CHAR; }
+break;
+case 27:
+#line 170 "ncgen.y"
+{ type_code = NC_SHORT; }
+break;
+case 28:
+#line 171 "ncgen.y"
+{ type_code = NC_INT; }
+break;
+case 29:
+#line 172 "ncgen.y"
+{ type_code = NC_FLOAT; }
+break;
+case 30:
+#line 173 "ncgen.y"
+{ type_code = NC_DOUBLE; }
+break;
+case 33:
+#line 179 "ncgen.y"
+{
+		    static struct vars dummyvar;
+
+		    dummyvar.name = "dummy";
+		    dummyvar.type = NC_DOUBLE;
+		    dummyvar.ndims = 0;
+		    dummyvar.dims = 0;
+		    dummyvar.fill_value.doublev = NC_FILL_DOUBLE;
+		    dummyvar.has_data = 0;
+
+		    nvdims = 0;
+		    /* make sure variable not re-declared */
+		    if (yyvsp[0]->is_var == 1) {
+		       derror( "duplicate variable declaration for %s",
+		               yyvsp[0]->name);
+		    }
+	            yyvsp[0]->is_var = 1;
+		    yyvsp[0]->vnum = nvars;
+		    /* make sure vars array will hold variables */
+		    grow_varray(nvars,  /* must hold nvars+1 vars */
+				&vars); /* grow as needed */
+		    vars[nvars] = dummyvar; /* to make Purify happy */
+		    vars[nvars].name = (char *) emalloc(strlen(yyvsp[0]->name)+1);
+		    (void) strcpy(vars[nvars].name, yyvsp[0]->name);
+		    /* name for use in generated Fortran and C variables */
+		    vars[nvars].lname = decodify(yyvsp[0]->name);
+		    vars[nvars].type = type_code;
+		    /* set default fill value.  You can override this with
+		     * the variable attribute "_FillValue". */
+		    nc_getfill(type_code, &vars[nvars].fill_value);
+		    vars[nvars].has_data = 0; /* has no data (yet) */
+		   }
+break;
+case 34:
+#line 212 "ncgen.y"
+{
+		    vars[nvars].ndims = nvdims;
+		    nvars++;
+		   }
+break;
+case 40:
+#line 226 "ncgen.y"
+{
+		    if (nvdims >= NC_MAX_VAR_DIMS) {
+		       derror("%s has too many dimensions",vars[nvars].name);
+		    }
+		    if (yyvsp[0]->is_dim == 1)
+		       dimnum = yyvsp[0]->dnum;
+		    else {
+		       derror( "%s is not declared as a dimension",
+			       yyvsp[0]->name);
+	               dimnum = ndims;
+		    }
+		    if (rec_dim != -1 && dimnum == rec_dim && nvdims != 0) {
+		       derror("unlimited dimension must be first");
+		    }
+		    grow_iarray(nvdims, /* must hold nvdims+1 ints */
+				&vars[nvars].dims); /* grow as needed */
+		    vars[nvars].dims[nvdims] = dimnum;
+                    nvdims++;
+		   }
+break;
+case 41:
+#line 247 "ncgen.y"
+{
+		       valnum = 0;
+		       valtype = NC_UNSPECIFIED;
+		       /* get a large block for attributes, realloc later */
+		       att_space = emalloc(MAX_NC_ATTSIZE);
+		       /* make all kinds of pointers point to it */
+		       char_valp = (char *) att_space;
+		       byte_valp = (signed char *) att_space;
+		       short_valp = (short *) att_space;
+		       int_valp = (int *) att_space;
+		       float_valp = (float *) att_space;
+		       double_valp = (double *) att_space;
+		   }
+break;
+case 42:
+#line 261 "ncgen.y"
+{
+		       {	/* check if duplicate attribute for this var */
+			   int i;
+			   for(i=0; i<natts; i++) { /* expensive */
+			       if(atts[i].var == varnum &&
+				  STREQ(atts[i].name,atts[natts].name)) {
+				   derror("duplicate attribute %s:%s",
+					  vars[varnum].name,atts[natts].name);
+			       }
+			   }
+		       }
+		       atts[natts].var = varnum ;
+		       atts[natts].type = valtype;
+		       atts[natts].len = valnum;
+		       /* shrink space down to what was really needed */
+		       att_space = erealloc(att_space, valnum*nctypesize(valtype));
+		       atts[natts].val = att_space;
+		       if (STREQ(atts[natts].name, _FillValue) &&
+			   atts[natts].var != NC_GLOBAL) {
+			   nc_putfill(atts[natts].type,
+				       atts[natts].val,
+				       &vars[atts[natts].var].fill_value);
+			   if(atts[natts].type != vars[atts[natts].var].type) {
+			       derror("variable %s: %s type mismatch",
+				      vars[atts[natts].var].name, _FillValue);
+			   }
+		       }
+		       natts++;
+		   }
+break;
+case 44:
+#line 293 "ncgen.y"
+{
+		    varnum = NC_GLOBAL;  /* handle of "global" attribute */
+		   }
+break;
+case 45:
+#line 299 "ncgen.y"
+{ if (yyvsp[0]->is_var == 1)
+		       varnum = yyvsp[0]->vnum;
+		    else {
+		      derror("%s not declared as a variable, fatal error",
+			     yyvsp[0]->name);
+		      YYABORT;
+		      }
+		   }
+break;
+case 46:
+#line 309 "ncgen.y"
+{
+		       /* make sure atts array will hold attributes */
+		       grow_aarray(natts,  /* must hold natts+1 atts */
+				   &atts); /* grow as needed */
+		       atts[natts].name = (char *) emalloc(strlen(yyvsp[0]->name)+1);
+		       (void) strcpy(atts[natts].name,yyvsp[0]->name);
+		       /* name for use in generated Fortran and C variables */
+		       atts[natts].lname = decodify(yyvsp[0]->name);
+		   }
+break;
+case 49:
+#line 323 "ncgen.y"
+{
+		    if (valtype == NC_UNSPECIFIED)
+		      valtype = atype_code;
+		    if (valtype != atype_code)
+		      derror("values for attribute must be all of same type");
+		   }
+break;
+case 50:
+#line 332 "ncgen.y"
+{
+		       atype_code = NC_CHAR;
+		       *char_valp++ = char_val;
+		       valnum++;
+		   }
+break;
+case 51:
+#line 338 "ncgen.y"
+{
+		       atype_code = NC_CHAR;
+		       {
+			   /* don't null-terminate attribute strings */
+			   size_t len = strlen(termstring);
+			   if (len == 0) /* need null if that's only value */
+			       len = 1;
+			   (void)strncpy(char_valp,termstring,len);
+			   valnum += len;
+			   char_valp += len;
+		       }
+		   }
+break;
+case 52:
+#line 351 "ncgen.y"
+{
+		       atype_code = NC_BYTE;
+		       *byte_valp++ = byte_val;
+		       valnum++;
+		   }
+break;
+case 53:
+#line 357 "ncgen.y"
+{
+		       atype_code = NC_SHORT;
+		       *short_valp++ = short_val;
+		       valnum++;
+		   }
+break;
+case 54:
+#line 363 "ncgen.y"
+{
+		       atype_code = NC_INT;
+		       *int_valp++ = int_val;
+		       valnum++;
+		   }
+break;
+case 55:
+#line 369 "ncgen.y"
+{
+		       atype_code = NC_FLOAT;
+		       *float_valp++ = float_val;
+		       valnum++;
+		   }
+break;
+case 56:
+#line 375 "ncgen.y"
+{
+		       atype_code = NC_DOUBLE;
+		       *double_valp++ = double_val;
+		       valnum++;
+		   }
+break;
+case 61:
+#line 390 "ncgen.y"
+{
+		       valtype = vars[varnum].type; /* variable type */
+		       valnum = 0;	/* values accumulated for variable */
+		       vars[varnum].has_data = 1;
+		       /* compute dimensions product */
+		       var_size = nctypesize(valtype);
+		       if (vars[varnum].ndims == 0) { /* scalar */
+			   var_len = 1;
+		       } else if (vars[varnum].dims[0] == rec_dim) {
+			   var_len = 1; /* one record for unlimited vars */
+		       } else {
+			   var_len = dims[vars[varnum].dims[0]].size;
+		       }
+		       for(dimnum = 1; dimnum < vars[varnum].ndims; dimnum++)
+			 var_len = var_len*dims[vars[varnum].dims[dimnum]].size;
+		       /* allocate memory for variable data */
+		       if (var_len*var_size != (size_t)(var_len*var_size)) {
+			   derror("variable %s too large for memory",
+				  vars[varnum].name);
+			   exit(9);
+		       }
+		       rec_len = var_len;
+		       rec_start = malloc ((size_t)(rec_len*var_size));
+		       if (rec_start == 0) {
+			   derror ("out of memory\n");
+			   exit(3);
+		       }
+		       rec_cur = rec_start;
+		       switch (valtype) {
+			 case NC_CHAR:
+			   char_valp = (char *) rec_start;
+			   break;
+			 case NC_BYTE:
+			   byte_valp = (signed char *) rec_start;
+			   break;
+			 case NC_SHORT:
+			   short_valp = (short *) rec_start;
+			   break;
+			 case NC_INT:
+			   int_valp = (int *) rec_start;
+			   break;
+			 case NC_FLOAT:
+			   float_valp = (float *) rec_start;
+			   break;
+			 case NC_DOUBLE:
+			   double_valp = (double *) rec_start;
+			   break;
+		       }
+		 }
+break;
+case 62:
+#line 440 "ncgen.y"
+{
+		       if (valnum < var_len) { /* leftovers */
+			   nc_fill(valtype,
+				    var_len - valnum,
+				    rec_cur,
+				    vars[varnum].fill_value);
+		       }
+		       /* put out var_len values */
+		       vars[varnum].nrecs = valnum / rec_len;
+		       if (derror_count == 0)
+			   put_variable(rec_start);
+		       free ((char *) rec_start);
+		 }
+break;
+case 65:
+#line 458 "ncgen.y"
+{
+		       if(valnum >= var_len) {
+			   if (vars[varnum].dims[0] != rec_dim) { /* not recvar */
+			       derror("too many values for this variable, %d >= %d",
+				      valnum, var_len);
+			       exit (4);
+			   } else { /* a record variable, so grow data
+				      container and increment var_len by
+				      multiple of record size */
+			       ptrdiff_t rec_inc = (char *)rec_cur
+				   - (char *)rec_start;
+			       var_len += rec_len * (1 + valnum - var_len)/rec_len;
+			       rec_start = erealloc(rec_start, var_len*var_size);
+			       rec_cur = (char *)rec_start + rec_inc;
+			       char_valp = (char *) rec_cur;
+			       byte_valp = (signed char *) rec_cur;
+			       short_valp = (short *) rec_cur;
+			       int_valp = (int *) rec_cur;
+			       float_valp = (float *) rec_cur;
+			       double_valp = (double *) rec_cur;
+			   }
+		       }
+		       not_a_string = 1;
+                   }
+break;
+case 66:
+#line 483 "ncgen.y"
+{
+		       if (not_a_string) {
+			   switch (valtype) {
+			     case NC_CHAR:
+			       rec_cur = (void *) char_valp;
+			       break;
+			     case NC_BYTE:
+			       rec_cur = (void *) byte_valp;
+			       break;
+			     case NC_SHORT:
+			       rec_cur = (void *) short_valp;
+			       break;
+			     case NC_INT:
+			       rec_cur = (void *) int_valp;
+			       break;
+			     case NC_FLOAT:
+			       rec_cur = (void *) float_valp;
+			       break;
+			     case NC_DOUBLE:
+			       rec_cur = (void *) double_valp;
+			       break;
+			   }
+		       }
+		   }
+break;
+case 67:
+#line 510 "ncgen.y"
+{
+		       atype_code = NC_CHAR;
+		       switch (valtype) {
+			 case NC_CHAR:
+			   *char_valp++ = char_val;
+			   break;
+			 case NC_BYTE:
+			   *byte_valp++ = char_val;
+			   break;
+			 case NC_SHORT:
+			   *short_valp++ = char_val;
+			   break;
+			 case NC_INT:
+			   *int_valp++ = char_val;
+			   break;
+			 case NC_FLOAT:
+			   *float_valp++ = char_val;
+			   break;
+			 case NC_DOUBLE:
+			   *double_valp++ = char_val;
+			   break;
+		       }
+		       valnum++;
+		   }
+break;
+case 68:
+#line 535 "ncgen.y"
+{
+		       not_a_string = 0;
+		       atype_code = NC_CHAR;
+		       {
+			   size_t len = strlen(termstring);
+
+			   if(valnum + len > var_len) {
+			       if (vars[varnum].dims[0] != rec_dim) {
+				   derror("too many values for this variable, %d>%d", 
+					  valnum+len, var_len);
+				   exit (5);
+			       } else {/* a record variable so grow it */
+				   ptrdiff_t rec_inc = (char *)rec_cur
+				       - (char *)rec_start;
+				   var_len += rec_len * (len + valnum - var_len)/rec_len;
+				   rec_start = erealloc(rec_start, var_len*var_size);
+				   rec_cur = (char *)rec_start + rec_inc;
+				   char_valp = (char *) rec_cur;
+			       }
+			   }
+			   switch (valtype) {
+			     case NC_CHAR:
+			       {
+				   int ld;
+				   size_t i, sl;
+				   (void)strncpy(char_valp,termstring,len);
+				   
+				   ld = vars[varnum].ndims-1;
+				   if (ld > 0) {/* null-fill to size of last dim */
+				       sl = dims[vars[varnum].dims[ld]].size;
+				       for (i =len;i<sl;i++)
+					   char_valp[i] = '\0';
+				       if (sl < len)
+					   sl = len;
+				       valnum += sl;
+				       char_valp += sl;
+				   } else { /* scalar or 1D strings */
+				       valnum += len;
+				       char_valp += len;
+				   }
+				   rec_cur = (void *) char_valp;
+			       }
+			       break;
+			     case NC_BYTE:
+			     case NC_SHORT:
+			     case NC_INT:
+			     case NC_FLOAT:
+			     case NC_DOUBLE:
+			       derror("string value invalid for %s variable",
+				      nctype(valtype));
+			       break;
+			   }
+		       }
+		   }
+break;
+case 69:
+#line 590 "ncgen.y"
+{
+		       atype_code = NC_BYTE;
+		       switch (valtype) {
+			 case NC_CHAR:
+			   *char_valp++ = byte_val;
+			   break;
+			 case NC_BYTE:
+			   *byte_valp++ = byte_val;
+			   break;
+			 case NC_SHORT:
+			   *short_valp++ = byte_val;
+			   break;
+			 case NC_INT:
+			   *int_valp++ = byte_val;
+			   break;
+			 case NC_FLOAT:
+			   *float_valp++ = byte_val;
+			   break;
+			 case NC_DOUBLE:
+			   *double_valp++ = byte_val;
+			   break;
+		       }
+		       valnum++;
+		   }
+break;
+case 70:
+#line 615 "ncgen.y"
+{
+		       atype_code = NC_SHORT;
+		       switch (valtype) {
+			 case NC_CHAR:
+			   *char_valp++ = short_val;
+			   break;
+			 case NC_BYTE:
+			   *byte_valp++ = short_val;
+			   break;
+			 case NC_SHORT:
+			   *short_valp++ = short_val;
+			   break;
+			 case NC_INT:
+			   *int_valp++ = short_val;
+			   break;
+			 case NC_FLOAT:
+			   *float_valp++ = short_val;
+			   break;
+			 case NC_DOUBLE:
+			   *double_valp++ = short_val;
+			   break;
+		       }
+		       valnum++;
+		   }
+break;
+case 71:
+#line 640 "ncgen.y"
+{
+		       atype_code = NC_INT;
+		       switch (valtype) {
+			 case NC_CHAR:
+			   *char_valp++ = int_val;
+			   break;
+			 case NC_BYTE:
+			   *byte_valp++ = int_val;
+			   break;
+			 case NC_SHORT:
+			   *short_valp++ = int_val;
+			   break;
+			 case NC_INT:
+			   *int_valp++ = int_val;
+			   break;
+			 case NC_FLOAT:
+			   *float_valp++ = int_val;
+			   break;
+			 case NC_DOUBLE:
+			   *double_valp++ = int_val;
+			   break;
+		       }
+		       valnum++;
+		   }
+break;
+case 72:
+#line 665 "ncgen.y"
+{
+		       atype_code = NC_FLOAT;
+		       switch (valtype) {
+			 case NC_CHAR:
+			   *char_valp++ = float_val;
+			   break;
+			 case NC_BYTE:
+			   *byte_valp++ = float_val;
+			   break;
+			 case NC_SHORT:
+			   *short_valp++ = float_val;
+			   break;
+			 case NC_INT:
+			   *int_valp++ = float_val;
+			   break;
+			 case NC_FLOAT:
+			   *float_valp++ = float_val;
+			   break;
+			 case NC_DOUBLE:
+			   *double_valp++ = float_val;
+			   break;
+		       }
+		       valnum++;
+		   }
+break;
+case 73:
+#line 690 "ncgen.y"
+{
+		       atype_code = NC_DOUBLE;
+		       switch (valtype) {
+			 case NC_CHAR:
+			   *char_valp++ = double_val;
+			   break;
+			 case NC_BYTE:
+			   *byte_valp++ = double_val;
+			   break;
+			 case NC_SHORT:
+			   *short_valp++ = double_val;
+			   break;
+			 case NC_INT:
+			   *int_valp++ = double_val;
+			   break;
+			 case NC_FLOAT:
+			   if (double_val == NC_FILL_DOUBLE)
+			     *float_valp++ = NC_FILL_FLOAT;
+			   else
+			     *float_valp++ = double_val;
+			   break;
+			 case NC_DOUBLE:
+			   *double_valp++ = double_val;
+			   break;
+		       }
+		       valnum++;
+		   }
+break;
+case 74:
+#line 718 "ncgen.y"
+{
+		       /* store fill_value */
+		       switch (valtype) {
+		       case NC_CHAR:
+			   nc_fill(valtype, 1, (void *)char_valp++,
+				   vars[varnum].fill_value);
+			   break;
+		       case NC_BYTE:
+			   nc_fill(valtype, 1, (void *)byte_valp++,
+				   vars[varnum].fill_value);
+			   break;
+		       case NC_SHORT:
+			   nc_fill(valtype, 1, (void *)short_valp++,
+				   vars[varnum].fill_value);
+			   break;
+		       case NC_INT:
+			   nc_fill(valtype, 1, (void *)int_valp++,
+				   vars[varnum].fill_value);
+			   break;
+		       case NC_FLOAT:
+			   nc_fill(valtype, 1, (void *)float_valp++,
+				   vars[varnum].fill_value);
+			   break;
+		       case NC_DOUBLE:
+			   nc_fill(valtype, 1, (void *)double_valp++,
+				   vars[varnum].fill_value);
+			   break;
+		       }
+		       valnum++;
+		   }
+break;
+#line 1248 "y.tab.c"
+    }
+    yyssp -= yym;
+    yystate = *yyssp;
+    yyvsp -= yym;
+    yym = yylhs[yyn];
+    if (yystate == 0 && yym == 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate = YYFINAL;
+        *++yyssp = YYFINAL;
+        *++yyvsp = yyval;
+        if (yychar < 0)
+        {
+            if ((yychar = yylex()) < 0) yychar = 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys = 0;
+                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
+                if (!yys) yys = "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar == 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
+            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
+        yystate = yytable[yyn];
+    else
+        yystate = yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yyssp, yystate);
+#endif
+    if (yyssp >= yysslim && yygrowstack())
+    {
+        goto yyoverflow;
+    }
+    *++yyssp = yystate;
+    *++yyvsp = yyval;
+    goto yyloop;
+yyoverflow:
+    yyerror("yacc stack overflow");
+yyabort:
+    return (1);
+yyaccept:
+    return (0);
+}
diff -Naur genesis/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.h genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.h
--- genesis/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.h	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/y.tab.h	Mon May 24 17:44:23 2004
@@ -0,0 +1,20 @@
+#define NC_UNLIMITED_K 257
+#define BYTE_K 258
+#define CHAR_K 259
+#define SHORT_K 260
+#define INT_K 261
+#define FLOAT_K 262
+#define DOUBLE_K 263
+#define IDENT 264
+#define TERMSTRING 265
+#define BYTE_CONST 266
+#define CHAR_CONST 267
+#define SHORT_CONST 268
+#define INT_CONST 269
+#define FLOAT_CONST 270
+#define DOUBLE_CONST 271
+#define DIMENSIONS 272
+#define VARIABLES 273
+#define NETCDF 274
+#define DATA 275
+#define FILLVALUE 276
diff -Naur genesis/src/kinetics/Makefile genesis2.2.1.Panther/src/kinetics/Makefile
--- genesis/src/kinetics/Makefile	Fri May 30 00:26:40 2003
+++ genesis2.2.1.Panther/src/kinetics/Makefile	Mon May 24 17:44:23 2004
@@ -85,7 +85,7 @@
 #
 # ============================================
 
-CFLAGS		= 	$(COPT) -D$(OS) -D$(MACHINE) $(DEC_HACK) 
+CFLAGS		= 	$(COPT) -D$(OS) -D$(MACHINE) -I$(XINCLUDE) $(DEC_HACK) 
 LIBRARY_NAME 	= 	kin
 STARTUP		=	kinlib.g
 STRUCTURES 	= 	kin_struct.h
diff -Naur genesis/src/kinetics/enz.c genesis2.2.1.Panther/src/kinetics/enz.c
--- genesis/src/kinetics/enz.c	Fri May 30 00:26:40 2003
+++ genesis2.2.1.Panther/src/kinetics/enz.c	Mon May 24 17:44:23 2004
@@ -32,11 +32,11 @@
  * */
 
 #include "kin_ext.h"
-#ifdef CHECK
+/* #ifdef CHECK
 #undef CHECK
 #define SIMPLE_SPRNG
 #include "sprng.h"
-#endif
+#endif */
 
 #ifdef __STDC__
 static int check_msg_type(struct enz_type *enz, MsgIn *msg);
@@ -136,7 +136,7 @@
 	if (minsub < KIN_STOCH_MOL_LIMIT ||
 					psub * enz->k3 * dt < KIN_STOCH_PROB_LIMIT)
 	{
-		rate = floor(rate) + (sprng() < (rate - floor(rate)));
+		rate = floor(rate) + (G_RNG()  < (rate - floor(rate)));
 
 		if (minsub < rate)
 			rate = floor(minsub);
@@ -201,7 +201,7 @@
 	if (nComplex < KIN_STOCH_MOL_LIMIT && 
 			(nComplex - floor(nComplex)) > 0) {
 		nComplex = floor(nComplex) +
-			(sprng() < (nComplex - floor(nComplex)));
+			(G_RNG() < (nComplex - floor(nComplex)));
 	}
 
 	sA = enz->k2 * nComplex * dt;
@@ -220,9 +220,9 @@
 					nComplex < KIN_STOCH_MOL_LIMIT ||
 					eA < KIN_STOCH_PROB_LIMIT)
 	{
-		B = floor(B) + (sprng() < (B - floor(B)));
-		sA = floor(sA) + (sprng() < (sA - floor(sA)));
-		pA = floor(pA) + (sprng() < (pA - floor(pA)));
+		B = floor(B) + (G_RNG()  < (B - floor(B)));
+		sA = floor(sA) + (G_RNG()  < (sA - floor(sA)));
+		pA = floor(pA) + (G_RNG()  < (pA - floor(pA)));
 
 		denz = B - sA - pA;
 
@@ -493,6 +493,7 @@
 			enz->vol = 1;
 			enz->oldmsgmode = 0;
 			enz->complex_stoch_flag = enz->sub_stoch_flag = 0;
+			return(1);
 		break;
 	}
 }
diff -Naur genesis/src/kinetics/file_info.c genesis2.2.1.Panther/src/kinetics/file_info.c
--- genesis/src/kinetics/file_info.c	Sat May 31 00:25:25 2003
+++ genesis2.2.1.Panther/src/kinetics/file_info.c	Mon May 24 17:44:23 2004
@@ -14,6 +14,18 @@
 #include <dirent.h>
 #include "sim_ext.h"
 
+/*
+ * Alphabetic order comparison routine for those who want it.
+ */
+int
+alphsort(d1, d2)
+	const void *d1;
+	const void *d2;
+{
+	return(strcmp((*(struct dirent **)d1)->d_name,
+	    (*(struct dirent **)d2)->d_name));
+}
+
 /* This file is for obtaining file information for GENESIS
 ** e.g., for directory listings and to check on status of a given file.
 */
@@ -48,7 +60,7 @@
 		printoptusage(argc,argv);
 		return (char**)(NULLArgv());
 	}
-	n = scandir(optargv[1], &namelist, 0, alphasort);
+	n = scandir(optargv[1], &namelist, 0, alphsort);
 	if (n <= 0)
 		return (char**)NULLArgv();
 	ret = (char **)malloc((1 + n) * sizeof(char *));
@@ -78,7 +90,7 @@
 		printoptusage(argc,argv);
 		return 0;
 	}
-	n = scandir(optargv[1], &namelist, 0, alphasort);
+	n = scandir(optargv[1], &namelist, 0, alphsort);
 	f = optargv[2];
 	len = strlen(f);
 
diff -Naur genesis/src/kinetics/gsolve.c genesis2.2.1.Panther/src/kinetics/gsolve.c
--- genesis/src/kinetics/gsolve.c	Sat May 31 00:25:25 2003
+++ genesis2.2.1.Panther/src/kinetics/gsolve.c	Mon May 24 17:44:23 2004
@@ -22,8 +22,8 @@
 #include "kin_ext.h"
 #include <math.h>
 #include <float.h>
-#define SIMPLE_SPRNG
-#include "sprng.h"
+/* #define SIMPLE_SPRNG
+#include "sprng.h" */
 #include "string.h"
 
 #define POOL_SUMTOTAL 0x01
@@ -271,7 +271,7 @@
   double prop_acc = 0.0;
   int i, j;
 
-  deviate_transition = sprng () * gsolve->propensity_total;
+  deviate_transition = G_RNG()  * gsolve->propensity_total;
   /* scale deviate to compare against propensity coeffs */
 		
   /*
@@ -335,7 +335,7 @@
     }
   }
   /* choose time and update current time */
-  transition_time = -1 * log (sprng ()) / gsolve->propensity_total;
+  transition_time = -1 * log (G_RNG()) / gsolve->propensity_total;
   gsolve->internal_time += transition_time;
 
   if (reac_chosen)
@@ -362,7 +362,7 @@
   for (i = 0; i < gsolve->reac_list->nelements; i++)
     {
       if (gsolve->propensity_reac[0][i]) {
-        time = -1 * log (sprng ()) / gsolve->propensity_reac[0][i];
+        time = -1 * log (G_RNG()) / gsolve->propensity_reac[0][i];
         if (time < minimum_time)
   	{
   	  minimum_time = time;
@@ -374,7 +374,7 @@
         time = DBL_MAX;
 
       if (gsolve->propensity_reac[1][i]) {
-        time = -1 * log (sprng ()) / gsolve->propensity_reac[1][i];
+        time = -1 * log (G_RNG()) / gsolve->propensity_reac[1][i];
         if (time < minimum_time)
   	{
   	  minimum_time = time;
@@ -389,7 +389,7 @@
   for (i = 0; i < gsolve->enz_list->nelements; i++)
     {
       if (gsolve->propensity_enz[0][i]) {
-        time = -1 * log (sprng ()) / gsolve->propensity_enz[0][i];
+        time = -1 * log (G_RNG()) / gsolve->propensity_enz[0][i];
         if (time < minimum_time)
   	{
   	  minimum_time = time;
@@ -401,7 +401,7 @@
         time = DBL_MAX;
 
       if (gsolve->propensity_enz[1][i]) {
-        time = -1 * log (sprng ()) / gsolve->propensity_enz[1][i];
+        time = -1 * log (G_RNG()) / gsolve->propensity_enz[1][i];
         if (time < minimum_time)
   	{
   	  minimum_time = time;
@@ -413,7 +413,7 @@
         time = DBL_MAX;
 
       if (gsolve->propensity_enz[2][i]) {
-        time = -1 * log (sprng ()) / gsolve->propensity_enz[2][i];
+        time = -1 * log (G_RNG()) / gsolve->propensity_enz[2][i];
         if (time < minimum_time)
   	{
   	  minimum_time = time;
@@ -649,7 +649,7 @@
 				+ transition_time);
 	  else
 	    pq_update(transition_pq_index[k],
-				-1 * log (sprng ()) / propensity_trans[k]
+				-1 * log (G_RNG()) / propensity_trans[k]
 				+ transition_time);
 	} else {
 	  // Do nothing. propensity should already be DBL_MAX
@@ -659,7 +659,7 @@
     else {
 		if (propensity_trans[k])
 	pq_update(transition_pq_index[k],
-		  -1 * log (sprng ()) / propensity_trans[k]
+		  -1 * log (G_RNG()) / propensity_trans[k]
 		  + transition_time);
 		else {
 	pq_update(transition_pq_index[k], DBL_MAX);
@@ -724,6 +724,7 @@
     case CREATE:
       /* gsolve_do_reset (gsolve); *//* Don't do this! */
       gsolve->sumtotal_list = NULL;
+      return(1);
       break;
     case SET:
       return (0);
@@ -838,7 +839,7 @@
         pool = (struct pool_type *) gsolve->pool_list->element[i];
 	    Block(pool);
         pool->n = floor(pool->nInit) +
-			(sprng() < (pool->nInit - floor(pool->nInit)));
+			(G_RNG()  < (pool->nInit - floor(pool->nInit)));
   
         data = pool->msgdata;
         data += pool->msgcount[0] + pool->msgcount[1] +
@@ -863,7 +864,7 @@
         enz = (struct enz_type *) gsolve->enz_list->element[i];
 	    Block(enz);
         enz->nComplex = floor(enz->nComplex) +
-			(sprng() < (enz->nComplex - floor(enz->nComplex)));
+			(G_RNG()  < (enz->nComplex - floor(enz->nComplex)));
       }
   }
     
@@ -1122,11 +1123,11 @@
     if (gsolve->reac_list_populated) {
       for (i = 0; i < gsolve->reac_list->nelements; i++) {
         if (propensity_trans[i*2])
-	  pq_insert((-1 * log (sprng ()) / propensity_trans[i*2]), i*2);
+	  pq_insert((-1 * log (G_RNG()) / propensity_trans[i*2]), i*2);
         else
 	  pq_insert(DBL_MAX, i*2);
         if (propensity_trans[1+i*2])
-	  pq_insert((-1 * log (sprng ()) / propensity_trans[1+i*2]), 1+i*2);
+	  pq_insert((-1 * log (G_RNG()) / propensity_trans[1+i*2]), 1+i*2);
         else
 	  pq_insert(DBL_MAX, 1+i*2);
       }
@@ -1134,15 +1135,15 @@
     if (gsolve->enz_list_populated) {
       for (i = 0; i < gsolve->enz_list->nelements; i++) {
         if (propensity_trans[1000+i*3])
-	  pq_insert((-1 * log (sprng ()) / propensity_trans[1000+i*3]), 1000+i*3);
+	  pq_insert((-1 * log (G_RNG()) / propensity_trans[1000+i*3]), 1000+i*3);
         else
 	  pq_insert(DBL_MAX, 1000+i*3);
         if (propensity_trans[1001+i*3])
-	  pq_insert((-1 * log (sprng ()) / propensity_trans[1001+i*3]), 1001+i*3);
+	  pq_insert((-1 * log (G_RNG()) / propensity_trans[1001+i*3]), 1001+i*3);
         else
 	  pq_insert(DBL_MAX, 1001+i*3);
         if (propensity_trans[1002+i*3])
-	  pq_insert((-1 * log (sprng ()) / propensity_trans[1002+i*3]), 1002+i*3);
+	  pq_insert((-1 * log (G_RNG()) / propensity_trans[1002+i*3]), 1002+i*3);
         else
 	  pq_insert(DBL_MAX, 1002+i*3);
       } 
diff -Naur genesis/src/kinetics/oenz.c genesis2.2.1.Panther/src/kinetics/oenz.c
--- genesis/src/kinetics/oenz.c	Fri May 30 20:07:56 2003
+++ genesis2.2.1.Panther/src/kinetics/oenz.c	Mon May 24 17:44:23 2004
@@ -32,11 +32,11 @@
  * */
 
 #include "kin_ext.h"
-#ifdef CHECK
+/* #ifdef CHECK
 #undef CHECK
 #define SIMPLE_SPRNG
 #include "sprng.h"
-#endif
+#endif */
 
 #ifdef __STDC__
 static int check_msg_type(struct enz_type *enz, MsgIn *msg);
@@ -433,6 +433,7 @@
 			enz->vol = 1;
 			enz->oldmsgmode = 0;
 			enz->complex_stoch_flag = enz->sub_stoch_flag = 0;
+			return(1);
 		break;
 	}
 }
diff -Naur genesis/src/kinetics/pool.c genesis2.2.1.Panther/src/kinetics/pool.c
--- genesis/src/kinetics/pool.c	Fri May 30 00:26:40 2003
+++ genesis2.2.1.Panther/src/kinetics/pool.c	Mon May 24 17:44:23 2004
@@ -51,11 +51,11 @@
 
 #include <sys/time.h>
 #include "kin_ext.h"
-#ifdef CHECK
+/* #ifdef CHECK
 #undef CHECK
 #define SIMPLE_SPRNG
 #include "sprng.h"
-#endif
+#endif */
 
 #ifdef __STDC__
 static int do_reset(struct pool_type *pool);
@@ -94,7 +94,7 @@
 
 	if (pool->stoch_flag && (pool->slave_enable & POOL_BUFFER)) {
 			pool->n = floor(pool->nInit) +
-					(sprng() < (pool->nInit - floor(pool->nInit)));
+					(G_RNG()  < (pool->nInit - floor(pool->nInit)));
 			pool->Co = (pool->vol > 0) ? pool->n/pool->vol : pool->n;
 	} else {
 		PoolProcess(pool, pool, &A, &B, &conserve, &sumtotal);
@@ -228,7 +228,7 @@
 	if (pool->stoch_flag && pool->n < KIN_STOCH_MOL_LIMIT &&
 					(pool->n - floor(pool->n)) > 0)
 			pool->n = floor(pool->n) +
-					(sprng() < (pool->n - floor(pool->n)));
+					(G_RNG()  < (pool->n - floor(pool->n)));
 	/* Convert the n's to Co's */
 	pool->nRemaining = pool->nTotal - pool->n;
 	pool->Co = pool->n / pool->vol;
@@ -260,7 +260,7 @@
 
 	if (pool->slave_enable & POOL_BUFFER)
 		pool->n = floor(pool->nInit) +
-					(sprng() < (pool->nInit - floor(pool->nInit)));
+					(G_RNG()  < (pool->nInit - floor(pool->nInit)));
 
 	pool->nRemaining = pool->nTotal - pool->n;
 	if (pool->vol > 0) {
@@ -302,6 +302,7 @@
 		pool->oldmsgmode = 0;
 		for (i = 0; i < KIN_POOL_MSGCOUNT; i++)
 			pool->msgcount[i] = 0;
+		return(1);
 	}
 	break;
     case SET :
@@ -628,7 +629,7 @@
 		/* Round up or down to an integral value, probabilistically */
 		if (pool->stoch_flag) {
 			pool->n = floor(pool->n) +
-					(sprng() < (pool->n - floor(pool->n)));
+					(G_RNG()  < (pool->n - floor(pool->n)));
 		}
 		/* redo the Co values that might have changed in the RESET */
 		pool->Co = pool->n / pool->vol;
diff -Naur genesis/src/kinetics/reac.c genesis2.2.1.Panther/src/kinetics/reac.c
--- genesis/src/kinetics/reac.c	Fri May 30 00:26:40 2003
+++ genesis2.2.1.Panther/src/kinetics/reac.c	Mon May 24 17:44:23 2004
@@ -29,12 +29,12 @@
  * */
 
 #include "kin_ext.h"
-#ifdef CHECK
+/* #ifdef CHECK
 #undef CHECK
 #define SIMPLE_SPRNG
 #include "sprng.h"
 #endif
-
+*/
 
 /*
 ** A reaction handling element. does the basic forward/backward
@@ -110,9 +110,9 @@
 	if (sf)
 	{ /* Use stoch calculations */
 		dn = ((int)substrate_rate) + 
-					(sprng() < (substrate_rate - (int)substrate_rate));
+					(G_RNG() < (substrate_rate - (int)substrate_rate));
 		dn -= ((int)product_rate) +
-					(sprng() < (product_rate - (int)product_rate));
+					(G_RNG()  < (product_rate - (int)product_rate));
 
 		/* Ensure we don't have negative molecule numbers */
 		if (floor(submin) < dn)
@@ -282,6 +282,7 @@
 			break;
 		case CREATE:
 			reac->oldmsgmode = 0;
+			return(1);
 			break;
 	}
 }
diff -Naur genesis/src/kinetics/text.c genesis2.2.1.Panther/src/kinetics/text.c
--- genesis/src/kinetics/text.c	Fri May 30 20:07:56 2003
+++ genesis2.2.1.Panther/src/kinetics/text.c	Mon May 24 17:44:23 2004
@@ -181,6 +181,7 @@
 		case CREATE:
 			text->str = calloc(TEXT_START_SIZE, sizeof(char));
 			text->len = TEXT_START_SIZE;
+			return(1);
 			break;
 	}
 }
diff -Naur genesis/src/param/param_defs.h genesis2.2.1.Panther/src/param/param_defs.h
--- genesis/src/param/param_defs.h	Wed Jun  7 07:30:50 2000
+++ genesis2.2.1.Panther/src/param/param_defs.h	Mon May 24 17:44:24 2004
@@ -97,12 +97,11 @@
  */
 
 #if defined (__GNUC__)
-  #if defined (PARAM_DEBUG)
-    #define DPRINTF(format, args...)  \
-      fprintf (stderr, format , ## args)
-  #else
-    #define DPRINTF(format, args...)
-  #endif
+#if defined (PARAM_DEBUG)
+#define DPRINTF(format, args...)  fprintf (stderr, format , ## args)
+#else
+#define DPRINTF(format, args...)
+#endif
 #else
 /* 2000-05-29 <mhucka@bbb.caltech.edu>
    Don't indent the following #define, or you will screw up the
diff -Naur genesis/src/shell/osxdarwin_param.h genesis2.2.1.Panther/src/shell/osxdarwin_param.h
--- genesis/src/shell/osxdarwin_param.h	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/shell/osxdarwin_param.h	Mon May 24 17:44:24 2004
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License").  You may not use this file except in compliance with the
+ * License.  Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
+ * 
+ * This Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */
+/*-
+ * Copyright (c) 1982, 1986, 1989, 1993
+ *      The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the University of
+ *      California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *      @(#)param.h     8.3 (Berkeley) 4/4/95
+ */
+
+#ifndef _SYS_PARAM_H_
+#define _SYS_PARAM_H_
+
+/* 
+ Some times Apple sucks, hard... <\o Alf+
+ */
+#ifndef BSD
+#define BSD     199506          /* System version (year & month). */
+#endif
+#define BSD4_3  1
+#define BSD4_4  1
+
+#define NeXTBSD 1995064         /* NeXTBSD version (year, month, release) */
+#define NeXTBSD4_0 0            /* NeXTBSD 4.0 */
+
+#ifndef NULL
+#define NULL    0
+#endif
+
+#ifndef LOCORE
+#include <sys/types.h>
+#endif
+
+/*
+ * Machine-independent constants (some used in following include files).
+ * Redefined constants are from POSIX 1003.1 limits file.
+ *
+ * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
+ * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
+ */
+#include <sys/syslimits.h>
+
+#define MAXCOMLEN       16              /* max command name remembered */
+#define MAXINTERP       64              /* max interpreter file name length */
+#define MAXLOGNAME      12              /* max login name length */
+#define MAXUPRC         CHILD_MAX       /* max simultaneous processes */
+#define NCARGS          ARG_MAX         /* max bytes for an exec function */
+#define NGROUPS         NGROUPS_MAX     /* max number groups */
+#define NOFILE          256             /* default max open files per process */
+#define NOGROUP         65535           /* marker for empty group set member */
+#define MAXHOSTNAMELEN  256             /* max hostname size */
+#define MAXDOMNAMELEN   256             /* maximum domain name length */
+
+/* Machine type dependent parameters. */
+#include <machine/param.h>
+#include <machine/limits.h>
+
+/* More types and definitions used throughout the kernel. */
+#ifdef KERNEL
+#include <sys/cdefs.h>
+#include <sys/errno.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/ucred.h>
+#include <sys/uio.h>
+#endif
+
+/* Signals. */
+#include <sys/signal.h>
+
+/*
+ * Priorities.  Note that with 32 run queues, differences less than 4 are
+ * insignificant.
+ */
+#define PSWP    0
+#define PVM     4
+#define PINOD   8
+#define PRIBIO  16
+#define PVFS    20
+#define PZERO   22              /* No longer magic, shouldn't be here.  XXX */
+#define PSOCK   24
+#define PWAIT   32
+#define PLOCK   36
+#define PPAUSE  40
+#define PUSER   50
+#define MAXPRI  127             /* Priorities range from 0 through MAXPRI. */
+
+#define PRIMASK 0x0ff
+#define PCATCH  0x100           /* OR'd with pri for tsleep to check signals */
+#define PTTYBLOCK 0x200         /* for tty SIGTTOU and SIGTTIN blocking */
+
+#define NZERO   0               /* default "nice" */
+
+#define NBPW    sizeof(int)     /* number of bytes per word (integer) */
+
+#define CMASK   022             /* default file mask: S_IWGRP|S_IWOTH */
+#define NODEV   (dev_t)(-1)     /* non-existent device */
+
+/*
+ * Clustering of hardware pages on machines with ridiculously small
+ * page sizes is done here.  The paging subsystem deals with units of
+ * CLSIZE pte's describing NBPG (from machine/param.h) pages each.
+ */
+#define CLBYTES         (CLSIZE*NBPG)
+#define CLOFSET         (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */
+#define claligned(x)    ((((int)(x))&CLOFSET)==0)
+#define CLOFF           CLOFSET
+#define CLSHIFT         (PGSHIFT+CLSIZELOG2)
+
+#if CLSIZE==1
+#define clbase(i)       (i)
+#define clrnd(i)        (i)
+#else
+/* Give the base virtual address (first of CLSIZE). */
+#define clbase(i)       ((i) &~ (CLSIZE-1))
+/* Round a number of clicks up to a whole cluster. */
+#define clrnd(i)        (((i) + (CLSIZE-1)) &~ (CLSIZE-1))
+#endif
+
+#define CBLOCK  64              /* Clist block size, must be a power of 2. */
+#define CBQSIZE (CBLOCK/NBBY)   /* Quote bytes/cblock - can do better. */
+                                /* Data chars/clist. */
+#define CBSIZE  (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
+#define CROUND  (CBLOCK - 1)    /* Clist rounding. */
+
+/*
+ * File system parameters and macros.
+ *
+ * The file system is made out of blocks of at most MAXBSIZE units, with
+ * smaller units (fragments) only in the last direct block.  MAXBSIZE
+ * primarily determines the size of buffers in the buffer pool.  It may be
+ * made larger without any effect on existing file systems; however making
+ * it smaller make make some file systems unmountable.
+ */
+#define MAXBSIZE        MAXPHYS
+#define MAXPHYSIO       MAXPHYS
+#define MAXFRAG         8
+
+/*
+ * MAXPATHLEN defines the longest permissable path length after expanding
+ * symbolic links. It is used to allocate a temporary buffer from the buffer
+ * pool in which to do the name expansion, hence should be a power of two,
+ * and must be less than or equal to MAXBSIZE.  MAXSYMLINKS defines the
+ * maximum number of symbolic links that may be expanded in a path name.
+ * It should be set high enough to allow all legitimate uses, but halt
+ * infinite loops reasonably quickly.
+ */
+#define MAXPATHLEN      PATH_MAX
+#define MAXSYMLINKS     32
+
+/* Bit map related macros. */
+#define setbit(a,i)     (((char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY))
+#define clrbit(a,i)     (((char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY)))
+#define isset(a,i)      (((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY)))
+#define isclr(a,i)      ((((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
+
+/* Macros for counting and rounding. */
+#ifndef howmany
+#define howmany(x, y)   (((x)+((y)-1))/(y))
+#endif
+#define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
+#define powerof2(x)     ((((x)-1)&(x))==0)
+
+/* Macros for min/max. */
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif /* MIN */
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif  /* MAX */
+
+/*
+ * Constants for setting the parameters of the kernel memory allocator.
+ *
+ * 2 ** MINBUCKET is the smallest unit of memory that will be
+ * allocated. It must be at least large enough to hold a pointer.
+ *
+ * Units of memory less or equal to MAXALLOCSAVE will permanently
+ * allocate physical memory; requests for these size pieces of
+ * memory are quite fast. Allocations greater than MAXALLOCSAVE must
+ * always allocate and free physical memory; requests for these
+ * size allocations should be done infrequently as they will be slow.
+ *
+ * Constraints: CLBYTES <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and
+ * MAXALLOCSIZE must be a power of two.
+ */
+#define MINBUCKET       4               /* 4 => min allocation of 16 bytes */
+#define MAXALLOCSAVE    (2 * CLBYTES)
+
+/*
+ * Scale factor for scaled integers used to count %cpu time and load avgs.
+ *
+ * The number of CPU `tick's that map to a unique `%age' can be expressed
+ * by the formula (1 / (2 ^ (FSHIFT - 11))).  The maximum load average that
+ * can be calculated (assuming 32 bits) can be closely approximated using
+ * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
+ *
+ * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
+ * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
+ */
+#define FSHIFT  11              /* bits to right of fixed binary point */
+#define FSCALE  (1<<FSHIFT)
+
+#endif  /* _SYS_PARAM_H_ */
diff -Naur genesis/src/shell/result.h genesis2.2.1.Panther/src/shell/result.h
--- genesis/src/shell/result.h	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/shell/result.h	Mon May 24 17:44:24 2004
@@ -0,0 +1,49 @@
+/*
+** $Id: result.h,v 1.3 2001/05/09 14:55:29 mhucka Exp $
+** $Log: result.h,v $
+** Revision 1.3  2001/05/09 14:55:29  mhucka
+** Portability fix for AIX.
+**
+** Revision 1.2  2001/04/25 17:17:04  mhucka
+** Misc. small changes to improve portability and address compiler warnings.
+**
+** Revision 1.1  1992/12/11 19:05:10  dhb
+** Initial revision
+**
+*/
+
+#ifndef RESULT_H
+#define RESULT_H
+
+#ifdef aix
+/* AIX defines this in /usr/include/reloc.h.  Bad AIX, bad.  No biscuit.  */
+#undef r_type
+#endif
+
+/*
+** Result structures used in script expression evaluations
+*/
+
+typedef struct _localval
+  {
+    short	l_type;
+    short	l_offs;
+  } LocalVal;
+
+typedef union _resultvalue
+  {
+    int		r_int;
+    double	r_float;
+    char	*r_str;
+    LocalVal	r_loc;
+  }ResultValue;
+
+typedef struct _result
+  {
+    int		r_type;
+    ResultValue	r;
+  } Result;
+
+
+
+#endif
diff -Naur genesis/src/shell/shell.h genesis2.2.1.Panther/src/shell/shell.h
--- genesis/src/shell/shell.h	Thu Apr 19 00:39:37 2001
+++ genesis2.2.1.Panther/src/shell/shell.h	Mon May 24 17:44:24 2004
@@ -14,7 +14,13 @@
 
 #include <stdio.h>
 #include <math.h>
+
+#ifdef __APPLE__
+#include "osxdarwin_param.h"
+#else
 #include <sys/param.h>
+#endif
+
 #include <unistd.h>
 #include "header.h"
 #include "hash.h"
diff -Naur genesis/src/shell/shell_convert.c genesis2.2.1.Panther/src/shell/shell_convert.c
--- genesis/src/shell/shell_convert.c	Wed Apr 25 19:17:00 2001
+++ genesis2.2.1.Panther/src/shell/shell_convert.c	Mon May 24 17:44:24 2004
@@ -61,7 +61,7 @@
 	return(0.0);
 }
 
-#if !defined(mips) && !defined(Linux) && !defined(__FreeBSD__)
+#if !defined(mips) && !defined(Linux) && !defined(__FreeBSD__) && !defined(__APPLE__)
 char tolower(c) 
 char	c;
 {
diff -Naur genesis/src/shell/shell_edit.c genesis2.2.1.Panther/src/shell/shell_edit.c
--- genesis/src/shell/shell_edit.c	Fri Jun 29 23:23:19 2001
+++ genesis2.2.1.Panther/src/shell/shell_edit.c	Mon May 24 17:44:24 2004
@@ -54,7 +54,7 @@
 	}
     }
 #else
-    if ((tmpname = mktemp(template)) == NULL
+    if ((tmpname = (char *)mktemp(template)) == NULL
 	|| (fp = fopen(tmpname,"w")) == NULL) {
 	printf("cannot make temporary file\n");
 	return(NULL);
diff -Naur genesis/src/shell/shell_error.c genesis2.2.1.Panther/src/shell/shell_error.c
--- genesis/src/shell/shell_error.c	Wed Apr 25 19:17:00 2001
+++ genesis2.2.1.Panther/src/shell/shell_error.c	Mon May 24 17:44:24 2004
@@ -17,7 +17,11 @@
 **
 */
 
-#include "header.h"
+/* Modified by Alfonso Delgado-Reyes Nov 2002 : Mac OS X 10.2.x
+** #include "header.h"
+** Included bellow... ("shell_ext.h")
+*/
+
 #include "shell_ext.h"
 #include "sim_func_ext.h"
 #include "ss_func_ext.h"
diff -Naur genesis/src/shell/shell_func_ext.h genesis2.2.1.Panther/src/shell/shell_func_ext.h
--- genesis/src/shell/shell_func_ext.h	Fri Mar 28 22:10:46 2003
+++ genesis2.2.1.Panther/src/shell/shell_func_ext.h	Mon May 24 17:44:24 2004
@@ -173,8 +173,8 @@
 extern int      LogHeader();
 extern int      LogTime();
 extern int      LogTrailer();
-extern int      lprintf();
-extern int      lprint_only();
+extern int      lprintf(char*, ... );
+extern int      lprint_only(char*, ... );
 extern int      NestedLevel();
 extern Script  *NextScript();
 extern Script  *NextScript();
diff -Naur genesis/src/shell/shell_func_ext.h.orig genesis2.2.1.Panther/src/shell/shell_func_ext.h.orig
--- genesis/src/shell/shell_func_ext.h.orig	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/shell/shell_func_ext.h.orig	Mon May 24 17:44:24 2004
@@ -0,0 +1,244 @@
+/*
+** $Id: shell_func_ext.h,v 1.11 2003/03/28 21:10:46 gen-dbeeman Exp $
+** $Log: shell_func_ext.h,v $
+** Revision 1.11  2003/03/28 21:10:46  gen-dbeeman
+** Changes from Hugo Cornelis to enable debugging commands gctrace and gftrace
+**
+** Revision 1.10  2001/06/29 21:24:17  mhucka
+** Lots of additions, and a reorganization.
+**
+** Revision 1.9  2001/04/25 17:17:00  mhucka
+** Misc. small changes to improve portability and address compiler warnings.
+**
+** Revision 1.8  2000/09/21 19:38:20  mhucka
+** Added declarations for a few more functions.
+**
+** Revision 1.7  2000/09/07 05:15:58  mhucka
+** Added declaration for Autoshell() and new function SetAutoShell().
+**
+** Revision 1.6  2000/05/19 18:40:05  mhucka
+** Added declaration for SearchForNonScript.
+**
+** Revision 1.5  2000/03/27 10:33:07  mhucka
+** Commented out statusline functionality, because it caused GENESIS to send
+** control character sequences upon exit and thereby screw up the user's
+** terminal.  Also added return type declarations for various things.
+**
+** Revision 1.4  1999/08/22 04:42:15  mhucka
+** Various fixes, mostly for Red Hat Linux 6.0
+**
+** Revision 1.3  1995/02/22 19:12:58  dhb
+** Added GetHistory() extern statement.
+**
+** Revision 1.2  1994/04/14  16:22:29  dhb
+** Added PFI GetFuncAddress() to extern declarations.
+**
+** Revision 1.1  1992/12/11  19:04:53  dhb
+** Initial revision
+**
+*/
+
+#ifndef SHELL_FUNC_EXT_H
+#define SHELL_FUNC_EXT_H
+
+#include <stdlib.h>
+#include <string.h>
+#include "result.h"
+#include "shell_struct.h"
+
+/*
+** PFI is defined in header.h, but some places where PFI is needed can't
+** include header.h without a lot of trouble.  So, define it here if needed.
+*/
+#ifndef PFI_DEFINED
+#define PFI_DEFINED
+typedef int	(*PFI)();
+#endif
+
+#include <string.h>
+
+/*
+** Tracing of commands and functions
+*/
+
+int GetCommandTraceLevel(void);
+int SetCommandTraceLevel(int iLevel);
+
+extern int      AddCleanup();
+extern void     AddFunc();
+extern int      AddHistory();
+extern int      AddJob();
+extern int      AddScript();
+extern int      AlternatePrompt();
+extern char    *ArgListToString();
+extern double   Atod();
+extern float    Atof();
+extern int      Autoshell();
+extern int      AuxFuncIndex();
+extern int      AvailableCharacters();
+extern int      cleareol();
+extern int      ClearScriptStack();
+extern int      CloseLog();
+extern char   **CopyArgv();
+extern char    *CopyString();
+extern Script  *CurrentScript();
+extern FILE    *CurrentScriptFp();
+extern int      CurrentScriptLine();
+extern int      CurrentScriptLine();
+extern char    *CurrentScriptName();
+extern int      DefaultPrompt();
+extern int      DisableStatusLine();
+extern void     do_add_func();
+extern void     do_autoshell();
+extern int      do_cd();
+extern int      do_debug();
+extern int      do_debug_func();
+extern void     do_echo();
+extern void     do_execute();
+extern void     do_exit();
+extern char    *do_getenv();
+extern void     do_getinfo();
+extern void     do_load_func();
+extern void     do_load_lib();
+extern int      do_logoff();
+extern int      do_mkdir();
+extern void     do_printargs();
+extern void     do_printenv();
+extern void     do_return();
+extern void     do_return();
+extern void     do_setenv();
+extern void     do_set_prompt();
+extern void     do_shell();
+extern int      do_silent();
+extern void     do_source();
+extern int      do_status_message();
+extern void     do_where();
+extern int      Dynamic();
+extern int      EmptyLine();
+extern int      EmptyString();
+extern int      EnableDynamicLoad();
+extern int      EnableHistory();
+extern int      EnableScrollRegion();
+extern int      EnableStatusLine();
+extern void     EndScript();
+extern void     EndScript();
+extern void     Error();
+extern int      ExecuteCleanups();
+extern Result   ExecuteCommand();
+extern int      ExecuteJobs();
+extern void     FreeArgv();
+extern void     FreeArgv();
+extern void     FreeString();
+extern char    *ftoa();
+extern int      FuncIndex();
+extern int      genesis_tty();
+extern char    *getenv();
+extern PFI      GetFuncAddress();
+extern char    *GetFuncName();
+extern char*    GetHistory();
+extern int      GetInfo();
+extern int      GetLine();
+extern char    *GetLineFp();
+extern int      HashFunc();
+extern void     HashInit();
+extern char    *History();
+extern int      HistoryCnt();
+extern int      IncludeScript();
+extern int      inc_prompt();
+extern void     InitJobs();
+extern int      Interpreter();
+extern int      is_alpha();
+extern int      is_alphanum();
+extern int      IsBatchMode();
+extern int      IsBatchMode();
+extern int      IsCommand();
+extern int      is_data_char();
+extern int      is_eol_char();
+extern int      IsFile();
+extern int      IsHistoryEnabled();
+extern int      IsInclude();
+extern int      is_index_delimiter();
+extern int      is_num();
+extern int      IsSilent();
+extern int      is_space_char();
+extern int      is_str_delimiter();
+extern int      IsStringDelimiter();
+extern int      IsStringEnd();
+extern int      is_str_var_delimiter();
+extern int      IsTtyMode();
+extern int      is_var_char();
+extern int      IsWhiteSpace();
+extern char    *itoa();
+extern int      LoadFuncInit();
+extern int      LogHeader();
+extern int      LogTime();
+extern int      LogTrailer();
+extern int      lprintf();
+extern int      lprint_only();
+extern int      NestedLevel();
+extern Script  *NextScript();
+extern Script  *NextScript();
+extern int      normal_tty();
+extern char   **NULLArgv();
+extern int      OpenLog();
+extern FILE    *OpenScriptFile();
+extern int      ParseInit();
+extern int      ProcessStatus();
+extern int      PutAuxFunc();
+extern float    rangauss();
+extern void     ReallocateArgList();
+extern int      RecordStartTime();
+extern int      RemoveCleanup();
+extern int      RemoveJob();
+extern void     ResetErrors();
+extern int      RestoreCursorPosition();
+extern int      restore_tty();
+extern int      SaneTerm();
+extern int      SaveCursorPosition();
+extern int      ScriptArgc();
+extern char    *ScriptArgv();
+extern int      ScriptDepth();
+extern int      ScriptEnded();
+extern int      ScrollRegion();
+extern FILE    *SearchForExecutable();
+extern FILE    *SearchForNonScript();
+extern FILE    *SearchForScript();
+extern void     SetAutoshell();
+extern void     SetBatchMode();
+extern int      SetDefaultPrompt();
+extern int      SetPrompt();
+extern int      SetScript();
+extern int      SetSilent(); 
+extern void     SetTtyMode();
+extern int      SetUpFuncTable();
+extern int      SetupInterp();
+extern char    *sgets();
+extern void     ShowFuncNames();
+extern void     ShowHistory();
+extern int      show_prompt();
+extern int      Sleep();
+extern int      Standout();
+extern int      StatusActive();
+extern void     StringToArgList();
+extern char    *StripCR();
+extern int      TermGoto();
+extern int      terminal_setup();
+extern int      TermParse();
+extern char    *termstr();
+extern int      TraceScript();
+extern void     tset();
+extern int      ValidScript();
+extern void     Warning();
+
+/* 1999-07-16 <mhucka@bbb.caltech.edu>
+ * This fix for Red Hat Linux 6.0 is courtesy of Mike Vanier
+ * <mvanier@bbb.caltech.edu>.  
+ */
+#ifdef linux
+extern char     *strchr __P ((__const char *__s, int __c));
+#else
+extern char	*strchr();
+#endif
+
+
+#endif /* SHELL_FUNC_EXT_H */
diff -Naur genesis/src/shell/shell_log.c genesis2.2.1.Panther/src/shell/shell_log.c
--- genesis/src/shell/shell_log.c	Wed Apr 25 19:17:00 2001
+++ genesis2.2.1.Panther/src/shell/shell_log.c	Mon May 24 17:44:24 2004
@@ -25,9 +25,14 @@
 /* mds3 changes */
 /* Changed various 'printf/fprintf' statements to 'vprintf/vfprintf' */
 #include <stdio.h>
-#include <varargs.h>
+#include <stdarg.h>
 #include <time.h>
-#include "header.h"
+
+/* Modified by Alfonso Delgado-Reyes Nov 2002 : Mac OS X 10.2.x
+** #include "header.h"
+** Included bellow... ("shell_ext.h")
+*/
+
 #include "shell_ext.h"
 
 typedef struct {
@@ -122,9 +127,7 @@
     }
 }
 
-lprintf(com,va_alist)
-char *com;
-va_dcl
+lprintf(char *com, ... )
 {
 va_list ap;
 
@@ -134,7 +137,7 @@
 char	*ptr;
 int	nargs;
 
-    va_start(ap);
+    va_start(ap,com);
     /*
     ** determine the number of arguments based on the format string
     */
@@ -152,7 +155,7 @@
     */
 /* mds3 changes */
 /*  printf(com,va_alist); */
-    va_start(ap);
+    va_start(ap,com);
     vprintf(com,ap);
     /*
     ** is logging selected
@@ -164,14 +167,12 @@
 	*/
 /* mds3 changes */
 /*  	fprintf(logfp,com,va_alist); */
-	va_start(ap);
+	va_start(ap,com);
 	vfprintf(logfp,com,ap);
     }
 }
 
-lprint_only(com,va_alist)
-     char *com;
-     va_dcl
+lprint_only(char *com, ... )
 {
 /* mds3 changes */
 /* Added single line below */
@@ -183,7 +184,7 @@
      */
 /* mds3 changes */
 /*    fprintf(logfp,com,va_alist); */
-    va_start(ap);
+    va_start(ap,com);
     vfprintf(logfp,com,ap);
   }
 }
diff -Naur genesis/src/shell/shell_status.c genesis2.2.1.Panther/src/shell/shell_status.c
--- genesis/src/shell/shell_status.c	Wed Apr 25 19:17:00 2001
+++ genesis2.2.1.Panther/src/shell/shell_status.c	Mon May 24 17:44:24 2004
@@ -21,6 +21,8 @@
 **
 */
 
+// TEMPORARY!
+#if !defined(__APPLE__)
 #include <time.h>
 #include "header.h"
 #include "sim_func_ext.h"
@@ -85,4 +87,8 @@
     printf("\n%s\n",string);
 #endif /* STATUSLINE */
 }
+#else 
+RecordStartTime() {;}
+ProcessStatus() {;}
+#endif /* __APPLE__ */
 
diff -Naur genesis/src/shell/shell_tty.c genesis2.2.1.Panther/src/shell/shell_tty.c
--- genesis/src/shell/shell_tty.c	Fri Jun 29 23:26:40 2001
+++ genesis2.2.1.Panther/src/shell/shell_tty.c	Mon May 24 17:44:24 2004
@@ -116,11 +116,14 @@
 #include <termios.h>
 #include <curses.h>
 #include <term.h>
+#elif defined(__APPLE__)
+#include <termios.h>
+#include <curses.h>
 #else
 #include <termio.h>
 #endif
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
 struct termios old_tty_stdin, old_tty_stdout, new_tty_stdin, new_tty_stdout;
 #else
 struct termio old_tty_stdin, old_tty_stdout, new_tty_stdin, new_tty_stdout;
@@ -439,7 +442,7 @@
      * reset the terminal parameters to their original state
      */
 #ifdef TERMIO
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
     tcsetattr(fileno(stdin), TCSANOW, &old_tty_stdin);
     tcsetattr(fileno(stdout), TCSANOW, &old_tty_stdout);
 #else
@@ -485,7 +488,7 @@
      * save the old terminal parameters
      */
 #ifdef TERMIO
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
     tcgetattr(fileno(stdin), &old_tty_stdin);
     tcgetattr(fileno(stdout), &old_tty_stdout);
 #else
@@ -651,7 +654,7 @@
     /*
      * set the new parameters
      */
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
     tcsetattr(fileno(stdin), TCSANOW, &new_tty_stdin);
 #else
     ioctl(fileno(stdin), TCSETA, &new_tty_stdin);
diff -Naur genesis/src/sim/sim_base.c genesis2.2.1.Panther/src/sim/sim_base.c
--- genesis/src/sim/sim_base.c	Wed Apr 25 19:17:01 2001
+++ genesis2.2.1.Panther/src/sim/sim_base.c	Mon May 24 17:44:24 2004
@@ -45,7 +45,7 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <unistd.h>
-#if !defined(Solaris) && !defined(hpux)
+#if !defined(Solaris) && !defined(hpux) && !defined(MacOSXDarwin)
 #include <a.out.h>
 #endif
 #include "sim_ext.h"
diff -Naur genesis/src/sprng/Makefile genesis2.2.1.Panther/src/sprng/Makefile
--- genesis/src/sprng/Makefile	Sun Jul 22 19:50:04 2001
+++ genesis2.2.1.Panther/src/sprng/Makefile	Mon May 24 17:44:24 2004
@@ -28,37 +28,38 @@
 DIRS 		= 	SRC EXAMPLES TESTS lib
 SRCDIR 		= 	SRC
 PLAT		= 	$(MACHINE)
+SPRNGLIBS 	= 	$(SPRNG_LIB)
 
-include $(SRCDIR)/make.$(MACHINE)
+include $(SRCDIR)/make.$(PLAT)
 
 # 
 # Basic targets and rules.
 # 
 
-all: src
+all: source
 
 #---------------------------------------------------------------------------
-src:
-	(LIB=$(LIB_DIR); export LIB; cd SRC; $(MAKE) CC="$(CC)" CFLAGS_IN="$(CFLAGS_IN)" SPRNG_LIB="$(SPRNG_LIB)" LIB_DIR='$$(LIB)' PLAT=$(PLAT); cd ..)
+source:
+	(LIB=$(LIB_DIR); export LIB; cd SRC; $(MAKE) CC="$(CC)" CFLAGS_IN="$(CFLAGS_IN)" SPRNGLIBS="$(SPRNG_LIB)" LIB_DIR='$$(LIB)' PLAT=$(PLAT); cd ..)
 
 examples: 
-	(LIB=$(LIB_DIR); export LIB; cd EXAMPLES; $(MAKE) CC="$(CC)" CFLAGS_IN="$(CFLAGS_IN)" SPRNG_LIB="$(SPRNG_LIB)" LIB_DIR='$$(LIB)' PLAT=$(PLAT); cd ..)
+	(LIB=$(LIB_DIR); export LIB; cd EXAMPLES; $(MAKE) CC="$(CC)" CFLAGS_IN="$(CFLAGS_IN)" SPRNGLIBS="$(SPRNG_LIB)" LIB_DIR='$$(LIB)' PLAT=$(PLAT); cd ..)
 
 tests: 
-	(LIB=$(LIB_DIR); export LIB; cd TESTS; $(MAKE) CC="$(CC)" CFLAGS_IN="$(CFLAGS_IN)" SPRNG_LIB="$(SPRNG_LIB)" LIB_DIR='$$(LIB)' PLAT=$(PLAT); cd ..)
+	(LIB=$(LIB_DIR); export LIB; cd TESTS; $(MAKE) CC="$(CC)" CFLAGS_IN="$(CFLAGS_IN)" SPRNGLIBS="$(SPRNG_LIB)" LIB_DIR='$$(LIB)' PLAT=$(PLAT); cd ..)
 
 #---------------------------------------------------------------------------
 clean:
 	@for l in $(DIRS) ; do \
 	  cd $$l ; \
-	  $(MAKE) PLAT=$(PLAT) LIB_DIR='$$(LIB)' SPRNG_LIB="$(SPRNG_LIB)" clean ; \
+	  $(MAKE) PLAT=$(PLAT) LIB_DIR='$$(LIB)' SPRNGLIBS="$(SPRNG_LIB)" clean ; \
 	  cd .. ; \
         done
 
 realclean:
 	@for l in $(DIRS) ; do \
 	  cd $$l ; \
-	  $(MAKE) PLAT=$(PLAT) LIB_DIR='$$(LIB)' SPRNG_LIB="$(SPRNG_LIB)" realclean ; \
+	  $(MAKE) PLAT=$(PLAT) LIB_DIR='$$(LIB)' SPRNGLIBS="$(SPRNG_LIB)" realclean ; \
 	  cd .. ; \
         done
 	@rm -f core *~ check* time* *.data
diff -Naur genesis/src/sprng/SRC/make.MacOSXDarwin genesis2.2.1.Panther/src/sprng/SRC/make.MacOSXDarwin
--- genesis/src/sprng/SRC/make.MacOSXDarwin	Thu Jan  1 01:00:00 1970
+++ genesis2.2.1.Panther/src/sprng/SRC/make.MacOSXDarwin	Mon May 24 17:44:24 2004
@@ -0,0 +1,38 @@
+AR = ar
+ARFLAGS = cr
+#If your system does not have ranlib, then replace next statement with 
+#RANLIB = echo
+RANLIB = ranlib
+CC = cc
+CLD = $(CC)
+# Set f77 to echo if you do not have a FORTRAN compiler
+#F77 = g77
+F77 = echo
+F77LD = $(F77)
+FFXN = -DAdd__
+FSUFFIX = F
+
+MPIF77 = $(F77) 
+MPICC = $(CC)
+PLAT = $(MACHINE)
+
+# To use MPI, set the MPIDIR to location of mpi library, and MPILIB 
+# to name of mpi library. Remove # signs from beginning of next 3 lines.
+# Also, if the previous compilation was without MPI, type: make realclean
+# before compiling for mpi.
+#
+MPIDEF =  
+#MPIDEF = -DSPRNG_MPI #Only if you plan to use MPI
+#MPIDIR = -L/usr/local/mpi/lib/LINUX/ch_p4
+#MPILIB = -lmpi
+
+# Please include mpi header file path, if needed
+
+CFLAGS = -I/usr/include -O3 -DBigEndian $(MPIDEF) -D$(PLAT)
+# -I/usr/local/mpi/include
+CLDFLAGS =  -O3 
+FFLAGS = -O3 $(MPIDEF) -D$(PLAT)
+# -I/usr/local/mpi/include
+F77LDFLAGS =  -O3 
+
+CPP = /usr/libexec/gcc/darwin/`/usr/bin/arch`/default/cpp -I/usr/include -traditional -D__STDC__ -P 
diff -Naur genesis/src/sprng/make.CHOICES genesis2.2.1.Panther/src/sprng/make.CHOICES
--- genesis/src/sprng/make.CHOICES	Thu May 10 18:08:57 2001
+++ genesis2.2.1.Panther/src/sprng/make.CHOICES	Mon May 24 17:44:24 2004
@@ -24,14 +24,15 @@
 #PLAT = hpux
 #PLAT = Linux
 #PLAT = LinuxPPC
+#PLAT = MacOSXDarwin
 #PLAT = O2K
-#PLAT  = irix
+#PLAT = irix
 #PLAT = Solaris
 #PLAT = SP2		# IBM SP2
 #PLAT = sun4
-# For T3D, Use PLAT=T3E instead
-#PLAT =  t3e
-#PLAT  = GENERIC
+# For T3D, Use PLAT = T3E instead
+#PLAT = t3e
+#PLAT = GENERIC
 
 LIB_REL_DIR = lib
 
diff -Naur genesis/src/ss/parse.c genesis2.2.1.Panther/src/ss/parse.c
--- genesis/src/ss/parse.c	Fri May 30 00:34:11 2003
+++ genesis2.2.1.Panther/src/ss/parse.c	Mon May 24 17:44:24 2004
@@ -74,13 +74,12 @@
 }	/* PTNew */
 
 
-PTFree(pn)
+int PTFree(pn)
 
 ParseNode	*pn;
 
 {	/* PTFree --- Free an entire parse tree given root */
 
-        int PTFree();
 
 	if (pn != NULL)
 	  {
diff -Naur genesis/src/sys/Makefile genesis2.2.1.Panther/src/sys/Makefile
--- genesis/src/sys/Makefile	Wed Apr 25 19:17:04 2001
+++ genesis2.2.1.Panther/src/sys/Makefile	Mon May 24 17:44:23 2004
@@ -82,7 +82,7 @@
 #
 # makefile for utillib.o
 #
-LIBS 		=  	-lm 
+LIBS 		=  	-lm
 CFLAGS 		= 	$(COPT) -D$(OS) -D$(MACHINE) $(DEC_HACK)
 SH  		= 	../shell
 SS  		= 	../ss
@@ -115,8 +115,13 @@
 	     ../shell/shelllib-codeg.$(LIBEXT) \
 	     utillib.$(LIBEXT)
 
+ifeq (,$(findstring MacOSXDarwin, $(MAKEFLAGS)))
 code_g: $(CODE_G_OBJ)
-	$(CC) $(CFLAGS) $(CODE_G_OBJ) $(LEXLIB) $(TERMCAP) -lm  -o code_g
+	$(CC) $(CFLAGS) $(CODE_G_OBJ) $(LEXLIB) $(TERMCAP) -lm -lc -flat_namespace -o code_g
+else
+code_g: $(CODE_G_OBJ)
+        $(CC) $(CFLAGS) $(CODE_G_OBJ) $(LEXLIB) $(TERMCAP) -lm  -o code_g
+endif
 
 .SUFFIXES: .c,v .c .h,v .h
 
diff -Naur genesis/src/sys/code_lib.c genesis2.2.1.Panther/src/sys/code_lib.c
--- genesis/src/sys/code_lib.c	Wed Apr 25 19:17:04 2001
+++ genesis2.2.1.Panther/src/sys/code_lib.c	Mon May 24 17:44:23 2004
@@ -64,7 +64,11 @@
    ** get the current date
    */
   time(&clock);
+#if defined(__APPLE__)
+  strcpy(date,(const char *)ctime(&clock));
+#else
   strcpy(date,ctime(&clock));
+#endif
   /*
    ** remove an carriage returns
    */
diff -Naur genesis/src/sys/system.c genesis2.2.1.Panther/src/sys/system.c
--- genesis/src/sys/system.c	Wed Apr 25 19:17:04 2001
+++ genesis2.2.1.Panther/src/sys/system.c	Mon May 24 17:44:23 2004
@@ -191,7 +191,11 @@
     ** pid > 0 indicates successful child has been forked
     ** so wait for it to complete execution and return the status
     */
+#if defined(__APPLE__)
+    while(wait(&status.w_status) != pid);
+#else
     while(wait(&status) != pid);
+#endif
     if(debug){
 	printf("child process %d done. Status = %d\n",
 	pid,
diff -Naur genesis/src/sys/system_deps.c genesis2.2.1.Panther/src/sys/system_deps.c
--- genesis/src/sys/system_deps.c	Fri Jun 29 23:31:42 2001
+++ genesis2.2.1.Panther/src/sys/system_deps.c	Mon May 24 17:44:23 2004
@@ -44,3 +44,21 @@
   int x;
 }
 #endif
+
+#if defined(__APPLE__)
+#include <string.h>
+void BetterBcopy(src, dst, len)
+char *src, *dst;
+size_t len;
+{
+    if ((src == dst) || (len <= 0)) return;
+    
+    if ((src < dst) && ((src + len) > dst)) {
+        src = src + len - 1;
+        dst = dst + len - 1;
+        for (; len>0; len--, src--, dst--) *dst = *src;
+    } else {
+        for (; len>0; len--, src++, dst++) *dst = *src;
+    }
+}
+#endif
diff -Naur genesis/src/tools/nrutil.c genesis2.2.1.Panther/src/tools/nrutil.c
--- genesis/src/tools/nrutil.c	Thu Apr 19 00:39:40 2001
+++ genesis2.2.1.Panther/src/tools/nrutil.c	Mon May 24 17:44:24 2004
@@ -10,10 +10,9 @@
 **
 */
 
-
-#include <malloc.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <malloc.h> // There! ... <\o Alf+ 
 
 void nrerror(error_text)
 char error_text[];
