Ticket #10303: trac_10303-scripts-SAGE64.v5.patch

File trac_10303-scripts-SAGE64.v5.patch, 7.4 KB (added by jhpalmieri, 10 years ago)

scripts repo

  • sage-build

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1301349838 25200
    # Node ID 0efa89399e953e205e46172e44e336080d89f90a
    # Parent  8ec709e3f7ca3146f6ed7b1b4fb2488e4a5ff854
    #10303: clean up use of SAGE64.
    Only call sage-check-64 in sage-spkg, sage-build, and spkg/install,
    not in sage-env.  Also fix a few typos and add some comments to
    sage-env.
    
    diff -r 8ec709e3f7ca -r 0efa89399e95 sage-build
    a b if [ ! -d "$SAGE_ROOT/devel/sage" ]; the 
    8282    exit 1
    8383fi
    8484
     85# Check whether this seems to a 64-bit build:
     86. "$SAGE_LOCAL"/bin/sage-check-64
     87
     88if [ $? -ne 0 ]; then
     89    exit 1
     90fi
     91
    8592if [ $DO_BUILD_ALL = 1 ]; then
    8693   CUR=`pwd`
    8794   cd "$SAGE_ROOT/devel/sage/sage"
    if [ $DO_BUILD_ALL = 1 ]; then 
    98105   cd "$CUR"
    99106fi
    100107
    101 # In case SAGE64 has been set to yes before re-inject it into the environment
    102 # This is only done on OSX and Solaris since those are the only real multi lib
    103 # arches we support. Eventually Linux PPC on the PS3 might need to be added here
    104 source $SAGE_LOCAL/bin/sage-check-64
    105 
    106108build "sage"
  • sage-check-64

    diff -r 8ec709e3f7ca -r 0efa89399e95 sage-check-64
    a b  
    55# it does not exist create the directory and then create a file sage-64.txt
    66# Eventually Linux PPC on the PS3 might need to be added here
    77
     8if [ -z "$SAGE64" ]; then
     9    SAGE64="no"
     10fi
     11
     12if [ "$SAGE64" != "yes" -a "$SAGE64" != "no" ]; then
     13    echo "The environment variable SAGE64 (=$SAGE64) must be either unset, yes or no."
     14    exit 1
     15fi
     16
    817if [ "$SAGE64" = "yes" ]; then
    918    CHECKFILE="no"
    1019    if [ `uname` = "SunOS" ]; then
    if [ "$SAGE64" = "yes" ]; then 
    1625        CHECKFILE="yes"
    1726    fi
    1827    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
     28        mkdir -p "$SAGE_LOCAL"/lib
     29        if ! [ -f "$SAGE_LOCAL"/lib/sage-64.txt ]; then
     30            echo "Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist"
     31            touch "$SAGE_LOCAL"/lib/sage-64.txt
    2232        fi
    23         echo "Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist"
    24         touch "$SAGE_LOCAL"/lib/sage-64.txt
    2533    fi
    2634fi
    2735
    if [ -a "$SAGE_LOCAL"/lib/sage-64.txt ]; 
    3240    echo "Detected SAGE64 flag"
    3341    if [ `uname` = "SunOS" ]; then
    3442        echo "Building Sage on Solaris in 64-bit mode"
    35         SAGE64="yes"; export SAGE64
     43        SAGE64="yes"
    3644    fi
    3745    if [ `uname` = "Darwin" ]; then
    3846        echo "Building Sage on OS X in 64-bit mode"
    39         SAGE64="yes"; export SAGE64
     47        SAGE64="yes"
    4048    fi
    4149fi
    4250
     51export SAGE64
  • sage-env

    diff -r 8ec709e3f7ca -r 0efa89399e95 sage-env
    a b fi 
    8787
    8888
    8989if [ 1 = 2 ]; then
    90     echo "The following enviroment variables can be set by the user"
     90    echo
     91    echo "WARNING: At least some of the following information is outdated."
     92    echo "See the Sage installation guide for more up-to-date information"
     93    echo "about environment variables related to Sage."
     94    echo
     95    echo "The following environment variables can be set by the user"
    9196    echo "AR          The archiver (e.g. ar, /usr/ccs/bin/ar or /usr/bin/ar)"
    9297    echo "AS          The assembler (e.g. as, /usr/ccs/bin/as or /usr/bin/as)"
    9398    echo "CC          The C compiler (e.g cc, /opt/SUNWspro/bin/cc or /usr/bin/gcc)"
    if [ 1 = 2 ]; then 
    101106    echo "MAKE        The make program (e.g. make, /usr/bin/make or /usr/local/bin/gmake)"
    102107    echo "MAKEFLAGS   Flag(s) to make (e.g. -j4)."
    103108    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)"
    105109    echo "SHAREDFLAGS Flag(s) necessary for building a shared library (e.g. -fPIC or -xcode=pic32)"
    106     echo "We attempt to set this to sensible values, but check below to"
     110    echo "We attempt to set these to sensible values, but check below to"
    107111    echo "ensure they are OK. If you wish to override any then please use:"
    108     echo "setenv NAME_OF_ENVIROMENT_VARIABLE value_of_enviroment_variable"
     112    echo "setenv NAME_OF_ENVIRONMENT_VARIABLE value_of_environment_variable"
    109113    echo "(if you use tcsh, csh or a similar shell) or"
    110     echo "NAME_OF_ENVIROMENT_VARIABLE value_of_enviroment_variable"
    111     echo "export NAME_OF_ENVIROMENT_VARIABLE"
     114    echo "NAME_OF_ENVIRONMENT_VARIABLE=value_of_environment_variable"
     115    echo "export NAME_OF_ENVIRONMENT_VARIABLE"
    112116    echo "if you use sh, bash or a similar shell"
     117    echo
     118    echo "See also the Sage installation guide for a list of Sage-specific"
     119    echo "environment variables which you can set to control the build process"
     120    echo "or other aspects of Sage's behavior."
     121    echo
    113122fi
    114123
    115124# Setting Sage-related location environment variables.
    fi 
    245254# This could be used in code to make special changes only when
    246255# code is being built as part of Sage.
    247256__sage__="" && export __sage__
    248 # Set the default compiler to gcc if the enviroment variable
     257# Set the default compiler to gcc if the environment variable
    249258# CC is not set.
    250259if [ "$CC" = "" ]; then
    251260     CC="gcc"         && export CC
    if [ "$LDFLAGS" = "" ]; then 
    275284    LDFLAGS=""          && export LDFLAGS
    276285fi
    277286
    278 if [ "$SAGE64" = "" ]; then
    279     SAGE64="no"
    280 fi
    281 
    282 if [ "$SAGE64" != "yes" -a "$SAGE64" != "no" ]; then
    283     echo "The environment variable SAGE64 (=$SAGE64) must be either unset, yes or no."
    284     return 1
    285 fi
    286 
    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 1> /dev/null 2> /dev/null
    291 export SAGE64
    292 
    293287if [ "$CXXFLAGS" = "" ]; then
    294288   CXXFLAGS="$CFLAGS"
    295289fi
    echo "LN=$LN" 
    361355echo "MAKE=$MAKE"
    362356echo "MAKEFLAGS=$MAKEFLAGS (MFLAGS will be exported the same too)"
    363357echo "RANLIB=$RANLIB"
    364 echo "SAGE64=$SAGE64"
    365358echo "SHAREDFLAGS=$SHAREDFLAGS"
    366359echo "If any of the above are wrong, or are not optimal, override"
    367 echo "them by setting the appropiate enviroment variable."
     360echo "them by setting the appropiate environment variable."
    368361fi
  • sage-make_devel_packages

    diff -r 8ec709e3f7ca -r 0efa89399e95 sage-make_devel_packages
    a b mkdir "$SCRIPTS" 
    139139chmod +x sage-*
    140140chmod -x sage-README-osx.txt sage-banner sage-gdb-commands
    141141chmod -x sage-maxima.lisp sage-verify-pyc
     142chmod -x sage-check-64
    142143rm sage-*~
    143144
    144145cp -pr sage-* .hg* ipy_profile_sage.py "$SCRIPTS"/
  • sage-sdist

    diff -r 8ec709e3f7ca -r 0efa89399e95 sage-sdist
    a b cd "$CUR" 
    6767cp "$SAGE_ROOT"/local/bin/sage-spkg "$PKGDIR"/base/
    6868cp "$SAGE_ROOT"/local/bin/sage-env "$PKGDIR"/base/
    6969cp "$SAGE_ROOT"/local/bin/sage-make_relative "$PKGDIR"/base/
     70cp "$SAGE_ROOT"/local/bin/sage-check-64 "$PKGDIR"/base/
    7071
    7172TMP="/tmp/$TARGET"
    7273
  • sage-spkg

    diff -r 8ec709e3f7ca -r 0efa89399e95 sage-spkg
    a b uname -a 
    315315if [ $? -ne 0 ]; then
    316316    echo "Unable to determine host system information."
    317317fi
     318# Check whether this seems to a 64-bit build:
     319. "$SAGE_LOCAL"/bin/sage-check-64
     320if [ $? -ne 0 ]; then
     321    exit 1
     322fi
    318323echo "****************************************************"
    319324
    320325echo "****************************************************"