Ticket #22: trac_22.patch

File trac_22.patch, 3.0 KB (added by Michael Abshoff, 14 years ago)
  • sage-build

    # 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 b  
    8888   cd "$CUR"
    8989fi
    9090
     91# In case SAGE64 has been set to yes before re-inject it into the environment
     92# This is only done on OSX and Solaris since those are the only real multi lib
     93# arches we support. Eventually Linux PPC on the PS3 might need to be added here
     94source $SAGE_LOCAL/bin/sage-check-64
     95
    9196build "sage"
  • new file sage-check-64

    diff -r d1e7ff942186 -r 7b38408333aa sage-check-64
    - +  
     1#!/usr/bin/env/bash
     2
     3# If SAGE64 is set to yes check if $SAGE_LOCAL/lib exists on Solaris as well as
     4# OSX since those are currently the only two platforms which require SAGE64. If
     5# it does not exist create the directory and then create a file sage-64.txt
     6# Eventually Linux PPC on the PS3 might need to be added here
     7
     8if [ "$SAGE64" = "yes" ]; then
     9    CHECKFILE="no"
     10    if [ `uname` = "SunOS" ]; then
     11        echo "Building Sage on Solaris in 64 bit mode"
     12        CHECKFILE="yes"
     13    fi
     14    if [ `uname` = "Darwin" ]; then
     15        echo "Building Sage on OSX in 64 bit mode"
     16        CHECKFILE="yes"
     17    fi
     18    if [ $CHECKFILE = "yes" ]; then
     19        if ! [ -d "$SAGE_LOCAL"/lib ]; then
     20            echo "Creating SAGE_LOCAL/lib since it does not exist"
     21            mkdir "$SAGE_LOCAL"/lib
     22        fi
     23        echo "Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist"
     24        touch "$SAGE_LOCAL"/lib/sage-64.txt
     25    fi
     26fi
     27
     28# Check if SAGE_LOCAL/lib/sage-64.txt exists. If it does on Solaris and OSX
     29# force the setting of SAGE64
     30
     31if [ -a "$SAGE_LOCAL"/lib/sage-64.txt ]; then
     32    echo "Detected SAGE64 flag"
     33    if [ `uname` = "SunOS" ]; then
     34        echo "Building Sage on Solaris in 64 bit mode"
     35        SAGE64="yes"; export SAGE64
     36    fi
     37    if [ `uname` = "Darwin" ]; then
     38        echo "Building Sage on OSX in 64 bit mode"
     39        SAGE64="yes"; export SAGE64
     40    fi
     41fi
     42
  • sage-env

    diff -r d1e7ff942186 -r 7b38408333aa sage-env
    a b  
    245245    exit 1
    246246fi
    247247
    248 # Sets a compiler flag to make a 64-bit executable.
    249 # Generic gcc option.
    250 if [ "$SAGE64" = "yes" -a CC = "gcc" ]; then
    251    CFLAGS="$CFLAGS -m64"
    252 fi
     248# In case SAGE64 has been set to yes before re-inject it into the environment
     249# This is only done on OSX and Solaris since those are the only real multi lib
     250# arches we support. Eventually Linux PPC on the PS3 might need to be added here
     251source $SAGE_LOCAL/bin/sage-check-64
    253252
    254253# Specific to a Sun running Solaris on SPARC hardware.
    255254if [ "$SAGE64" = "yes" -a "$CC" = "cc" ]; then