Ticket #9523: 9523-update-readline.patch

File 9523-update-readline.patch, 10.4 KB (added by drkirkby, 11 years ago)

Mercurial patch - adds a rather useless spkg-check file, cleans the package a little.

  • SPKG.txt

    # HG changeset patch
    # User David Kirkby <david.kirkby@onetel.net>
    # Date 1287917793 -3600
    # Node ID e6cb35408f40ca9ca8b0f5d64bbb51750dfb5cac
    # Parent  894db1d3de14955fd48aec4c071cc729a5d6fb80
    #9523 Upgrade the Readline spkg to version 6.1 and clean up the package a little.
    
    diff -r 894db1d3de14 -r e6cb35408f40 SPKG.txt
    a b  
    3333   since it took tons of space; didn't delete anything else.
    3434 * Work around some MacOSX dynamic lib flags
    3535
     36== readline-6.1 (David Kirkby, 24th October 2010) ==
     37 * Update to latest version #9523
     38 * Removed a hack for Arch Linux, as this is no longer needed
     39   with the latest readline (see #9523)
     40 * Removed some commented out code from spkg-install - the file
     41   was big enough without even more things.
     42 * Removed checks that there was not a mix of Sun and
     43   GNU compilers. This is a bit pointless now, as
     44   the 'prereq' script does this.
     45 * Removed checks that SAGE_FORTRAN_LIB exits - again
     46   this is taken care of in one place, and does not need
     47   to be in every single .spkg file.
     48 * Removed reference to ABI, FCFLAGS and F77FLAGS since
     49   there's no Fortran in the Readline package, and no ABI
     50   to set.
     51 * No longer check if SAGE64=1, since it can only be set to
     52   "yes" or "no", so restrict the check for "yes"
     53 * Removed a note that a 32-bit build was taking place if
     54   SAGE64 was not set to "yes" or "1". This was in
     55   inaccurate comment, as many systems build 64-bit by
     56   default, and so the comment is inaccurate on many systems.
     57   (Though of course it was harmless).
     58 * Removed an unnecessary semi-colon on the line
     59   echo "SAGE_LOCAL undefined ... exiting"
     60   The semi-colon is on various .spkg files, and seems
     61   to be the result of a bit of code copied from one
     62   package to another.
     63 * Updated the file to patch support/shobj-conf (done for
     64   FreeBSD), since this file has changed in the latest source
     65   code for readline. This should be reported upstream if it
     66   has not already been done. It is pointless us patching
     67   a file every time, if there's a bug in it that could be
     68   solved in the upstream source code.
     69 * Add an spkg-check file, though it does nothing useful,
     70   as there are no self-tests. However, there is a 'check'
     71   target, so running 'make check' does not generate an
     72   error, but instead reports there is nothing to be done.
     73
    3674== readline-6.0p2 (Mike Hansen, June 22nd, 2010) ==
    3775 * #7821: readline-6.0.p1 fails on FreeBSD
    3876
  • patches/shobj-conf

    diff -r 894db1d3de14 -r e6cb35408f40 patches/shobj-conf
    a b  
    6464        esac
    6565done
    6666
    67 case "${host_os}-${SHOBJ_CC}" in
     67case "${host_os}-${SHOBJ_CC}-${host_vendor}" in
    6868sunos4*-*gcc*)
    6969        SHOBJ_CFLAGS=-fpic
    7070        SHOBJ_LD=/usr/bin/ld
     
    108108        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
    109109        ;;
    110110
    111 # All versions of Linux or the semi-mythical GNU Hurd.
    112 linux*-*|gnu*-*|k*bsd*-gnu-*)
     111# All versions of Linux (including Gentoo/FreeBSD) or the semi-mythical GNU Hurd.
     112linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo)
    113113        SHOBJ_CFLAGS=-fPIC
    114114        SHOBJ_LD='${CC}'
    115115        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
     
    128128        ;;
    129129
    130130# FreeBSD-3.x ELF
    131 freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
     131freebsd3*|freebsdaout*)
    132132        SHOBJ_CFLAGS=-fPIC
    133133        SHOBJ_LD='${CC}'
    134134
     
    146146        fi
    147147        ;;
    148148
     149# FreeBSD-4.x and later have only ELF
     150freebsd[4-9]*|freebsdelf*|dragonfly*)
     151        SHOBJ_CFLAGS=-fPIC
     152        SHOBJ_LD='${CC}'
     153
     154        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
     155        SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
     156
     157        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
     158        ;;
     159
    149160# Darwin/MacOS X
    150161darwin[89]*|darwin10*)
    151162        SHOBJ_STATUS=supported
  • patches/shobj-conf.patch

    diff -r 894db1d3de14 -r e6cb35408f40 patches/shobj-conf.patch
    a b  
    1 --- ../src/support/shobj-conf   2009-01-04 11:32:42.000000000 -0800
    2 +++ shobj-conf  2010-06-22 15:06:53.000000000 -0700
     1--- src/support/shobj-conf      Wed Oct 28 13:20:21 2009
     2+++ patches/shobj-conf  Sun Oct 24 11:44:08 2010
    33@@ -132,11 +132,12 @@
    44        SHOBJ_CFLAGS=-fPIC
    55        SHOBJ_LD='${CC}'
  • new file spkg-check

    diff -r 894db1d3de14 -r e6cb35408f40 spkg-check
    - +  
     1#!/usr/bin/env bash
     2
     3echo "Unfortunately, there is no way to check this the readline package"
     4echo "as there are no self-tests. However, we will run 'make check'"
     5echo "in case a target is added at a later date"
     6
     7
     8cd src
     9$MAKE check
     10
  • spkg-install

    diff -r 894db1d3de14 -r e6cb35408f40 spkg-install
    a b  
    11#!/usr/bin/env bash
    22###########################################
    3 ## Readline 6.0
     3## Readline 6.1
    44###########################################
    55
    66if [ -z "$SAGE_LOCAL" ] ; then
    7    echo "SAGE_LOCAL undefined ... exiting";
     7   echo "SAGE_LOCAL undefined ... exiting"
    88   echo "Maybe run 'sage -sh'?"
    99   exit 1
    1010fi
     
    2020
    2121CFLAGS="$CFLAGS $OPTIMIZATION_FLAGS "
    2222CXXFLAGS="$CXXFLAGS $OPTIMIZATION_FLAGS "
    23 FCFLAGS="$FCFLAGS $OPTIMIZATION_FLAGS "
    24 F77FLAGS="$F77FLAGS $OPTIMIZATION_FLAGS "
    2523#CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include"
    2624#LDFLAGS="$LDFLAGS -L$SAGE_LOCAL/lib"
    2725
    28 # Compile for 64-bit if SAGE64 is set to 'yes' or '1'
    29 if [ "x$SAGE64" = "xyes" ] || [ "x$SAGE64" = "x1" ] ; then
     26# Compile for 64-bit if SAGE64 is set to 'yes'
     27if [ "x$SAGE64" = xyes ] ; then
    3028   echo "Building a 64-bit version of Readline"
    3129   CFLAGS="$CFLAGS -m64 "
    3230   CXXFLAGS="$CXXFLAGS -m64 "
    33    FCFLAGS="$FCFLAGS -m64 "
    34    F77FLAGS="$F77FLAGS -m64 "
    3531   # Some packages may need LDFLAGS and/or ABI set here.
    3632   LDFLAGS="$LDFLAGS -m64 "
    37    # ABI=64
    38 else
    39    echo "Building a 32-bit version of Readline"
    4033fi
    4134
    4235# If SAGE_DEBUG is set either unset (the default), or set to  'yes'
     
    5043   # no debugging information to be added.
    5144   CFLAGS="$CFLAGS -g "
    5245   CXXFLAGS="$CXXFLAGS -g "
    53    FCFLAGS="$FCFLAGS -g "
    54    F77FLAGS="$F77FLAGS -g "
    5546else
    5647   echo "No debugging information will be used during the build of this package."
    5748   echo "Unset SAGE_DEBUG if you want debugging information present (-g added)."
     
    6152# This test of a compiler is not perfect by any means, but
    6253# is better than nothing.
    6354if "$CC" -flags > /dev/null 2>&1 ; then
    64    SUN_COMPILER=1
     55   echo "Not adding any compiler flags to show extra warnings - Sun compiler is strict enough"
    6556   # The Sun compilers are fussy, and adding extra
    6657   # warnings will just show too many.
    6758else
     
    6960   # Add -Wall to show all warnings.
    7061   CFLAGS="$CFLAGS -Wall "
    7162   CXXFLAGS="$CXXFLAGS -Wall "
    72    FCFLAGS="$FCFLAGS -Wall "
    73    F77FLAGS="$F77FLAGS -Wall "
    74    GNU_COMPILER=1
    75 fi
    76 
    77 # Determine if the C++ compiler is the Sun or GNU compiler.
    78 # Just to check we are not mixing GNU and non-GNU.
    79 if "$CXX" -flags > /dev/null 2>&1 ; then
    80    SUN_COMPILER=1
    81 else
    82    GNU_COMPILER=1
    83 fi
    84 
    85 
    86 # Determine if the Fortran compiler is the Sun or GNU compiler.
    87 if [ -z "$SAGE_FORTRAN" ] ; then
    88    echo "No Fortran compiler has been defined. This is not normally a problem."
    89 else
    90    if "$SAGE_FORTRAN" -flags > /dev/null 2>&1 ;  then
    91       SUN_COMPILER=1
    92    else
    93       GNU_COMPILER=1
    94    fi
    95 fi
    96 
    97 # Check if SAGE_FORTRAN_LIB is defined, that the file actually exists.
    98 # SAGE_FORTRAN_LIB does not always need to be defined, but if it is defined, then
    99 # the file should exist.
    100 
    101 if [ -n "$SAGE_FORTRAN_LIB" ] &&  [ ! -e "$SAGE_FORTRAN_LIB" ]; then
    102    echo "SAGE_FORTRAN_LIB is defined as $SAGE_FORTRAN_LIB, but does not exist."
    103    exit 1
    104 fi
    105 
    106 # Checks that the user is not mixing the Sun and GNU compilers. This problem
    107 # has been seen on code built with the aid of SCons, but in general could
    108 # happen with any code if the user has specified a C compiler but not a C++ one.
    109 # This problem is even more likely to occur with the Fortran compiler - I've done
    110 # it myself when building Sage!
    111 
    112 if [ "x$SUN_COMPILER" = "x1" ] && [ "x$GNU_COMPILER" = "x1" ] ; then
    113    echo "You are mixing the Sun and GNU C/C++/Fortran compilers."
    114    echo "Such a combination will lead to problems."
    115    echo "Check CC, CXX & SAGE_FORTRAN carefully."
    116    echo "Exiting ..."
    117    exit 1
    11863fi
    11964
    12065# These are all used by GNU to specify compilers.
    12166echo "Using CC=$CC"
    12267echo "Using CXX=$CXX"
    123 echo "Using FC=$FC"
    124 echo "Using F77=$F77"
    125 
    126 # Used by Sage in connection with Fortran.
    127 echo "Using SAGE_FORTRAN=$SAGE_FORTRAN"
    128 echo "Using SAGE_FORTRAN_LIB=$SAGE_FORTRAN_LIB"
    12968
    13069# Flags which may be set.
    13170echo "The following environment variables will be exported."
    13271echo "Using CFLAGS=$CFLAGS"
    13372echo "Using CXXFLAGS=$CXXFLAGS"
    134 echo "Using FCFLAGS=$FCFLAGS"
    135 echo "Using F77FLAGS=$F77FLAGS"
    13673echo "Using CPPFLAGS=$CPPFLAGS"
    13774echo "Using LDFLAGS=$LDFLAGS"
    138 echo "Using ABI=$ABI"
    13975echo "configure scripts and/or makefiles might override these later"
    14076echo " "
    14177
    14278# export everything. Probably not necessary in most cases.
    14379export CFLAGS
    14480export CXXFLAGS
    145 export FCFLAGS
    146 export F77FLAGS
    14781export CPPFLAGS
    14882export LDFLAGS
    149 export ABI
    15083
    15184# End of pretty general spkg-install file.
    15285# Now do the specific things needed for this package (Readline)
     
    182115    fi
    183116fi
    184117
    185 # We also check for Arch Linux, since it crashes with "undefined symbol: PC".
    186 # If anyone knows a better way to fix this, please do.
    187 
    188 if [ $UNAME = "Linux" -a -n "`uname -r | grep ARCH`" ]; then
    189     if [ -f "/usr/lib/libreadline.so" ]; then
    190         echo "Copying over system's libreadline."
    191         cp /lib/libreadline.so.* "$SAGE_LOCAL"/lib
    192         exit 0
    193     else
    194         echo "Could not find a system copy of libreadline. Exiting."
    195         exit 1
    196     fi
    197 fi
    198 
    199 
    200118cp patches/shobj-conf src/support/
    201119if [ $? -ne 0 ]; then
    202120    echo "Error copying patch over."
     
    234152  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.so
    235153fi
    236154
    237 # # We only enter this block on openSUSE 11.1.
    238 # if [ $OVERWRITE_READLINE = "true" ]; then
    239 #   echo "Overwriting libreadline.so.6.0 with the system one."
    240 #   rm -f $SAGE_LOCAL/lib/libreadline.so.6.0
    241 #   if [ `uname -p` = "x86_64" ]; then
    242 #     cp /lib64/libreadline.so.* $SAGE_LOCAL/lib
    243 #   else
    244 #     cp /lib/libreadline.so.* $SAGE_LOCAL/lib
    245 #   fi
    246 # fi
    247 
    248155# Make sure that the install worked, despite whatever the error
    249156# code of build was.
    250157if [ -f "$DYLIB_NAME" -a -f "$SAGE_LOCAL"/lib/libreadline.a ]; then