# HG changeset patch
# User David Kirkby <david.kirkby@onetel.net>
# Date 1278849860 -3600
# Node ID 6f6ed829c14c903a3a28bc6f50415d181e63d595
# Parent  e8eac19d18ce2fcf24381b540633e375da94b085
#9474 Revert ECL back to ecl-10.2.1 and apply patches for Solaris 10 and OpenSolaris x64

diff -r e8eac19d18ce -r 6f6ed829c14c SPKG.txt
--- a/SPKG.txt	Sun Feb 14 23:07:18 2010 -0800
+++ b/SPKG.txt	Sun Jul 11 13:04:20 2010 +0100
@@ -45,6 +45,16 @@
 
 == Changelog ==
 
+=== ecl-10.2.1.p0 (David Kirkby, 11th July 2010) ===
+  * #9474 Revert ECL back to version 10.2.1 (along with Maxima too)
+    since some Maxima tests have failed on sage.math. 
+  * #8089 Add the configure option '--with-dffi=no' on 
+    OpenSolaris on the x86 processor. This disables assembly code. 
+    This was originally #8089, but is back-ported to 10.2.1
+  * Delete temp files in /tmp, as they cause problems building 
+    ECL in a multi-user environment. This was originally 
+    #8951
+    
 === ecl-10.2.1 (William Stein, 14 February 2010) ===
   * Upgrade to latest stable upstream release.
 
diff -r e8eac19d18ce -r 6f6ed829c14c spkg-install
--- a/spkg-install	Sun Feb 14 23:07:18 2010 -0800
+++ b/spkg-install	Sun Jul 11 13:04:20 2010 +0100
@@ -22,8 +22,8 @@
 CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include"
 LDFLAGS="$LDFLAGS -L$SAGE_LOCAL/lib"
 
-# Compile for 64-bit if SAGE64 is set to 'yes' or '1'
-if [ "x$SAGE64" = "xyes" ] || [ "x$SAGE64" = "x1" ]  ; then
+# Compile for 64-bit if SAGE64 is set to 'yes' 
+if [ "x$SAGE64" = "xyes" ]  ; then
    echo "Building a 64-bit version of ECL"
    CFLAGS="$CFLAGS -m64 "
    CXXFLAGS="$CXXFLAGS -m64 "
@@ -32,8 +32,6 @@
    # Some packages may need LDFLAGS and/or ABI set here. 
    LDFLAGS="$LDFLAGS -m64 "
    ABI=64
-else
-   echo "Building a 32-bit version of ECL"
 fi
 
 # If SAGE_DEBUG is set either unset (the default), or set to  'yes'
@@ -158,7 +156,18 @@
 
 cd src
 
-./configure --prefix=$SAGE_LOCAL 
+if [ "x`uname -rsm`" = "xSunOS 5.11 i86pc" ] && [ "x$SAGE64" = xyes ]  ; then
+   # Need to add --with-dffi=no to disable assembly code on OpenSolaris x64. 
+   # This may be needed for other variants of Solaris, but for now at least
+   # the option is only given if all the following are true
+   # 1) OpenSolaris (SunOS 5.11)
+   # 2) Intel or AMD CPU 
+   # 3) 64-bit build
+   ./configure --prefix=$SAGE_LOCAL --with-dffi=no
+else
+   ./configure --prefix=$SAGE_LOCAL 
+fi
+
 if [ $? -ne 0 ]; then
    echo "Failed to configure ECL ... exiting"
    exit 1
@@ -170,6 +179,17 @@
    exit 1
 fi
 
+# The following is a TEMPORARY hack, needed to ensure ECL has a higher
+# probability of building on Solaris. There's a bug in ECL which means it
+# makes an assumption about temporary files which is not correct (neither
+# by POSIX standards or Solaris). This stops a build some times if 
+# multiple people use a Solaris machine as temporary files created by one user
+# can't be removed by another. 
+
+if [ "x$UNAME" = xSunOs ] ; then
+  rm -f /tmp/ECL*
+fi
+
 # Remove old install of ecl, if any.
 rm -rf "$SAGE_LOCAL/lib/ecl-"*
 if [ $? -ne 0 ]; then
