# HG changeset patch
# User mabshoff@sage.math.washington.edu
# Date 1232126571 28800
# Node ID 7b38408333aa825e23cae7d02f863951657047ba
# Parent d1e7ff942186b9291e36eb4ec1d7c4e0137721df
Add support for a persistent SAGE64 on Solaris and OSX
diff -r d1e7ff942186 -r 7b38408333aa sage-build
--- a/sage-build Mon Jan 05 23:05:33 2009 -0800
+++ b/sage-build Fri Jan 16 09:22:51 2009 -0800
@@ -88,4 +88,9 @@
cd "$CUR"
fi
+# In case SAGE64 has been set to yes before re-inject it into the environment
+# This is only done on OSX and Solaris since those are the only real multi lib
+# arches we support. Eventually Linux PPC on the PS3 might need to be added here
+source $SAGE_LOCAL/bin/sage-check-64
+
build "sage"
diff -r d1e7ff942186 -r 7b38408333aa sage-check-64
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sage-check-64 Fri Jan 16 09:22:51 2009 -0800
@@ -0,0 +1,42 @@
+#!/usr/bin/env/bash
+
+# If SAGE64 is set to yes check if $SAGE_LOCAL/lib exists on Solaris as well as
+# OSX since those are currently the only two platforms which require SAGE64. If
+# it does not exist create the directory and then create a file sage-64.txt
+# Eventually Linux PPC on the PS3 might need to be added here
+
+if [ "$SAGE64" = "yes" ]; then
+ CHECKFILE="no"
+ if [ `uname` = "SunOS" ]; then
+ echo "Building Sage on Solaris in 64 bit mode"
+ CHECKFILE="yes"
+ fi
+ if [ `uname` = "Darwin" ]; then
+ echo "Building Sage on OSX in 64 bit mode"
+ CHECKFILE="yes"
+ fi
+ if [ $CHECKFILE = "yes" ]; then
+ if ! [ -d "$SAGE_LOCAL"/lib ]; then
+ echo "Creating SAGE_LOCAL/lib since it does not exist"
+ mkdir "$SAGE_LOCAL"/lib
+ fi
+ echo "Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist"
+ touch "$SAGE_LOCAL"/lib/sage-64.txt
+ fi
+fi
+
+# Check if SAGE_LOCAL/lib/sage-64.txt exists. If it does on Solaris and OSX
+# force the setting of SAGE64
+
+if [ -a "$SAGE_LOCAL"/lib/sage-64.txt ]; then
+ echo "Detected SAGE64 flag"
+ if [ `uname` = "SunOS" ]; then
+ echo "Building Sage on Solaris in 64 bit mode"
+ SAGE64="yes"; export SAGE64
+ fi
+ if [ `uname` = "Darwin" ]; then
+ echo "Building Sage on OSX in 64 bit mode"
+ SAGE64="yes"; export SAGE64
+ fi
+fi
+
diff -r d1e7ff942186 -r 7b38408333aa sage-env
--- a/sage-env Mon Jan 05 23:05:33 2009 -0800
+++ b/sage-env Fri Jan 16 09:22:51 2009 -0800
@@ -245,11 +245,10 @@
exit 1
fi
-# Sets a compiler flag to make a 64-bit executable.
-# Generic gcc option.
-if [ "$SAGE64" = "yes" -a CC = "gcc" ]; then
- CFLAGS="$CFLAGS -m64"
-fi
+# In case SAGE64 has been set to yes before re-inject it into the environment
+# This is only done on OSX and Solaris since those are the only real multi lib
+# arches we support. Eventually Linux PPC on the PS3 might need to be added here
+source $SAGE_LOCAL/bin/sage-check-64
# Specific to a Sun running Solaris on SPARC hardware.
if [ "$SAGE64" = "yes" -a "$CC" = "cc" ]; then