Ticket #9523: 9523-further-cleanup.patch

File 9523-further-cleanup.patch, 6.6 KB (added by drkirkby, 11 years ago)

Mercurial patch to clean up the package a bit more

  • SPKG.txt

    # HG changeset patch
    # User David Kirkby <david.kirkby@onetel.net>
    # Date 1287951693 -3600
    # Node ID 08147120a3429507b3c6870828bcb03b57f88483
    # Parent  e6cb35408f40ca9ca8b0f5d64bbb51750dfb5cac
    #9523 Further clean up of the readline package.
    
    diff -r e6cb35408f40 -r 08147120a342 SPKG.txt
    a b  
    4848 * Removed reference to ABI, FCFLAGS and F77FLAGS since
    4949   there's no Fortran in the Readline package, and no ABI
    5050   to set.
     51 * Removed references to CXX and other C++ related items
     52   as there is no C++ code.
    5153 * No longer check if SAGE64=1, since it can only be set to
    5254   "yes" or "no", so restrict the check for "yes"
    5355 * Removed a note that a 32-bit build was taking place if
     
    7072   as there are no self-tests. However, there is a 'check'
    7173   target, so running 'make check' does not generate an
    7274   error, but instead reports there is nothing to be done.
     75 * Removed set -e and set +e. Used properly these are useful,
     76   but used poorly they are likely to cause more problems than
     77   enough. So these have been removed, as it's clear they were
     78   not being used properly.
     79 * Added support for any compiler flag for 64-bit builds, using
     80   $CFLAG64
     81 * Use compiler options -g -O0 if SAGE_DEBUG=yes. Otherwise use
     82   -g -O2. Other options may be added too. 
     83 * Removed the 'build' function as it was a bit pointless - it takes
     84   less characters to just put the code inline.
     85 * Tested exit code of 'configure', 'make' and 'make install'
     86   separately - no longer run "make install".
     87 * Used $MAKE instead of make, which will allow parallel builds
     88   but will need extensive testing.
     89 * Change name of library from libreadline.so.6.0 to
     90   libreadline.so.6.1 on OpenBSD. This seems logical, but is untested
     91   as I don't have an OpenBSD box around, and currently there's even
     92   less development going into OpenBSD than there is AIX or HP-UX!!
     93   
    7394
    7495== readline-6.0p2 (Mike Hansen, June 22nd, 2010) ==
    7596 * #7821: readline-6.0.p1 fails on FreeBSD
  • spkg-check

    diff -r e6cb35408f40 -r 08147120a342 spkg-check
    a b  
    11#!/usr/bin/env bash
    22
    3 echo "Unfortunately, there is no way to check this the readline package"
     3echo "Unfortunately, there is no way to check the readline package"
    44echo "as there are no self-tests. However, we will run 'make check'"
    5 echo "in case a target is added at a later date"
     5echo "as there is a 'check' target, and we might hope the readline"
     6echo "deveolopers actually add some test code."
    67
    78
    89cd src
  • spkg-install

    diff -r e6cb35408f40 -r 08147120a342 spkg-install
    a b  
    99   exit 1
    1010fi
    1111
    12 set -e
     12if [ "x$CFLAG64" = x ] ; then
     13   CFLAG64=-m64
     14fi
    1315
    1416# Add a sensible default optimisation flag. Change if necessary.
    1517OPTIMIZATION_FLAGS="-O2"
    1618
    17 # Most packages do not need all these set.
    18 # But it is better to do them all each time, rather than omit
    19 # a flag by mistake.
     19# If the user sets CFLAGS, and sets a new optimisation level
     20# such as -O3, then this will take presidence, as most compilers
     21# will take the last option (gcc definately does).
    2022
    21 CFLAGS="$CFLAGS $OPTIMIZATION_FLAGS "
    22 CXXFLAGS="$CXXFLAGS $OPTIMIZATION_FLAGS "
    23 #CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include"
    24 #LDFLAGS="$LDFLAGS -L$SAGE_LOCAL/lib"
     23CFLAGS="$OPTIMIZATION_FLAGS $CFLAGS"
    2524
    2625# Compile for 64-bit if SAGE64 is set to 'yes'
    2726if [ "x$SAGE64" = xyes ] ; then
    2827   echo "Building a 64-bit version of Readline"
    29    CFLAGS="$CFLAGS -m64 "
    30    CXXFLAGS="$CXXFLAGS -m64 "
     28   CFLAGS="$CFLAGS $CFLAG64"
    3129   # Some packages may need LDFLAGS and/or ABI set here.
    32    LDFLAGS="$LDFLAGS -m64 "
     30   LDFLAGS="$LDFLAGS $CFLAG64"
    3331fi
    3432
    35 # If SAGE_DEBUG is set either unset (the default), or set to  'yes'
    36 # then add debugging information.
    37 # Since both the Sun and GNU compilers accept -g to give debugging information,
    38 # there is no need to do anything specific to one compiler or the other.
    39 
    40 if [ "x$SAGE_DEBUG" = "x" ] || [ "x$SAGE_DEBUG" = "xyes" ] ; then
    41    echo "Code will be built with debugging information present. Set 'SAGE_DEBUG' to 'no' if you don't want that."
    42    # Actually anything other than 'yes' or '1' will cause
    43    # no debugging information to be added.
    44    CFLAGS="$CFLAGS -g "
    45    CXXFLAGS="$CXXFLAGS -g "
     33if [ "x$SAGE_DEBUG" = xyes ] ; then
     34   echo "Code will be built with no optimisation to aid debugging"
     35   CFLAGS="$CFLAGS -g -O0"
    4636else
    47    echo "No debugging information will be used during the build of this package."
    48    echo "Unset SAGE_DEBUG if you want debugging information present (-g added)."
     37   CFLAGS="$CFLAGS -g $OPTIMIZATION_FLAGS"
    4938fi
    5039
    5140# Add appropriate flag(s) to show all warnings.
     
    5847else
    5948   # Assume gcc if not the Sun C compiler.
    6049   # Add -Wall to show all warnings.
    61    CFLAGS="$CFLAGS -Wall "
    62    CXXFLAGS="$CXXFLAGS -Wall "
     50   CFLAGS="$CFLAGS -Wall"
    6351fi
    6452
    65 # These are all used by GNU to specify compilers.
    6653echo "Using CC=$CC"
    67 echo "Using CXX=$CXX"
    6854
    6955# Flags which may be set.
    7056echo "The following environment variables will be exported."
    7157echo "Using CFLAGS=$CFLAGS"
    72 echo "Using CXXFLAGS=$CXXFLAGS"
    7358echo "Using CPPFLAGS=$CPPFLAGS"
    7459echo "Using LDFLAGS=$LDFLAGS"
    7560echo "configure scripts and/or makefiles might override these later"
     
    7762
    7863# export everything. Probably not necessary in most cases.
    7964export CFLAGS
    80 export CXXFLAGS
    8165export CPPFLAGS
    8266export LDFLAGS
    8367
     
    121105    exit 1
    122106fi
    123107
    124 cd src/
     108cd src
    125109
    126 build()
    127 {
    128     ./configure --prefix="$SAGE_LOCAL" $CONF_FLAGS
    129     make install
    130 }
    131 
    132 build
    133 set +e
     110./configure --prefix="$SAGE_LOCAL" $CONF_FLAGS
    134111if [ $? -ne 0 ]; then
    135     echo "Error building and installing readline."
     112    echo "Error configuring readline"
    136113    exit 1
    137114fi
    138 set -e
    139115
    140 if [ $UNAME = "Darwin" ]; then
     116$MAKE
     117if [ $? -ne 0 ]; then
     118    echo "Error building readline"
     119    exit 1
     120fi
     121
     122$MAKE install
     123if [ $? -ne 0 ]; then
     124    echo "Error installing readline."
     125    exit 1
     126fi
     127
     128if [ "$UNAME" = "Darwin" ]; then
    141129  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.dylib
    142 elif [ $UNAME = "CYGWIN" ]; then
     130elif [ "$UNAME" = "CYGWIN" ]; then
    143131  # It is of course very lame that readline names the file .dll.a, but that's what it does.
    144132  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.dll.a
    145133elif [ "$UNAME" = "OpenBSD" ]; then
    146   DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.so.6.0
     134  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.so.6.1 # Untested. David Kirkby, 24th Oct 2010
    147135elif [ "$UNAME" = "FreeBSD" ]; then
    148136  DYLIB_NAME="$SAGE_LOCAL"/lib/libreadline.so.6
    149137elif [ "$UNAME" = "HP-UX" ]; then