diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.cygwin 1.2/BUILD/dan/Makefile.cygwin
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.cygwin	2009-01-28 09:39:14.000000000 -0800
+++ 1.2/BUILD/dan/Makefile.cygwin	2009-02-12 00:32:50.000000000 -0800
@@ -3,13 +3,15 @@
 CONFIGOPTIONS += --enable-cygwin
 CONFIGOPTIONS += --build=i486-pc-cygwin
 
+BUILDOPTIONS += RemakePackages=true RemakeAllDocumentation=true
+
 # so we use 4.2.1 even if a more modern version is available:
 CONFIGOPTIONS += --enable-build-libraries=gmp
 
 INSTALLOPTIONS += prefix=/usr/local/encap
-DIRECTORY = cygwin
+DIRECTORY ?= cygwin
 include Makefile.include
-default:install
+default:install check
 pre-install:;	rm -rf /usr/local/encap/Macaulay2-$(PACKAGE_VERSION)
 arch-chk:; [ `uname -s` = CYGWIN_NT-6.0 ] && [ `uname -m` = i686 ]
 # Local Variables:
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.debian64 1.2/BUILD/dan/Makefile.debian64
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.debian64	2009-01-30 09:34:37.000000000 -0800
+++ 1.2/BUILD/dan/Makefile.debian64	2009-02-15 18:20:18.000000000 -0800
@@ -1,27 +1,17 @@
 # -*- Makefile -*-
-
-# at first I get a message when booting:
-#     Your CPU does not support long mode. Use a 32bit distribution.
-# other's have had this problem
-# advice:
-#   turn on I/O APIC in the virtual machine, according the VirtualBox user manual
-#	tried it, doesn't help
-# advice:
-#   turn on VT-x in the virtual machine
-#       I can't, it's grayed out, because:
-# 		see
-#		    http://www.intel.com/products/processor_number/chart/core2duo.htm
-# 		which says that my T5250 doesn't have "Intel VT" virtualization technology
-
-#    gallium$ cat /proc/cpuinfo | grep 'model name' | head -1
-#    model name	: Intel(R) Core(TM)2 Duo CPU     T5250  @ 1.50GHz
-
-# VirtualBox settings:
-#  VBoxManage setextradata "debian 64" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
-#  VBoxManage setextradata "debian 64" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22
-#  VBoxManage setextradata "debian 64" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  2223
-
-# .ssh/config settings:
-# Host debian64
-#   Hostname localhost
-#   Port 2223
+# debian 4
+# sudo apt-get install openssh-server subversion emacs make autoconf xbase-clients gcc libc6-dev g++ bison lapack3-dev libgdbm-dev libgc-dev libgmp3-dev libpari-dev libreadline5-dev flex gfortran
+# debian 5
+# sudo apt-get install openssh-server subversion emacs make autoconf xbase-clients gcc libc6-dev g++ bison liblapack-dev libgdbm-dev libgc-dev libgmp3-dev libpari-dev libreadline5-dev flex gfortran
+CONFIGOPTIONS += --enable-deb
+DIRECTORY = debian64
+include Makefile.include
+default: check
+arch-chk:; [ `hostname` = debian64 -o `hostname` = debian64-5 ]
+# test *.deb files this way;
+#   dpkg --install Macaulay2-1.2-common.deb 
+#   dpkg --install Macaulay2-1.2-i386-Linux-Debian-4.0.deb 
+#   /usr/bin/M2
+# Local Variables:
+# compile-command: "time make -f Makefile.debian64 "
+# End:
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.fedora32 1.2/BUILD/dan/Makefile.fedora32
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.fedora32	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/BUILD/dan/Makefile.fedora32	2009-02-13 17:53:24.000000000 -0800
@@ -0,0 +1,49 @@
+#-*- Makefile -*-
+DIRECTORY = fedora32
+CONFIGOPTIONS += --build=i386-pc-linux-gnu
+CONFIGOPTIONS += --enable-rpm
+
+# but now configure.ac should detect it
+# # fedora 10 has factory 3.0.4 and libfac 3.0.4, but we want 3.1.0, or else some tests fail
+# CONFIGOPTIONS += --enable-build-libraries="factory libfac"
+
+INSTALLOPTIONS += prefix=$(HOME)/local/encap
+
+include Makefile.include
+default: install check
+
+
+# ftp://ftp.uci.edu/mirrors/fedora/linux/releases/10/Fedora/i386/iso/Fedora-10-i386-netinst.iso
+# install a minimal system over the network with development tools and software libraries
+
+# install packages:
+# 	yum install emacs
+# search for packages
+#	yum list emacs
+#	yum provides /usr/include/gc/gc.h
+
+# install these:
+
+# 	fakeroot
+# 	pari-devel
+#	gc-devel
+#	ntl-devel
+#	lapack-devel
+#	mpfr-devel
+#	factory-devel
+#	libfac-devel
+
+
+# VirtualBox settings:
+#  VBoxManage setextradata "fedora 10" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
+#  VBoxManage setextradata "fedora 10" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22
+#  VBoxManage setextradata "fedora 10" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  2225
+
+# .ssh/config settings:
+# Host fedora10
+#   Hostname localhost
+#   Port 2225
+
+# Local Variables:
+# compile-command: "time make -f Makefile.fedora32 "
+# End:
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.gentoo 1.2/BUILD/dan/Makefile.gentoo
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.gentoo	2009-02-04 09:55:11.000000000 -0800
+++ 1.2/BUILD/dan/Makefile.gentoo	2009-02-20 16:05:47.000000000 -0800
@@ -1,46 +1,26 @@
 # -*- Makefile -*-
 CONFIGOPTIONS += --build=i386-pc-linux-gnu
-INSTALLOPTIONS += prefix=/usr/local/encap
-CONFIGOPTIONS += --enable-deb
+INSTALLOPTIONS += prefix=$(HOME)/local/encap
 DIRECTORY = gentoo32
 include Makefile.include
 default: install
-pre-install:; rm -rf /usr/local/encap/Macaulay2-$(PACKAGE_VERSION)
-arch-chk:; [ `hostname` = gentoo32 ]
-# boot: gentoo-nofb or you won't be able to see the whole screen
-# using install-x86-minimal-2008.0.iso
-
+pre-install:; rm -rf $(HOME)/local/encap/Macaulay2-$(PACKAGE_VERSION)
+arch-chk:; [ `hostname` = gentoo ]
 
-#   apt-get update
-#  find available packages in /var/lib/apt/lists
-#   apt-get -y install ... :
-#     openssh-server (sshd, with X11forwarding already on)
-#     xbase-clients (xauth)
-#     emacs
-#     subversion
-#     make
-#     autoconf
-#     gcc
-#     libc6-dev (crt1.o)
-#     g++
-#     bison
-#     lapack3-dev
-#     libgdbm-dev
-#     libgc-dev
-#     libgmp3-dev (4.2.1)
-#     libmpfr-dev (too old, 2.2.0 instead of 2.3.2)
-#     libpari-dev
-#     libreadline5-dev
-#     
-# VirtualBox settings:
-#  VBoxManage setextradata "debian 32" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
-#  VBoxManage setextradata "debian 32" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22
-#  VBoxManage setextradata "debian 32" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  2224
+#  VBoxManage setextradata "gentoo 32" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
+#  VBoxManage setextradata "gentoo 32" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22
+#  VBoxManage setextradata "gentoo 32" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  2227
 # .ssh/config settings:
-#   Host debian32
+#   Host gentoo
 #     Hostname localhost
-#     Port 2224
+#     Port 2227
+# boot: gentoo-nofb or you won't be able to see the whole screen
+# using install-x86-minimal-2008.0.iso
+# install instructions: http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml
+# (unpack two tar files, mount proc dev, chroot, set hostname, use "emerge" to install the kernel source
+# package, make the kernel (shortcut: import /proc/config.gz as .config))
+# emerge more packages: emacs subversion 
 
 # Local Variables:
-# compile-command: "time make -f Makefile.debian32 "
+# compile-command: "time make -f Makefile.gentoo "
 # End:
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.mac 1.2/BUILD/dan/Makefile.mac
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.mac	2009-01-28 18:50:34.000000000 -0800
+++ 1.2/BUILD/dan/Makefile.mac	2009-02-18 17:59:01.000000000 -0800
@@ -1,43 +1,34 @@
 # -*- Makefile -*-
-
-# BUILDOPTIONS += IgnoreExampleErrors=true
-# BUILDOPTIONS += RemakeAllDocumentation=true RemakePackages=true
-# BUILDOPTIONS += RerunExamples=true
-# PACKAGES = Macaulay2Doc
-# BUILDOPTIONS += -s
-# INSTALLOPTIONS += -s
-# CONFIGOPTIONS += --enable-tarfile
-
 CONFIGOPTIONS += LDFLAGS=-static-libgcc
 CONFIGOPTIONS += --enable-build-libraries=gmp
-
 DEBUG = 
 unexport DEBUG
 PROFILE =
 unexport PROFILE
 ifeq ($(DEBUG),yes)
 INSTALLOPTIONS += prefix=/none
-CONFIGOPTIONS += --enable-debug --disable-pthreads
+CONFIGOPTIONS += --enable-debug
+# CONFIGOPTIONS += --disable-pthreads
 DIRECTORY = mac.debug
 else
 ifeq ($(PROFILE),yes)
 INSTALLOPTIONS += prefix=/none
-CONFIGOPTIONS += --enable-profile --disable-pthreads
+CONFIGOPTIONS += --enable-profile
+# CONFIGOPTIONS += --disable-pthreads
 DIRECTORY := mac.profile $(shell echo PROFILE = $(PROFILE) >&2 )
 else
 INSTALLOPTIONS += prefix=$(HOME)/local/encap
-# PREFIX = /usr/local
 
 # gc crashes if we enable pthreads, in testgc and in html-check-links
 # (under Mac OS 10.4 on power pc):
-CONFIGOPTIONS += --disable-pthreads
+# CONFIGOPTIONS += --disable-pthreads
 
 CONFIGOPTIONS += --enable-dmg
 DIRECTORY = mac
 endif
 endif
 include Makefile.include
-default: install
+default: install check
 pre-install:;	rm -rf /usr/local/encap/Macaulay2-$(PACKAGE_VERSION)
 # Local Variables:
 # compile-command: "time make -f Makefile.mac "
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.scientific 1.2/BUILD/dan/Makefile.scientific
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/Makefile.scientific	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/BUILD/dan/Makefile.scientific	2009-02-14 22:57:57.000000000 -0800
@@ -0,0 +1,32 @@
+#-*- Makefile -*-
+DIRECTORY = scientific
+CONFIGOPTIONS += --build=i386-pc-linux-gnu
+CONFIGOPTIONS += --enable-rpm
+include Makefile.include
+default: check
+
+# install packages, e.g.:
+# 	yum install emacs
+# search for packages, e.g.:
+#	yum list emacs
+#	yum provides /usr/include/gc/gc.h
+
+# install these:
+#	lapack.i386
+
+# get fakeroot:
+#     wget http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.11.tar.gz
+
+# VirtualBox settings:
+#  VBoxManage setextradata "scientific" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
+#  VBoxManage setextradata "scientific" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22
+#  VBoxManage setextradata "scientific" VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  2226
+
+# .ssh/config settings:
+# Host scientific
+#   Hostname localhost
+#   Port 2226
+
+# Local Variables:
+# compile-command: "time make -f Makefile.scientific "
+# End:
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/Makefile.machine 1.2/BUILD/dan/farm/Makefile.machine
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/Makefile.machine	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/BUILD/dan/farm/Makefile.machine	2009-02-15 17:14:29.000000000 -0800
@@ -0,0 +1,30 @@
+# -*- makefile -*-
+DIR = $(shell pwd)
+MACHINE = $(notdir $(DIR))
+all: $(ISO) disk $(MACHINE) settings 
+start:; VBoxManage -nologo startvm $(MACHINE) -type vrdp
+poweroff:; VBoxManage controlvm $(MACHINE) poweroff
+$(ISO):; wget $(URL)
+disk:; VBoxManage createhd -filename $(DIR)/disk -size 5120 -register
+$(MACHINE):
+	rm -f machine.xml
+	VBoxManage createvm -name $(MACHINE) -settingsfile $(DIR)/machine.xml
+	VBoxManage registervm $(DIR)/machine.xml
+	VBoxManage modifyvm $(MACHINE) -hda $(DIR)/disk
+always:
+mount-cd:; VBoxManage modifyvm $(MACHINE) -dvd $(DIR)/$(ISO)
+umount-cd:; VBoxManage modifyvm $(MACHINE) -dvd none
+settings: always
+	VBoxManage modifyvm $(MACHINE) \
+		-boot1 dvd -boot2 disk \
+		-hwvirtex on -ioapic on \
+		-vrdp on -vrdpport $(RDPPORT) -vrdpauthtype null \
+		-memory 1024 -nic1 nat \
+		-dvd $(DIR)/$(ISO)
+	VBoxManage setextradata $(MACHINE) VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
+	VBoxManage setextradata $(MACHINE) VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22
+	VBoxManage setextradata $(MACHINE) VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  $(SSHPORT)
+clean:; rm -rf machine.xml
+veryclean:; rm -rf disk
+show:; VBoxManage showvminfo $(MACHINE)
+state:; VBoxManage showvminfo $(MACHINE) |grep State:
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/README 1.2/BUILD/dan/farm/README
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/README	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/BUILD/dan/farm/README	2009-02-15 11:23:56.000000000 -0800
@@ -0,0 +1,11 @@
+packages to install
+
+	 virtualbox-ose
+	 virtualbox-ose-modules-generic
+	 virtualbox-ose-modules-2.6.24-21-generic
+	 virtualbox-ose-modules-2.6.24-23-generic
+	
+or
+
+	dpkg -i virtualbox-2.1_2.1.2-41885_Ubuntu_hardy_amd64.deb 
+
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/debian64/Makefile 1.2/BUILD/dan/farm/debian64/Makefile
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/debian64/Makefile	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/BUILD/dan/farm/debian64/Makefile	2009-02-15 17:14:29.000000000 -0800
@@ -0,0 +1,7 @@
+# debian 64:
+# apt-get install openssh-server subversion 
+SSHPORT = 2226
+RDPPORT = 3390
+ISO = debian-40r7-amd64-businesscard.iso
+URL = http://cdimage.debian.org/debian-cd/4.0_r7/amd64/iso-cd/$(ISO)
+include ../Makefile.machine
diff -ruN Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/debian64-5/Makefile 1.2/BUILD/dan/farm/debian64-5/Makefile
--- Macaulay2-1.2-src-fat-fink/BUILD/dan/farm/debian64-5/Makefile	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/BUILD/dan/farm/debian64-5/Makefile	2009-02-15 17:14:29.000000000 -0800
@@ -0,0 +1,7 @@
+# debian 64:
+# apt-get install openssh-server subversion 
+SSHPORT = 2227
+RDPPORT = 3391
+ISO = debian-500-amd64-netinst.iso
+URL = http://cdimage.debian.org/debian-cd/5.0.0/amd64/iso-cd/$(ISO)
+include ../Makefile.machine
Binary files Macaulay2-1.2-src-fat-fink/BUILD/tarfiles/factory-3-1-0.tar.gz and 1.2/BUILD/tarfiles/factory-3-1-0.tar.gz differ
Binary files Macaulay2-1.2-src-fat-fink/BUILD/tarfiles/frobby_vmike3.tar.gz and 1.2/BUILD/tarfiles/frobby_vmike3.tar.gz differ
Binary files Macaulay2-1.2-src-fat-fink/BUILD/tarfiles/libfac-3-1-0.tar.gz and 1.2/BUILD/tarfiles/libfac-3-1-0.tar.gz differ
diff -ruN Macaulay2-1.2-src-fat-fink/GNUmakefile.in 1.2/GNUmakefile.in
--- Macaulay2-1.2-src-fat-fink/GNUmakefile.in	2009-02-07 13:21:23.000000000 -0800
+++ 1.2/GNUmakefile.in	2009-02-18 17:13:59.000000000 -0800
@@ -9,6 +9,7 @@
 configured:include/configuration
 include/configuration: config.status; ./config.status
 check:configured check-in-Macaulay2
+check:; : +++ all Macaulay2 tests succeeded +++
 big-check:configured big-check-in-Macaulay2
 big-check-in-Macaulay2:; $(MAKE) -C Macaulay2 -k big-check
 check-machine:; @[ "@UNAME_INFO@" = "` @UNAME_INFO_COMMAND@ `" ] || (echo "error: reconfiguration required (uname output seems different)" >&2; false)
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-long-list-parsing 1.2/Macaulay2/bugs/dan/1-long-list-parsing
--- Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-long-list-parsing	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/Macaulay2/bugs/dan/1-long-list-parsing	2009-02-12 13:00:15.000000000 -0800
@@ -0,0 +1 @@
+with stack size set to 8192K lists of length 90000 can't be parsed
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-pari-gmp 1.2/Macaulay2/bugs/dan/1-pari-gmp
--- Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-pari-gmp	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/Macaulay2/bugs/dan/1-pari-gmp	2009-02-13 07:15:07.000000000 -0800
@@ -0,0 +1,4 @@
+on fedora we are forced to link dynamically with pari
+but we need to know whether it is configured for use with gmp (it is, on fedora)
+so, devise a run time test
+better: rewrite the gmp integer to pari integer conversion code to be compatible with both versions!
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-part-doc 1.2/Macaulay2/bugs/dan/1-part-doc
--- Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-part-doc	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/Macaulay2/bugs/dan/1-part-doc	2009-02-12 18:31:21.000000000 -0800
@@ -0,0 +1 @@
+document "part" better - the weight vector assigns an integer weight to each variable, in order.
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-tally-multiples 1.2/Macaulay2/bugs/dan/1-tally-multiples
--- Macaulay2-1.2-src-fat-fink/Macaulay2/bugs/dan/1-tally-multiples	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/Macaulay2/bugs/dan/1-tally-multiples	2009-02-12 15:42:22.000000000 -0800
@@ -0,0 +1,39 @@
+Date: Thu, 12 Feb 2009 17:28:34 -0600
+From: "Daniel R. Grayson" <dan@math.uiuc.edu>
+To: stpyang@kth.se
+CC: ggsmith@mast.queensu.ca, dan@math.uiuc.edu
+In-reply-to: <1233725801.20747.5.camel@pinky-laptop> (message from Stephanie
+	Yang on Wed, 04 Feb 2009 06:36:41 +0100)
+Subject: Re: KaLaPs3
+Reply-to: dan@math.uiuc.edu
+
+
+I like your idea for ZZ * Tally, and I think we'll add it to the next version:
+
+    i1 : 2 * tally{1,1,2}
+    stdio:1:3:(1):[0]: error: no method for binary operator * applied to objects:
+    --            2 (of class ZZ)
+    --      *     Tally{1 => 2} (of class Tally)
+    --                  2 => 1
+
+    i2 :  tally{1,1,2} +  tally{1,1,5}
+
+    o2 = Tally{1 => 4}
+	       2 => 1
+	       5 => 1
+
+    o2 : Tally
+
+    i3 : ZZ * Tally := (n,t) -> applyValues(t,m -> n*m)
+
+    o3 = {*Function[stdio:3:20-3:44]*}
+
+    o3 : FunctionClosure
+
+    i4 : 10 * tally(1,1,2)
+
+    o4 = Tally{1 => 20}
+	       2 => 10
+
+    o4 : Tally
+
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/c/cprint.c 1.2/Macaulay2/c/cprint.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/c/cprint.c	2008-12-28 08:56:20.000000000 -0800
+++ 1.2/Macaulay2/c/cprint.c	2009-02-12 00:32:50.000000000 -0800
@@ -429,7 +429,9 @@
       {
       put("     if (0 == ");
       cprint(s);
-      put(") outofmem()");
+      put(") outofmem2((size_t)");
+      cprintsomesizeof(t, length(g)==2 ? CADR(g) : NULL);
+      put(")");
       }
   }
 }
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/c/scc1.c 1.2/Macaulay2/c/scc1.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/c/scc1.c	2008-12-28 08:56:20.000000000 -0800
+++ 1.2/Macaulay2/c/scc1.c	2009-02-18 18:42:42.000000000 -0800
@@ -154,6 +154,7 @@
 extern void fatalarraylen();\n\
 extern void destroy();\n\
 extern void outofmem();\n\
+extern void outofmem2(size_t);\n\
 extern int do_memstats;\n\
 extern int numchunks[2];\n\
 extern int numbytes[2];\n\
@@ -182,6 +183,7 @@
      char *p;
      struct test {char a;double b;};
      i = assert(0 == GRAIN % (sizeof(struct test) - sizeof(double)));
+     GC_INIT();
 #include "gc_fixes.h"
      progname = BaseName(argv[0]);
      yyinit();
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/d/M2inits.c 1.2/Macaulay2/d/M2inits.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/d/M2inits.c	2009-01-13 17:44:00.000000000 -0800
+++ 1.2/Macaulay2/d/M2inits.c	2009-02-12 00:32:50.000000000 -0800
@@ -56,7 +56,7 @@
 
 void *malloc_function (size_t new) {
      void *p = malloc(new);
-     if (p == NULL) outofmem();
+     if (p == NULL) outofmem2(new);
 #    ifdef DEBUG
      trapchk(p);
 #    endif
@@ -72,7 +72,7 @@
 
 void *realloc_function (void *s, size_t old, size_t new) {
      void *p = malloc(new);
-     if (p == NULL) outofmem();
+     if (p == NULL) outofmem2(new);
      memcpy(p, s, old<new ? old : new);
      free(s);
 #    ifdef DEBUG
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/d/M2mem.c 1.2/Macaulay2/d/M2mem.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/d/M2mem.c	2009-01-13 17:44:00.000000000 -0800
+++ 1.2/Macaulay2/d/M2mem.c	2009-02-12 00:32:50.000000000 -0800
@@ -26,11 +26,31 @@
      }
 }
 
+void outofmem2(size_t new) {
+#if 0
+     static int count = 0;
+     if (!tokens_stopIfError && out_of_memory_jump_set && count++ < 5) {
+     	  fprintf(stderr,"out of memory, returning to top level\n");
+     	  fflush(stderr);
+     	  siglongjmp(out_of_memory_jump,1);
+	  }
+     else 
+#endif
+     {
+	  const char *msg = "\n\n *** out of memory trying to allocate %ld bytes, exiting ***\n";
+	  static char buf[sizeof(msg) + 20 - 2];
+	  sprintf(buf,msg,(long)new);
+	  int r = write(STDERR,buf,strlen(buf));
+	  if (r == ERROR) exit(1);
+	  exit(1);
+     }
+}
+
 char *getmem(size_t n)
 {
   char *p;
   p = GC_MALLOC(n);
-  if (p == NULL) outofmem();
+  if (p == NULL) outofmem2(n);
 #ifdef DEBUG
   memset(p,0xbe,n);
   trapchk(p);
@@ -59,7 +79,7 @@
 {
   char *p;
   p = GC_MALLOC(n);
-  if (p == NULL) outofmem();
+  if (p == NULL) outofmem2(n);
   /* 
      note: GC_MALLOC clears memory before returning.
      If you switch to another memory allocator, you must clear it explicitly:
@@ -75,7 +95,7 @@
 {
   char *p;
   p = GC_MALLOC_ATOMIC(n);
-  if (p == NULL) outofmem();
+  if (p == NULL) outofmem2(n);
 #ifdef DEBUG
   memset(p,0xac,n);
   trapchk(p);
@@ -87,7 +107,7 @@
 {
   char *p;
   p = malloc(n);
-  if (p == NULL) outofmem();
+  if (p == NULL) outofmem2(n);
 #ifdef DEBUG
   memset(p,0xca,n);
   trapchk(p);
@@ -99,7 +119,7 @@
 {
   char *p;
   p = GC_MALLOC_ATOMIC(n);
-  if (p == NULL) outofmem();
+  if (p == NULL) outofmem2(n);
   bzero(p,n);
 #ifdef DEBUG
   trapchk(p);
@@ -109,7 +129,7 @@
 
 char *getmoremem (char *s, size_t old, size_t new) {
      void *p = GC_REALLOC(s,new);
-     if (p == NULL) outofmem();
+     if (p == NULL) outofmem2(new);
 #    ifdef DEBUG
      trapchk(p);
 #    endif
@@ -119,7 +139,7 @@
 char *getmoremem_atomic (char *s, size_t old, size_t new) {
      void *p = GC_MALLOC_ATOMIC(new);
      size_t min = old<new ? old : new;
-     if (p == NULL) outofmem();
+     if (p == NULL) outofmem2(new);
      memcpy(p, s, min);
      GC_FREE(s);
 #    ifdef DEBUG
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/d/M2mem.h 1.2/Macaulay2/d/M2mem.h
--- Macaulay2-1.2-src-fat-fink/Macaulay2/d/M2mem.h	2009-01-12 18:17:29.000000000 -0800
+++ 1.2/Macaulay2/d/M2mem.h	2009-02-12 00:32:50.000000000 -0800
@@ -4,6 +4,7 @@
 extern "C" {
 #endif
   extern void outofmem(void);
+  extern void outofmem2(size_t);
   extern char *getmem(size_t);
   extern void freemem(void *);
   extern void freememlen(void *, size_t);
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/d/factory_allocator.c 1.2/Macaulay2/d/factory_allocator.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/d/factory_allocator.c	2008-11-20 17:51:23.000000000 -0800
+++ 1.2/Macaulay2/d/factory_allocator.c	2009-02-12 00:32:50.000000000 -0800
@@ -54,7 +54,7 @@
 					  return (void*)retval; \
 				      } else { \
 					  char* dum = (char*)malloc( size+HEADER_BYTES ); \
-                                          if (dum == NULL) outofmem(); \
+                                          if (dum == NULL) outofmem2(size+HEADER_BYTES); \
 					  *((int*)dum) = size; \
 					  MARK_GOOD(dum); \
 					  return (void*)(dum+HEADER_BYTES); \
@@ -86,7 +86,7 @@
     else if ( size <= SIZE6 ) GETBLOCK( 6, SIZE6 )
     else {
 	char* dum = (char*)malloc( size+HEADER_BYTES );
-	if (dum == NULL) outofmem();
+	if (dum == NULL) outofmem2(size);
 	*((int*)dum) = size;
 	MARK_GOOD(dum);
 	return dum + HEADER_BYTES;
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/e/gbring.cpp 1.2/Macaulay2/e/gbring.cpp
--- Macaulay2-1.2-src-fat-fink/Macaulay2/e/gbring.cpp	2008-10-26 19:01:16.000000000 -0700
+++ 1.2/Macaulay2/e/gbring.cpp	2009-02-12 00:32:50.000000000 -0800
@@ -26,7 +26,7 @@
 {
   void *p = mem->new_elem();
   //void *p = GC_MALLOC(gbvector_size);
-  //  if (p == 0) outofmem();
+  //  if (p == 0) outofmem2(gbvector_size);
   return(reinterpret_cast<gbvector *>(p));
 }
 
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/e/newdelete.hpp 1.2/Macaulay2/e/newdelete.hpp
--- Macaulay2-1.2-src-fat-fink/Macaulay2/e/newdelete.hpp	2007-08-10 14:32:06.000000000 -0700
+++ 1.2/Macaulay2/e/newdelete.hpp	2009-02-12 00:32:50.000000000 -0800
@@ -39,8 +39,8 @@
 #define GETMEM_ATOMIC(T,size) reinterpret_cast<T>(getmem_atomic(size))
 
 struct our_new_delete {
-  static inline void* operator new    ( size_t size ) { void *p = GC_MALLOC( size ); if (p == NULL) outofmem(); TRAPCHK(p); return p; }
-  static inline void* operator new [] ( size_t size ) { void *p = GC_MALLOC( size ); if (p == NULL) outofmem(); TRAPCHK(p); return p; }
+  static inline void* operator new    ( size_t size ) { void *p = GC_MALLOC( size ); if (p == NULL) outofmem2(size); TRAPCHK(p); return p; }
+  static inline void* operator new [] ( size_t size ) { void *p = GC_MALLOC( size ); if (p == NULL) outofmem2(size); TRAPCHK(p); return p; }
 
   static inline void* operator new    ( size_t size, void *existing_memory ) { return existing_memory; }
   static inline void* operator new [] ( size_t size, void *existing_memory ) { return existing_memory; }
@@ -66,8 +66,8 @@
      //   the compiler can't enforce this
      // suggestion:
      //   every class that inherits from this one should have "atomic" in its name
-  static inline void* operator new    ( size_t size ) { void *p = GC_MALLOC_ATOMIC( size ); if (p == NULL) outofmem(); TRAPCHK(p); return p; }
-  static inline void* operator new [] ( size_t size ) { void *p = GC_MALLOC_ATOMIC( size ); if (p == NULL) outofmem(); TRAPCHK(p); return p; }
+  static inline void* operator new    ( size_t size ) { void *p = GC_MALLOC_ATOMIC( size ); if (p == NULL) outofmem2(size); TRAPCHK(p); return p; }
+  static inline void* operator new [] ( size_t size ) { void *p = GC_MALLOC_ATOMIC( size ); if (p == NULL) outofmem2(size); TRAPCHK(p); return p; }
 
   static inline void* operator new    ( size_t size, void *existing_memory ) { return existing_memory; }
   static inline void* operator new [] ( size_t size, void *existing_memory ) { return existing_memory; }
@@ -91,9 +91,9 @@
 #include <gc/gc_allocator.h>
 
 // struct gc_malloc_alloc {
-//   static void* allocate(size_t n) { void* p = GC_MALLOC(n); if (p == NULL) outofmem(); return p; }
+//   static void* allocate(size_t n) { void* p = GC_MALLOC(n); if (p == NULL) outofmem2(n); return p; }
 //   static void deallocate(void* p, size_t /* n */) { GC_FREE(p); }
-//   static void* reallocate(void* p, size_t /* old size */, size_t newsize) { void* r = GC_REALLOC(p, newsize); if (NULL == r) outofmem(); return r; }
+//   static void* reallocate(void* p, size_t /* old size */, size_t newsize) { void* r = GC_REALLOC(p, newsize); if (NULL == r) outofmem2(newsize); return r; }
 // };
 
 #endif
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/e/x-factor.cpp 1.2/Macaulay2/e/x-factor.cpp
--- Macaulay2-1.2-src-fat-fink/Macaulay2/e/x-factor.cpp	2008-12-10 12:14:28.000000000 -0800
+++ 1.2/Macaulay2/e/x-factor.cpp	2009-02-13 07:02:49.000000000 -0800
@@ -694,6 +694,7 @@
 void rawDummy(void) {
   struct enter_factory foo;
   // we use this routine just for testing bits of stand-alone factory code
+#ifdef DEVELOPMENT
   Off( SW_RATIONAL );
   setCharacteristic(101);
   Variable a('a');
@@ -708,6 +709,7 @@
   cout << "a.level() = " << a.level() << endl ;
   CFFList fac = Factorize(f,mipo);
   cout << "fac = " << fac << endl;
+#endif
 }
 
 // Local Variables:
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/html-check-links/html-check-links.c 1.2/Macaulay2/html-check-links/html-check-links.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/html-check-links/html-check-links.c	2007-12-22 16:04:36.000000000 -0800
+++ 1.2/Macaulay2/html-check-links/html-check-links.c	2009-02-18 17:59:01.000000000 -0800
@@ -1,5 +1,6 @@
 /* Copyright 1998 by Daniel R. Grayson */
 
+#include <gc.h>
 #include "html-check-links.h"
 #include "grammar.h"
 #include "getmem.h"
@@ -97,6 +98,7 @@
 # ifdef DEBUG
   /*    yydebug = 1; */
 # endif
+  GC_init();
   if (argc > i+1 && 0 == strcmp("--root",argv[i])) rootname = argv[i+1], i += 2;
   for (; i<argc; i++) process(argv[i]);
   return errors > 0 ? 1 : 0;
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/packages/ComputationsBook/Makefile.chapter.in 1.2/Macaulay2/packages/ComputationsBook/Makefile.chapter.in
--- Macaulay2-1.2-src-fat-fink/Macaulay2/packages/ComputationsBook/Makefile.chapter.in	2009-02-07 10:59:55.000000000 -0800
+++ 1.2/Macaulay2/packages/ComputationsBook/Makefile.chapter.in	2009-02-12 00:32:50.000000000 -0800
@@ -8,7 +8,21 @@
 diff:
 	diff -b -u test.out.expected.trim test.out.trim
 
-ULIMIT := ulimit -v 800000; ulimit -t 3000; ulimit -s 8192
+LIMIT :=
+ifeq (@ULIMIT_T@,yes)
+LIMIT += ulimit -t 1200 ;
+endif
+ifeq (@ULIMIT_M@,yes)
+LIMIT += ulimit -m 800000 ;
+endif
+ifeq (@ULIMIT_V@,yes)
+LIMIT += ulimit -v 800000 ;
+endif
+ifeq (@ULIMIT_S@,yes)
+LIMIT += ulimit -s 8192 ;
+endif
+
+
 PATHJOIN := 'path = join({"./","$(chapter_srcdir)/"},path)'
 M2CMD := time nice -18 @pre_exec_prefix@/bin/M2@EXE@ --stop -q -e $(PATHJOIN) --print-width 0
 EXIT := -e "exit 0"
@@ -24,14 +38,8 @@
 	<$< sed -f $(book_patterns) -f $(chapter_patterns) >$@
 
 test.out: test.m2 always
-	@ set -xe ; \
-	  $(ULIMIT); $(M2CMD) $(INPUT) $(EXIT) >test.out.tmp; \
-	  mv test.out.tmp test.out
-
-test-mike.out: test.m2 always
-	@ set -xe ; \
-	  $(M2CMD) $(INPUT) $(EXIT) >test.out.tmp; \
-	  mv test.out.tmp test-mike.out
+	$(LIMIT) $(M2CMD) $(INPUT) $(EXIT) >test.out.tmp
+	mv test.out.tmp test.out
 
 distclean::clean
 distclean::; rm -f Makefile
@@ -42,9 +50,8 @@
 OLDM2CMD := time nice -18 $(OLDM2) -s -q -e$(PATHJOIN)
 capture: test.oldout test.oldvalues
 test.oldvalues test.oldout : chapter.m2 ../capture.m2 ../Makefile.chapter
-	@ set -xe ; \
-	  $(ULIMIT); $(OLDM2CMD) -e'load "$(chapter_srcdir)/../capture.m2"; input "$<"; exit 0'  >test.oldout.tmp </dev/null; \
-	  mv test.oldout.tmp test.oldout
+	$(LIMIT) $(OLDM2CMD) -e'load "$(chapter_srcdir)/../capture.m2"; input "$<"; exit 0'  >test.oldout.tmp </dev/null
+	mv test.oldout.tmp test.oldout
 
 # Local Variables:
 # compile-command: "make -C $M2BUILDDIR/Macaulay2/packages/ComputationsBook "
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/basictests/Makefile.in 1.2/Macaulay2/packages/Macaulay2Doc/basictests/Makefile.in
--- Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/basictests/Makefile.in	2009-02-11 07:53:10.000000000 -0800
+++ 1.2/Macaulay2/packages/Macaulay2Doc/basictests/Makefile.in	2009-02-12 00:32:50.000000000 -0800
@@ -21,9 +21,23 @@
 
 ARGS := --silent -q --stop --no-loaddata --no-setup -e 'srcdir = "@srcdir@/"'
 
+LIMIT :=
+ifeq (@ULIMIT_T@,yes)
+LIMIT += ulimit -t 20 ;
+endif
+ifeq (@ULIMIT_M@,yes)
+LIMIT += ulimit -m 200000 ;
+endif
+ifeq (@ULIMIT_V@,yes)
+LIMIT += ulimit -v 200000 ;
+endif
+ifeq (@ULIMIT_S@,yes)
+LIMIT += ulimit -s 8192 ;
+endif
+
 %.okay : %.m2
 	@ echo testing $<
-	@ ulimit -s 8192 ; ulimit -v 200000 ; ulimit -t 20 2>/dev/null; env @pre_exec_prefix@/bin/M2@EXE@ $(ARGS) $< -e 'exit 0'
+	@ $(LIMIT) env @pre_exec_prefix@/bin/M2@EXE@ $(ARGS) $< -e 'exit 0'
 	@ touch $@
 
 clean::	; rm -f *.okay
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/basictests/testgc.c 1.2/Macaulay2/packages/Macaulay2Doc/basictests/testgc.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/basictests/testgc.c	2008-12-15 20:26:50.000000000 -0800
+++ 1.2/Macaulay2/packages/Macaulay2Doc/basictests/testgc.c	2009-02-18 17:10:44.000000000 -0800
@@ -24,6 +24,7 @@
 }
 
 int main () {
+  GC_INIT();
   uniq(
        GC_malloc(12), GC_malloc(12), GC_malloc(12), (GC_gcollect(),GC_malloc(12)),
        GC_malloc(12), GC_malloc(12), GC_malloc(12), (GC_gcollect(),GC_malloc(12)),
@@ -33,3 +34,9 @@
        (void *)0);
   return 0;
 }
+
+/*
+ Local Variables:
+ compile-command: "make -C $M2BUILDDIR/Macaulay2/packages/Macaulay2Doc/basictests "
+ End:
+*/
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/forms.m2 1.2/Macaulay2/packages/Macaulay2Doc/test/forms.m2
--- Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/forms.m2	2009-02-06 17:36:45.000000000 -0800
+++ 1.2/Macaulay2/packages/Macaulay2Doc/test/forms.m2	1969-12-31 16:00:00.000000000 -0800
@@ -1,12 +0,0 @@
---this has, in the past, run quickly out of memory on 32 bit machines but not on 64 bit machines
-d = 16
-k = QQ
-m = 3
-R = k[take(a..z,-m)]
-N = binomial(m+d-1,m-1)
-r = floor(N/2)
-r' = floor(r * 1.3)
-f = random(R^1,R^{r:-d}) * random(R^{r:-d},R^{r':-d});
-gbTrace = 3;
-M = image f;
-time G = gb(M, DegreeLimit => d);
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/slow/Makefile.in 1.2/Macaulay2/packages/Macaulay2Doc/test/slow/Makefile.in
--- Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/slow/Makefile.in	2009-01-07 14:41:01.000000000 -0800
+++ 1.2/Macaulay2/packages/Macaulay2Doc/test/slow/Makefile.in	2009-02-18 06:12:28.000000000 -0800
@@ -7,12 +7,12 @@
 ifeq "@DEBUG@" "no"
 MLIMIT = 400000
 VLIMIT = 400000
-TLIMIT = 300
+TLIMIT = 450
 else
 # give the debug version more time and space
 MLIMIT = 600000
 VLIMIT = 600000
-TLIMIT = 450
+TLIMIT = 600
 endif
 
 SRCDIR = @srcdir@
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/slow/forms.m2 1.2/Macaulay2/packages/Macaulay2Doc/test/slow/forms.m2
--- Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/slow/forms.m2	1969-12-31 16:00:00.000000000 -0800
+++ 1.2/Macaulay2/packages/Macaulay2Doc/test/slow/forms.m2	2009-02-18 06:12:28.000000000 -0800
@@ -0,0 +1,12 @@
+--this has, in the past, run quickly out of memory on 32 bit machines but not on 64 bit machines
+d = 16
+k = QQ
+m = 3
+R = k[take(a..z,-m)]
+N = binomial(m+d-1,m-1)
+r = floor(N/2)
+r' = floor(r * 1.3)
+f = random(R^1,R^{r:-d}) * random(R^{r:-d},R^{r':-d});
+gbTrace = 3;
+M = image f;
+time G = gb(M, DegreeLimit => d);
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/socket.m2 1.2/Macaulay2/packages/Macaulay2Doc/test/socket.m2
--- Macaulay2-1.2-src-fat-fink/Macaulay2/packages/Macaulay2Doc/test/socket.m2	2006-05-17 13:37:25.000000000 -0700
+++ 1.2/Macaulay2/packages/Macaulay2Doc/test/socket.m2	2009-02-13 17:42:24.000000000 -0800
@@ -1,3 +1,6 @@
+
+end -- this test is disabled, because on machines with firewalls and on virtual machines, listening to a port may simply not work
+
 f = openListener "$"
 assert not isReady f
 
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/util/gc_test.c 1.2/Macaulay2/util/gc_test.c
--- Macaulay2-1.2-src-fat-fink/Macaulay2/util/gc_test.c	2008-12-08 20:20:39.000000000 -0800
+++ 1.2/Macaulay2/util/gc_test.c	2009-02-18 17:13:42.000000000 -0800
@@ -48,6 +48,8 @@
 int main() {
   int i;
 
+  GC_INIT();
+
 #include "gc_fixes.h"
 
   uniq("%s:%d: error: gc library doesn't find all the active pointers in registers or on the stack!\n"
diff -ruN Macaulay2-1.2-src-fat-fink/configure.ac 1.2/configure.ac
--- Macaulay2-1.2-src-fat-fink/configure.ac	2009-02-08 12:45:43.000000000 -0800
+++ 1.2/configure.ac	2009-02-15 18:20:18.000000000 -0800
@@ -111,6 +111,7 @@
 	 "Fedora"*) ISSUE_FLAVOR=Fedora ;;
 	 "RedHatEnterprise"*) ISSUE_FLAVOR=RedHatEnterprise ;;
 	 "RedHat"*) ISSUE_FLAVOR=RedHat ;;
+	 "Scientific"*) ISSUE_FLAVOR="ScientificLinux" ;;
 	 "Debian"*) ISSUE_FLAVOR=Debian ;;  # Debian GNU/Linux 4.0 \n \l
 	 "") ISSUE_FLAVOR=unknown ;;
      esac
@@ -137,6 +138,7 @@
   Darwin-7.*) REL=10.3 ; OS=MacOS ;;
   Darwin-8.*) REL=10.4 ; OS=MacOS ;;
   Darwin-9.*) REL=10.5 ; OS=MacOS ;;
+  Darwin-10.*) REL=10.6 ; OS=MacOS ;;
   Darwin-*) echo "Darwin release number translation needed in configure.ac" >&2 ; exit 1
 esac
 
@@ -601,6 +603,27 @@
 then AC_LANG(C)
      AC_SEARCH_LIBS(__gmpz_init,gmp,,BUILD_gmp=yes)
      AC_CHECK_HEADER(gmp.h,,BUILD_gmp=yes)
+     if test $BUILD_gmp = no
+     then AC_MSG_CHECKING([whether gmp library is recent enough])
+          # version 4.1.4 of gmp has a random number generator different from 4.2.1's
+	  AC_RUN_IFELSE( [[
+	  #include <gmp.h>
+	  #include <stdio.h>
+	  int main() {
+	    int A=4,B=2,a=0,b=0,c=0,r=sscanf(__gmp_version,"%d.%d.%d",&a,&b,&c), t;
+	    if (r < 2) {
+	      fprintf(stderr,"failed to parse gmp version number: %s\n", __gmp_version);
+	      return 1;
+	    }
+	    t = a>A || a==A && b>=B;
+	    printf("(gmp version %s %s %d.%d) ",__gmp_version, t ? ">=" : "<", A, B);
+	    return !t;
+	  }
+	  ]],
+	  [ AC_MSG_RESULT(yes) ],
+	  [ AC_MSG_RESULT(no); BUILD_gmp=yes ],
+	  [ AC_MSG_RESULT([cross-compiling, test not possible]) ])
+     fi
 fi
 dnl frobby uses gmpxx
 if test $BUILD_gmp = yes
@@ -611,7 +634,7 @@
 if test "$PARI" = yes
 then if test $BUILD_pari = no
      then AC_LANG(C)
-	  AC_SEARCH_LIBS(pari_init,pari,,BUILD_pari=yes)
+	  AC_SEARCH_LIBS(pari_init,pari,,BUILD_pari=yes,-lm)
 	  AC_CHECK_HEADER(pari/pari.h,,BUILD_pari=yes)
      fi
      test $BUILD_pari = yes && BUILTLIBS="-lpari $BUILTLIBS"
@@ -817,8 +840,8 @@
 	   extern const char * libfac_version;
 	   int main () {
 		FILE *msg = fdopen(]]AS_MESSAGE_FD[[,"w");
-		static int factoryV[3], fV[3] = {3,0,3}, fOK;
-		static int  libfacV[3], lV[3] = {3,0,1}, lOK;
+		static int factoryV[3], fV[3] = {3,1,0}, fOK;
+		static int  libfacV[3], lV[3] = {3,1,0}, lOK;
 		sscanf(FACTORYVERSION,"%d.%d.%d", &factoryV[0], &factoryV[1], &factoryV[2]);
 		sscanf(libfac_version,"%d.%d.%d", &libfacV[0], &libfacV[1], &libfacV[2]);
 		fOK = factoryV[0] > fV[0] ||
@@ -860,6 +883,10 @@
 	     FORTRANUSED=yes
 	     if test $BUILD_lapack = no
 	     then AC_LANG(Fortran)
+	     	  if test "$FC" = ""
+		  then AC_MSG_ERROR(no fortran compiler found)
+		  else AC_MSG_NOTICE(using fortran compiler $FC)
+		  fi
 		  AC_SEARCH_LIBS(sgemv,blas f77blas,,BUILD_lapack=yes)
 		  AC_SEARCH_LIBS(dgetrf,lapack,,BUILD_lapack=yes)
 	     fi
@@ -1008,9 +1035,11 @@
 	#    socket: dynamic loading of libraries is used to determine the current way to look up an IP number
 	#  libgcc_s: comes only in dynamic form
 	-lncurses | -lsocket  | -lgcc_s* ) LIBS_DYNAMIC="$LIBS_DYNAMIC $i" ;;
-	# we must link statically with some libraries:
-	#   libpari: provides no version number at run time, and we must ensure it is configured based on gmp
-	-lpari ) LIBS_STATIC="$LIBS_STATIC $i" ;;
+	# but on some systems, libpari is provided only dynamically (fedora), so we link dynamically
+	# and later we'll figure out a run-time test for whether pari is based on gmp
+	# # we must link statically with some libraries:
+	# #   libpari: provides no version number at run time, and we must ensure it is configured based on gmp
+	# -lpari ) LIBS_STATIC="$LIBS_STATIC $i" ;;
 	*) LIBS_STATIC_OR_DYNAMIC="$LIBS_STATIC_OR_DYNAMIC $i" ;;
    esac
 done
diff -ruN Macaulay2-1.2-src-fat-fink/distributions/rpm/Makefile.in 1.2/distributions/rpm/Makefile.in
--- Macaulay2-1.2-src-fat-fink/distributions/rpm/Makefile.in	2009-01-09 12:43:30.000000000 -0800
+++ 1.2/distributions/rpm/Makefile.in	2009-02-13 12:22:54.000000000 -0800
@@ -85,14 +85,14 @@
 	sed -e '1,/Requires/d' -e 's/%PKG_RPM%/$(PKG_RPM)/g' <$< >>$@
 	(cd files && @FIND@ . -type d -a -name Macaulay2 -prune -o -type f) | sed $(SEDOPTS) >>Macaulay2.spec
 
-../../$(PKG_RPM) : Macaulay2.spec .prepared; @FAKEROOT@ rpmbuild -bb Macaulay2.spec
+../../$(PKG_RPM) : Macaulay2.spec .prepared; @FAKEROOT@ rpmbuild --buildroot @abs_builddir@/files -bb Macaulay2.spec
 
 Macaulay2-common.spec: Macaulay2-common-body.spec Makefile .prepared-common
 	sed -e 's/^Release: .*/Release: $(DISTRIBUTION)/' \
 	    -e 's/%PKG_COM_RPM%/$(PKG_COM_RPM)/g' <$< >$@
 	(cd files-common && @FIND@ -type d -a -name Macaulay2 -prune -o -type f) | sed $(SEDOPTS) >>Macaulay2-common.spec
 
-../../$(PKG_COM_RPM) : Macaulay2-common.spec .prepared-common; @FAKEROOT@ rpmbuild -bb Macaulay2-common.spec
+../../$(PKG_COM_RPM) : Macaulay2-common.spec .prepared-common; @FAKEROOT@ rpmbuild --buildroot @abs_builddir@/files-common -bb Macaulay2-common.spec
 
 libraries-used: .prepared always
 	: warning: fixed layout in use:
diff -ruN Macaulay2-1.2-src-fat-fink/include/gc_fixes.h 1.2/include/gc_fixes.h
--- Macaulay2-1.2-src-fat-fink/include/gc_fixes.h	2006-07-13 06:07:49.000000000 -0700
+++ 1.2/include/gc_fixes.h	2009-02-18 17:13:42.000000000 -0800
@@ -1,6 +1,11 @@
+#if 0
+
+   /* let's see if these fixes for gc are still needed */
 #if defined(__APPLE__) && defined(__MACH__)
      {
      extern char *get_etext(), *get_end();
      GC_add_roots(get_etext(),get_end());
      }
 #endif
+
+#endif
diff -ruN Macaulay2-1.2-src-fat-fink/libraries/Makefile.library.in 1.2/libraries/Makefile.library.in
--- Macaulay2-1.2-src-fat-fink/libraries/Makefile.library.in	2009-02-04 14:10:02.000000000 -0800
+++ 1.2/libraries/Makefile.library.in	2009-02-12 12:51:28.000000000 -0800
@@ -63,7 +63,7 @@
 .configured-$(VERSION) : .patched-$(VERSION)    ; @ set -x ; ( cd $(BUILDDIR) && $(CONFIGURECMD) ) && touch $@
 ifneq ($(PATCHFILE),)
 .patched-$(VERSION) : $(PATCHFILE)
-PATCHCMD = cd $(UNTARDIR) && patch -p0 <$(PATCHFILE)
+PATCHCMD = cd $(UNTARDIR) && patch -p0 $(PATCHOPTIONS) <$(PATCHFILE)
 else
 PATCHCMD = :
 endif
diff -ruN Macaulay2-1.2-src-fat-fink/libraries/frobby/Makefile.in 1.2/libraries/frobby/Makefile.in
--- Macaulay2-1.2-src-fat-fink/libraries/frobby/Makefile.in	2009-02-08 16:41:32.000000000 -0800
+++ 1.2/libraries/frobby/Makefile.in	2009-02-12 22:00:31.000000000 -0800
@@ -14,11 +14,17 @@
 	LDFLAGS="$(LDFLAGS)" \
 	CPPFLAGS="$(CPPFLAGS)"
 CHECKOPTIONS = $(BUILDOPTIONS)
+
+# this ought to prevent trouble with carriage returns
+PATCHOPTIONS = --ignore-whitespace
+
 ifeq (@DEBUG@,yes)
 BUILDOPTIONS += MODE=debug
 endif
 CONFIGURECMD = :
 INSTALLCMD = \
+	$(MKDIR_P) $(LIBRARIESDIR)/lib && \
+	$(MKDIR_P) $(LIBRARIESDIR)/include && \
 	cp bin/libfrobby.a $(LIBRARIESDIR)/lib/libfrobby.a && \
 	cp src/frobby.h $(LIBRARIESDIR)/include/frobby.h && \
 	cp src/stdinc.h $(LIBRARIESDIR)/include/stdinc.h
diff -ruN Macaulay2-1.2-src-fat-fink/libraries/frobby/patch-mike3 1.2/libraries/frobby/patch-mike3
--- Macaulay2-1.2-src-fat-fink/libraries/frobby/patch-mike3	2009-02-11 22:46:33.000000000 -0800
+++ 1.2/libraries/frobby/patch-mike3	2009-02-15 19:02:24.000000000 -0800
@@ -1,6 +1,6 @@
-diff -ur --exclude=configure /home/25/dan/src/M2/1.2/BUILD/dan/builds/linux32.debug/libraries/frobby/tmp/frobby_vmike3/Makefile frobby_vmike3/Makefile
---- /home/25/dan/src/M2/1.2/BUILD/dan/builds/linux32.debug/libraries/frobby/tmp/frobby_vmike3/Makefile	2008-12-10 20:04:17.000000000 -0600
-+++ frobby_vmike3/Makefile	2009-02-08 20:38:42.000000000 -0600
+diff -ur --exclude=configure /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/Makefile frobby_vmike3/Makefile
+--- /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/Makefile	2008-12-10 21:04:17.000000000 -0500
++++ frobby_vmike3/Makefile	2009-02-15 16:18:52.000000000 -0500
 @@ -42,11 +42,14 @@
  endif
  
@@ -56,9 +56,9 @@
  -include .depend
  
  clean: tidy
-diff -ur --exclude=configure /home/25/dan/src/M2/1.2/BUILD/dan/builds/linux32.debug/libraries/frobby/tmp/frobby_vmike3/src/NullCoefTermConsumer.h frobby_vmike3/src/NullCoefTermConsumer.h
---- /home/25/dan/src/M2/1.2/BUILD/dan/builds/linux32.debug/libraries/frobby/tmp/frobby_vmike3/src/NullCoefTermConsumer.h	2008-12-10 20:04:17.000000000 -0600
-+++ frobby_vmike3/src/NullCoefTermConsumer.h	2009-02-08 22:13:56.000000000 -0600
+diff -ur --exclude=configure /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/src/NullCoefTermConsumer.h frobby_vmike3/src/NullCoefTermConsumer.h
+--- /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/src/NullCoefTermConsumer.h	2008-12-10 21:04:17.000000000 -0500
++++ frobby_vmike3/src/NullCoefTermConsumer.h	2009-02-15 16:18:52.000000000 -0500
 @@ -19,7 +19,7 @@
  
  #include "CoefTermConsumer.h"
@@ -68,9 +68,9 @@
    virtual ~NullCoefTermConsumer();
  
    virtual void consume(const mpz_class& coef, const Term& term);
-diff -ur --exclude=configure /home/25/dan/src/M2/1.2/BUILD/dan/builds/linux32.debug/libraries/frobby/tmp/frobby_vmike3/src/hash_map/hash_map frobby_vmike3/src/hash_map/hash_map
---- /home/25/dan/src/M2/1.2/BUILD/dan/builds/linux32.debug/libraries/frobby/tmp/frobby_vmike3/src/hash_map/hash_map	2008-12-10 20:04:17.000000000 -0600
-+++ frobby_vmike3/src/hash_map/hash_map	2009-02-08 20:38:42.000000000 -0600
+diff -ur --exclude=configure /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/src/hash_map/hash_map frobby_vmike3/src/hash_map/hash_map
+--- /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/src/hash_map/hash_map	2008-12-10 21:04:17.000000000 -0500
++++ frobby_vmike3/src/hash_map/hash_map	2009-02-15 16:18:52.000000000 -0500
 @@ -292,10 +292,10 @@
      class hash_multimap
      {
@@ -86,3 +86,14 @@
  	
      private:
        typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFn,
+diff -ur --exclude=configure /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/src/stdinc.h frobby_vmike3/src/stdinc.h
+--- /home/dan/M2/BUILD/dan/builds/debian64/libraries/frobby/tmp/frobby_vmike3/src/stdinc.h	2008-12-10 21:04:17.000000000 -0500
++++ frobby_vmike3/src/stdinc.h	2009-02-15 16:30:12.000000000 -0500
+@@ -14,6 +14,7 @@
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see http://www.gnu.org/licenses/.
+ */
++#include <stdio.h> /* to get FILE defined for gmp.h */
+ #include <gmp.h>
+ #include <gmpxx.h>
+ #include <memory>
diff -ruN Macaulay2-1.2-src-fat-fink/Macaulay2/e/polyring.cpp Macaulay2-1.2-src-fat-fink-patched/Macaulay2/e/polyring.cpp
--- Macaulay2-1.2-src-fat-fink/Macaulay2/e/polyring.cpp	2009-02-06 21:09:07.000000000 -0800
+++ Macaulay2-1.2-src-fat-fink-patched/Macaulay2/e/polyring.cpp	2009-02-26 19:43:36.000000000 -0800
@@ -1452,9 +1452,9 @@
   Nterm *nextterm = new_term();
   int gval = 0, flast = 0;
 
-  if (a != 0)
+  if (t != 0)
     {
-      Nterm *z = a;
+      Nterm *z = t;
       for ( ; z->next != 0; z = z->next);
 
       flast = M_->first_weight_value(z->monom);
