Ticket #10303: trac_10303-scripts-SAGE64.patch

File trac_10303-scripts-SAGE64.patch, 6.1 KB (added by jhpalmieri, 11 years ago)

scripts repo

  • sage-build

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1290300088 28800
    # Node ID 038c726270285ec6de634bff941002ddeacde365
    # Parent  891d88d2265a866223b4085f804808fd12ab523d
    #10303: clean up use of SAGE64. Don't insist that it is only used on Solaris or OS X, only call sage-check-64 in sage-build and sage-spkg, and delete the file SAGE_LOCAL/lib/sage-64.txt if SAGE64 is set to 'no'.
    
    diff -r 891d88d2265a -r 038c72627028 sage-build
    a b if [ $DO_BUILD_ALL = 1 ]; then 
    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
    94 source $SAGE_LOCAL/bin/sage-check-64
     91# Check whether this seems to a 64-bit build:
     92source "$SAGE_LOCAL"/bin/sage-check-64
    9593
    9694build "sage"
  • sage-check-64

    diff -r 891d88d2265a -r 038c72627028 sage-check-64
    a b  
    11#!/usr/bin/env bash
    22
    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
     3# If SAGE64 is set to "yes", make sure $SAGE_LOCAL/lib/sage-64.txt
     4# exists.  If SAGE64 is set to "no", make sure that
     5# $SAGE_LOCAL/lib/sage-64.txt does not exist.  If SAGE64 is not set,
     6# then set it to "yes" if $SAGE_LOCAL/lib/sage-64.txt exists.
    77
    88if [ "$SAGE64" = "yes" ]; then
    9     CHECKFILE="no"
    10     if [ `uname` = "SunOS" ]; then
    11         echo "Building Sage on Solaris in 64-bit mode"
    12         CHECKFILE="yes"
     9    case `uname` in
     10        "SunOS")
     11            echo "Building Sage on Solaris in 64-bit mode";;
     12        "Darwin")
     13            echo "Building Sage on OS X in 64-bit mode";;
     14        *)
     15            echo "Building Sage in 64-bit mode";;
     16    esac
     17    if ! [ -d "$SAGE_LOCAL"/lib ]; then
     18        echo "Creating SAGE_LOCAL/lib since it does not exist"
     19        mkdir "$SAGE_LOCAL"/lib
    1320    fi
    14     if [ `uname` = "Darwin" ]; then
    15         echo "Building Sage on OS X in 64-bit mode"
    16         CHECKFILE="yes"
     21   
     22    if ! [ -a "$SAGE_LOCAL"/lib/sage-64.txt ]; then
     23        echo "Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist"
     24        touch "$SAGE_LOCAL"/lib/sage-64.txt
    1725    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
     26elif [ "$SAGE64" = "no" ]; then
     27    # User has declared this build to *not* be 64-bit, so delete
     28    # sage-64.txt.
     29    if [ -a "$SAGE_LOCAL"/lib/sage-64.txt ]; then
     30        echo "SAGE64 set to no.  Deleting SAGE_LOCAL/lib/sage-64.txt."
     31    fi
     32    rm -f "$SAGE_LOCAL"/lib/sage-64.txt
     33else
     34    # SAGE64 is not set, so check if SAGE_LOCAL/lib/sage-64.txt
     35    # exists.  If it does, set SAGE64 to "yes".
     36    if [ -a "$SAGE_LOCAL"/lib/sage-64.txt ]; then
     37        echo "File SAGE_LOCAL/lib/sage-64.txt detected."
     38        case `uname` in
     39            "Darwin")
     40                echo "Building Sage on Solaris in 64-bit mode.";;
     41            "SunOS")
     42                echo "Building Sage on OS X in 64-bit mode.";;
     43            *)
     44                echo "Building Sage in 64-bit mode.";;
     45        esac
     46        SAGE64="yes"
     47        export SAGE64
    2548    fi
    2649fi
    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 
    31 if [ -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 OS X in 64-bit mode"
    39         SAGE64="yes"; export SAGE64
    40     fi
    41 fi
    42 
  • sage-env

    diff -r 891d88d2265a -r 038c72627028 sage-env
    a b if [ 1 = 2 ]; then 
    101101    echo "MAKE        The make program (e.g. make, /usr/bin/make or /usr/local/bin/gmake)"
    102102    echo "MAKEFLAGS   Flag(s) to make (e.g. -j4)."
    103103    echo "RANLIB      Archiver ranlib (e.g. ranlib, /usr/ccs/bin/ranlib etc)"
    104     echo "SAGE64      Set to \"yes\" to build a 64-bit binary (Solaris SPARC or Solaris x86 only)"
     104    echo "SAGE64      Set to \"yes\" to build a 64-bit binary"
    105105    echo "SHAREDFLAGS Flag(s) necessary for building a shared library (e.g. -fPIC or -xcode=pic32)"
    106106    echo "We attempt to set this to sensible values, but check below to"
    107107    echo "ensure they are OK. If you wish to override any then please use:"
    if [ "$LDFLAGS" = "" ]; then 
    275275    LDFLAGS=""          && export LDFLAGS
    276276fi
    277277
     278# SAGE64 is used in the script sage-check-64, which is called by
     279# sage-spkg before executing each spkg's spkg-install file.  It is
     280# also called by sage-build.
    278281if [ "$SAGE64" = "" ]; then
    279282    SAGE64="no"
    280283fi
    if [ "$SAGE64" != "yes" -a "$SAGE64" !=  
    284287    exit 1
    285288fi
    286289
    287 # In case SAGE64 has been set to yes before re-inject it into the environment
    288 # This is only done on OSX and Solaris since those are the only real multi lib
    289 # arches we support. Eventually Linux PPC on the PS3 might need to be added here
    290 source $SAGE_LOCAL/bin/sage-check-64 2> /dev/null
    291290export SAGE64
    292291
    293292if [ "$CXXFLAGS" = "" ]; then
  • sage-sdist

    diff -r 891d88d2265a -r 038c72627028 sage-sdist
    a b cd "$CUR" 
    3939cp $SAGE_ROOT/local/bin/sage-spkg $PKGDIR/base/
    4040cp $SAGE_ROOT/local/bin/sage-env  $PKGDIR/base/
    4141cp $SAGE_ROOT/local/bin/sage-make_relative $PKGDIR/base/
     42cp $SAGE_ROOT/local/bin/sage-check-64 $PKGDIR/base/
    4243
    4344TMP="/tmp/$TARGET"
    4445
  • sage-spkg

    diff -r 891d88d2265a -r 038c72627028 sage-spkg
    a b uname -a 
    311311if [ $? -ne 0 ]; then
    312312    echo "Unable to determine host system information."
    313313fi
     314# Check whether this seems to a 64-bit build:
     315source "$SAGE_LOCAL"/bin/sage-check-64
    314316echo "****************************************************"
    315317
    316318echo "****************************************************"