diff -ruN Macaulay2-0.9.2/Macaulay2/README.MacOSX Macaulay2-0.9.2-patched/Macaulay2/README.MacOSX --- Macaulay2-0.9.2/Macaulay2/README.MacOSX Wed Dec 31 19:00:00 1969 +++ Macaulay2-0.9.2-patched/Macaulay2/README.MacOSX Wed May 7 08:58:13 2003 @@ -0,0 +1,42 @@ + + + Macaulay2 on Mac OS X + + +1. Installation + +The easiest way to install Macaulay2 under Mac OS X is to use the Fink +system . Follow the instructions at the +Fink website to install Fink itself, and then install Fink's "macaulay2" +package. You can choose the binary installation method, or the source +installation method (which will download the source files and compile +them on your machine). You may also wish to install emacs or xemacs +using Fink, for the best interface to Macaulay2. + +Fink can also be used to install other software of interest to +mathematicians. In most cases, you simply install the relevant Fink +package. In two special cases -- the X11 windowing system, and TeX -- +it is possible to install the software using another method, and then +tell Fink about it (by installing Fink's packages "system-xfree86" and +"system-tetex", respectively). + + +2. Running Macaulay2 + +The best way to run Macaulay2 is under emacs or xemacs. Before running +Macaulay2 for the first time, edit the .emacs file in your home directory +to include the line + + (load "@PREFIX@/lib/Macaulay2-0.9.2/emacs/M2-init.el") + +For further information about running Macaulay2 under emacs, please consult +the file + + @PREFIX@/lib/Macaulay2-0.9.2/emacs/emacs-hlp.txt + + + The stacksize under Mac OS X is not always large enough to handle +computations in Macaulay2. (The symptom is a segmentation fault when you try +a large calculation.) The cure is to run the command "limit stacksize 5m" +prior to the command "M2". (You can experiment with different values of +the stacksize to find a suitable one for your computation.) diff -ruN Macaulay2-0.9.2/Macaulay2/d/scclib.c Macaulay2-0.9.2-patched/Macaulay2/d/scclib.c --- Macaulay2-0.9.2/Macaulay2/d/scclib.c Thu Aug 9 17:01:44 2001 +++ Macaulay2-0.9.2-patched/Macaulay2/d/scclib.c Wed May 7 08:58:13 2003 @@ -658,7 +658,10 @@ return sd; } -extern int errno, sys_nerr; +extern int errno; +#if defined HAVE_DECL_SYS_NERR && !HAVE_DECL_SYS_NERR +extern int sys_nerr; +#endif #ifdef __CYGWIN__ #define NO_HERROR diff -ruN Macaulay2-0.9.2/Macaulay2/dumpdata/dumpdata.c Macaulay2-0.9.2-patched/Macaulay2/dumpdata/dumpdata.c --- Macaulay2-0.9.2/Macaulay2/dumpdata/dumpdata.c Thu Aug 10 15:56:42 2000 +++ Macaulay2-0.9.2-patched/Macaulay2/dumpdata/dumpdata.c Wed May 7 08:58:13 2003 @@ -137,8 +137,8 @@ n = ((pos + PAGESIZE - 1)/PAGESIZE) * PAGESIZE - pos; { char buf[n]; - int i; - for (i=0; i #include #include #include @@ -17,7 +18,7 @@ return fnumlines(mapfilename); } -int getmaps(int nmaps, struct MAP map[nmaps]) { +int getmaps(int nmaps, struct MAP maps[nmaps]) { int mlen = filelen(mapfilename); if (mlen == ERROR) return ERROR; else { @@ -30,18 +31,18 @@ int ret; char r, w, x; int len = linelen(line[i]); - char buf[len + 1]; - memcpy(buf,line[i],len); - buf[len]=0; - ret = sscanf(buf, mapfmt, &map[i].from, &map[i].to, &r, &w, &x); + char buf2[len + 1]; + memcpy(buf2,line[i],len); + buf2[len]=0; + ret = sscanf(buf2, mapfmt, &maps[i].from, &maps[i].to, &r, &w, &x); if (5 != ret) { - warning("can't parse map '%s' from file '%s'\n", buf, mapfilename); + warning("can't parse map '%s' from file '%s'\n", buf2, mapfilename); return ERROR; } - map[i].r = r == 'r'; - map[i].w = w == 'w'; - map[i].x = x == 'x'; - map[i].checksum = 0; + maps[i].r = r == 'r'; + maps[i].w = w == 'w'; + maps[i].x = x == 'x'; + maps[i].checksum = 0; } return OKAY; } diff -ruN Macaulay2-0.9.2/Macaulay2/e/style.hpp Macaulay2-0.9.2-patched/Macaulay2/e/style.hpp --- Macaulay2-0.9.2/Macaulay2/e/style.hpp Tue Aug 7 23:16:19 2001 +++ Macaulay2-0.9.2-patched/Macaulay2/e/style.hpp Wed May 7 08:58:13 2003 @@ -3,7 +3,6 @@ #define _style_hh_ #include // to get fabs(), gcc 3.0 -#include // just to get swap(), which is included from algobase.h by vector.h, gcc 3.0 #include #include #include @@ -12,6 +11,16 @@ #include #include + + + +// 'swap' is defined here, perhaps in namespace std +#include +using namespace std; + + + + extern "C" char newline[]; diff -ruN Macaulay2-0.9.2/Macaulay2/m2/Makefile.egs Macaulay2-0.9.2-patched/Macaulay2/m2/Makefile.egs --- Macaulay2-0.9.2/Macaulay2/m2/Makefile.egs Wed Aug 15 16:46:13 2001 +++ Macaulay2-0.9.2-patched/Macaulay2/m2/Makefile.egs Wed May 7 08:58:13 2003 @@ -19,7 +19,7 @@ @if [ -f ./"$*.out" ] && cmp -s ./"$*.example" ./"$*.example.old" ; \ then touch ./"$*.out" ; \ else echo "running example $*"; \ - if env M2HOME=../../.. ../../../libexec/Macaulay2 $(ARGS) <./"$*.example" >./"$*.tmp" ; \ + if env -i M2HOME=../../.. ../../../libexec/Macaulay2 $(ARGS) <./"$*.example" >./"$*.tmp" ; \ then mv ./"$*.tmp" ./"$*.out" ; \ cp ./"$*.example" ./"$*.example.old" ; \ else echo "contents of $*.example:" ; \ diff -ruN Macaulay2-0.9.2/Macaulay2/m2/Makefile.in Macaulay2-0.9.2-patched/Macaulay2/m2/Makefile.in --- Macaulay2-0.9.2/Macaulay2/m2/Makefile.in Wed Aug 15 16:46:13 2001 +++ Macaulay2-0.9.2-patched/Macaulay2/m2/Makefile.in Wed May 7 08:58:13 2003 @@ -103,7 +103,7 @@ ../$(DUMPDATAFILE) : $(DUMPEDM2FILES) ../libexec/Macaulay2 # phase 1: read *.m2 and dump data rm -f ../$(DUMPDATAFILE) - time env M2HOME=.. ../libexec/Macaulay2 -q -silent -tty '-ephase=1' \ + time env -i M2HOME=.. ../libexec/Macaulay2 -q -silent -tty '-ephase=1' \ @srcdir@/setup.m2 @srcdir@/dumpdata.m2 '-edump()' else ARGS := -silent setup.m2 @@ -122,12 +122,12 @@ rm -rf ../cache/Macaulay2-tmp rm -rf cache/tests mkdir cache/tests - env M2HOME=.. ../libexec/Macaulay2 -q -silent '-ephase=2' @srcdir@/setup.m2 '-eexit(0)' + env -i M2HOME=.. ../libexec/Macaulay2 -q -silent '-ephase=2' @srcdir@/setup.m2 '-eexit(0)' mv ../cache/Macaulay2-tmp ../cache/Macaulay2-pre ## .gdbinit justM2 all:: .gdbinit .gdb-files .gdb-run-it -gdb: .gdbinit .gdb-files; env M2HOME=.. gdb ../libexec/Macaulay2 +gdb: .gdbinit .gdb-files; env -i M2HOME=.. gdb ../libexec/Macaulay2 .gdbinit: .gdbinit.$(USER); cp $< $@ clean::; rm -f .gdbinit .gdbinit.$(USER):; cp @srcdir@/.gdbinit.dan $@ @@ -148,7 +148,7 @@ umount /a.ext2 profile : gmon.out - env M2HOME=.. gprof ../libexec/Macaulay2 >profile + env -i M2HOME=.. gprof ../libexec/Macaulay2 >profile clean ::; rm -f profile INPUTS := cache/doc/sample cache/doc/expression @@ -165,7 +165,7 @@ $(MADEM2FILES) $(INPUTS) $(DOCSEQUENCE) $(TUTORIALS) rm -f ../cache/Macaulay2-tmp # phase 4: make $@ - env M2HOME=.. ../libexec/Macaulay2 -q -silent '-ephase=4' @srcdir@/setup.m2 '-eexit(0)' + env -i M2HOME=.. ../libexec/Macaulay2 -q -silent '-ephase=4' @srcdir@/setup.m2 '-eexit(0)' mv ../cache/Macaulay2-tmp ../cache/Macaulay2-doc ifdef NEWENGINE diff -ruN Macaulay2-0.9.2/Macaulay2/m2/Makefile.tests Macaulay2-0.9.2-patched/Macaulay2/m2/Makefile.tests --- Macaulay2-0.9.2/Macaulay2/m2/Makefile.tests Wed Aug 15 21:35:58 2001 +++ Macaulay2-0.9.2-patched/Macaulay2/m2/Makefile.tests Wed May 7 08:58:13 2003 @@ -31,7 +31,7 @@ %.okay : %.m2 @ echo testing $< - @ env M2HOME=../../.. ../../../libexec/Macaulay2 $(ARGS) $< '-eexit(0)' + @ env -i M2HOME=../../.. ../../../libexec/Macaulay2 $(ARGS) $< '-eexit(0)' @ touch $@ TESTFILES := $(wildcard *.m2) diff -ruN Macaulay2-0.9.2/bin/M2-build.in Macaulay2-0.9.2-patched/bin/M2-build.in --- Macaulay2-0.9.2/bin/M2-build.in Mon Aug 20 23:25:24 2001 +++ Macaulay2-0.9.2-patched/bin/M2-build.in Wed May 7 09:00:55 2003 @@ -23,11 +23,11 @@ M2PATH= if [ -f "$DATA" ] -then exec "$EXE" "-e loaddata \"$DATA\"" -- \ +then exec env -i M2HOME="$M2HOME" "$EXE" "-e loaddata \"$DATA\"" -- \ "-e runStartFunctions()" \ "-e path = join(path,{ \"$SRCHOME/m2/\", \"$SRCHOME/packages/\", \"$SRCHOME/experiments/\" })" \ "$@" -else exec "$EXE" "-e path = { \"$SRCHOME/m2/\", \"$M2HOME/m2/\" }" \ +else exec env -i M2HOME="$M2HOME" "$EXE" "-e path = { \"$SRCHOME/m2/\", \"$M2HOME/m2/\" }" \ "-e phase=1" "$SETUP" "-e phase=0" \ "-e runStartFunctions()" \ "$@" diff -ruN Macaulay2-0.9.2/bin/M2-final.in Macaulay2-0.9.2-patched/bin/M2-final.in --- Macaulay2-0.9.2/bin/M2-final.in Wed Aug 15 09:52:20 2001 +++ Macaulay2-0.9.2-patched/bin/M2-final.in Wed May 7 09:00:12 2003 @@ -5,6 +5,6 @@ DATA="$M2HOME/libexec/Macaulay2-`uname -m |sed s=/=-=g`-data" SETUP="$M2HOME/m2/setup.m2" if [ -f "$DATA" ] -then exec "$EXE" "-e loaddata \"$DATA\"" -- "-e runStartFunctions()" "$@" -else exec "$EXE" -ephase=1 "$SETUP" -ephase=0 "-e runStartFunctions()" "$@" +then exec env -i M2HOME="$M2HOME" "$EXE" "-e loaddata \"$DATA\"" -- "-e runStartFunctions()" "$@" +else exec env -i M2HOME="$M2HOME" "$EXE" -ephase=1 "$SETUP" -ephase=0 "-e runStartFunctions()" "$@" fi diff -ruN Macaulay2-0.9.2/configure.ac Macaulay2-0.9.2-patched/configure.ac --- Macaulay2-0.9.2/configure.ac Wed Jan 9 11:21:34 2002 +++ Macaulay2-0.9.2-patched/configure.ac Wed May 7 08:58:13 2003 @@ -26,7 +26,7 @@ sed -e '/^$/d' -e 's/^/ /' confdefs.h >&6 ]) -AC_DEFUN(M2_CONFIGURED_FILES,m4_patsubst(m4_include(config/files),[ +AC_DEFUN(M2_CONFIGURED_FILES,patsubst(m4_include(config/files),[ ],[ ])) echo "any environment variables set:" @@ -164,9 +164,10 @@ GC_FOR_NEW="$enableval", GC_FOR_NEW=no) -AC_CHECK_FUNC(__finite,,AC_DEFINE(__finite,finite,whether __finite is missing)) -AC_CHECK_FUNC(__isnan,,AC_DEFINE(__isnan,isnan,whether __isnan is missing)) -AC_CHECK_FUNC(__isinf,,AC_DEFINE(__isinf,isinf,whether __isinf is missing)) +AC_CHECK_DECL(__finite,,AC_DEFINE(__finite,finite,whether __finite is missing),[#include ]) +AC_CHECK_DECL(__isnan,,AC_DEFINE(__isnan,isnan,whether __isnan is missing),[#include ]) +AC_CHECK_DECL(__isinf,,AC_DEFINE(__isinf,isinf,whether __isinf is missing),[#include ]) +AC_CHECK_DECLS(sys_nerr) OLIBS="$LIBS" LIBS="$LIBS -lgmp -lgc -lgdbm -lcf -lfac"