Ticket #9523: trac_9523-first_reviewer.patch

File trac_9523-first_reviewer.patch, 3.5 KB (added by leif, 11 years ago)

SPKG reviewer patch. Removes quotes from $CCetc. Apply on top of Dave's "further clean-up" patch.

  • spkg-install

    # HG changeset patch
    # User Leif Leonhardy <not.really@online.de>
    # Date 1288977055 -3600
    # Node ID 2adee52a911ef376b8d95bb6f025ba062de723d9
    # Parent  08147120a3429507b3c6870828bcb03b57f88483
    #9523 Don't quote $CC; don't override user's CFLAGS settings unless necessary; clean-up.
    
    diff -r 08147120a342 -r 2adee52a911e spkg-install
    a b  
    99   exit 1
    1010fi
    1111
    12 if [ "x$CFLAG64" = x ] ; then
     12if [ -z "$CFLAG64" ] ; then
    1313   CFLAG64=-m64
    1414fi
    1515
    16 # Add a sensible default optimisation flag. Change if necessary.
     16# Passed to 'configure', but currently not used:
     17unset CONF_FLAGS
     18
     19# Add a sensible default optimization flag, unless SAGE_DEBUG="yes"
     20# (see below). Change if necessary.
     21# If the user sets CFLAGS, and sets a new optimization level
     22# such as -O3, then this will take precedence, as most compilers
     23# will take the last option (gcc definitely does).
    1724OPTIMIZATION_FLAGS="-O2"
    1825
    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).
    22 
    23 CFLAGS="$OPTIMIZATION_FLAGS $CFLAGS"
    24 
    2526# Compile for 64-bit if SAGE64 is set to 'yes'
    2627if [ "x$SAGE64" = xyes ] ; then
    2728   echo "Building a 64-bit version of Readline"
    2829   CFLAGS="$CFLAGS $CFLAG64"
     30   CPPFLAGS="$CPPFLAGS $CFLAG64"
    2931   # Some packages may need LDFLAGS and/or ABI set here.
    3032   LDFLAGS="$LDFLAGS $CFLAG64"
    3133fi
     
    3436   echo "Code will be built with no optimisation to aid debugging"
    3537   CFLAGS="$CFLAGS -g -O0"
    3638else
    37    CFLAGS="$CFLAGS -g $OPTIMIZATION_FLAGS"
     39   # Adding debug symbols by default:
     40   CFLAGS="-g $OPTIMIZATION_FLAGS $CFLAGS"
    3841fi
    3942
    4043# Add appropriate flag(s) to show all warnings.
    4144# This test of a compiler is not perfect by any means, but
    4245# is better than nothing.
    43 if "$CC" -flags > /dev/null 2>&1 ; then
    44    echo "Not adding any compiler flags to show extra warnings - Sun compiler is strict enough"
     46if $CC -flags > /dev/null 2>&1 < /dev/null; then
     47   echo "Not adding any compiler flags to show extra warnings" \
     48       "- Sun compiler is strict enough"
    4549   # The Sun compilers are fussy, and adding extra
    4650   # warnings will just show too many.
    4751else
    4852   # Assume gcc if not the Sun C compiler.
    4953   # Add -Wall to show all warnings.
    50    CFLAGS="$CFLAGS -Wall"
     54   CFLAGS="-Wall $CFLAGS"
    5155fi
    5256
    5357echo "Using CC=$CC"
     
    5761echo "Using CFLAGS=$CFLAGS"
    5862echo "Using CPPFLAGS=$CPPFLAGS"
    5963echo "Using LDFLAGS=$LDFLAGS"
    60 echo "configure scripts and/or makefiles might override these later"
     64echo "Configure scripts and/or makefiles might override these later."
    6165echo " "
    6266
    63 # export everything. Probably not necessary in most cases.
     67# Export everything. Probably not necessary in most cases.
    6468export CFLAGS
    6569export CPPFLAGS
    6670export LDFLAGS
    6771
    6872# End of pretty general spkg-install file.
    69 # Now do the specific things needed for this package (Readline)
    7073
     74# Now do the specific things needed for this package (Readline):
    7175
    72 echo "Deleting old readline headers and libs"
     76echo "Deleting old readline headers and libs..."
    7377rm -rf "$SAGE_LOCAL"/include/readline/
    7478rm -rf "$SAGE_LOCAL"/lib/libreadline.*
    7579
     
    109113
    110114./configure --prefix="$SAGE_LOCAL" $CONF_FLAGS
    111115if [ $? -ne 0 ]; then
    112     echo "Error configuring readline"
     116    echo "Error configuring readline."
    113117    exit 1
    114118fi
    115119
    116120$MAKE
    117121if [ $? -ne 0 ]; then
    118     echo "Error building readline"
     122    echo "Error building readline."
    119123    exit 1
    120124fi
    121125