Ticket #9958: trac_9958-build-sage_clib.patch

File trac_9958-build-sage_clib.patch, 2.0 KB (added by fbissey, 10 years ago)

let's not forget the hardcoded version of python in SConstruct for sage_clib

  • c_lib/SConstruct

    # HG changeset patch
    # User Francois Bissey <francois.bissey@canterbury.ac.nz>
    # Date 1306203515 -43200
    # Node ID c8177a3cd82e4a23ad7aba7a3a574950e6791e76
    # Parent  502d88d966cb338774726af2a7963ca393aae4e2
    #9958 updade SConstruct to use current python instead of having a hardcoded value.
    
    diff --git a/c_lib/SConstruct b/c_lib/SConstruct
    a b  
    3535## subdirectories, and $SAGE_ROOT/local/include has a link into
    3636## this directory.
    3737##
    38 import os
     38import os, sys
    3939
    4040# Note that SCons's strong point is not the './configure' step of
    4141# autotools.  However, for this build we know that we are in a
     
    118118# SCons doesn't automatically pull in system environment variables
    119119# However, we only need SAGE_LOCAL, so that's easy.
    120120env['SAGE_LOCAL'] = os.environ['SAGE_LOCAL']
    121 if os.environ.has_key('SAGE_DEBIAN'):
    122     env['SAGE_LOCAL'] = '/usr'
     121
     122# Get the python version number. We want this to be a bit more resistant to major
     123# change of version.
     124env['PYV']=sys.version[:3]
    123125
    124126# The SCons convenience function Split is the only strange thing
    125127# to python programmers. It just makes a list by splitting on
    126128# whitespace without the syntax clutter of lists of strings.
    127 includes = ['$SAGE_LOCAL/include/', '$SAGE_LOCAL/include/python2.6/',
     129includes = ['$SAGE_LOCAL/include/', '$SAGE_LOCAL/include/python$PYV/',
    128130            '$SAGE_LOCAL/include/NTL/', 'include']
    129131cFiles = Split( "convert.c  interrupt.c  memory.c  mpn_pylong.c  mpz_pylong.c") + \
    130132         Split( "mpz_longlong.c stdsage.c  gmp_globals.c" )
     
    132134srcFiles = cFiles + cppFiles
    133135
    134136lib = env.SharedLibrary( "csage", [ "src/" + x for x in srcFiles ],
    135                          LIBS=['ntl', 'pari', 'gmp', 'python2.6'],
     137                         LIBS=['ntl', 'pari', 'gmp', 'python$PYV'],
    136138                         LIBPATH=['$SAGE_LOCAL/lib','$SAGE_LOCAL/lib/python/config/'],
    137139                         CPPPATH=includes )
    138140env.Install("$SAGE_LOCAL/lib", lib)