Ticket #14629: sqlite-3.7.17.diff

File sqlite-3.7.17.diff, 5.1 KB (added by jdemeyer, 6 years ago)
  • SPKG.txt

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1369253720 -7200
    # Node ID 8072c45d2096ca872f161429ccfd25c0742273f7
    # Parent  640baccc6fde81453118d615dc46ea94ac9bb8d0
    Trac #14629: upgrade to version 3.7.17
    Use standard template for SPKG.txt and spkg-install, use $MAKE instead of make
    Remove Fortran and C++ stuff from spkg-install
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    11= SQLite =
    22
     3== Description ==
     4
    35SQLite is a software library that implements a self-contained,
    46serverless, zero-configuration, transactional SQL database engine.
    57
     8== License ==
     9
     10Public Domain
     11
    612== Upstream contact ==
    7  * URL: http://www.sqlite.org
     13
     14 * http://www.sqlite.org
     15
     16== Dependencies ==
     17
     18* readline
     19
     20== Special Update/Build Instructions ==
     21
     22None
     23
     24== Changelog ==
     25
     26=== sqlite-3.7.17 (Jeroen Demeyer, 24 May 2013) ===
     27 * #14629: upgrade to version 3.7.17
     28 * Use standard template for SPKG.txt and spkg-install, use $MAKE instead of make
     29 * Remove Fortran and C++ stuff from spkg-install
     30 * Compile with -DSQLITE_WITHOUT_ZONEMALLOC on OS X <= 10.4
    831
    932=== sqlite-3.7.5.p1 (William Stein, 10 May 2012) ===
    1033 * #12937: sqlite sometimes picks up the wrong libraries (e.g., readline) since we forgot to set LDFLAGS.  Thus, set LDFLAGS.
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    3 
    4 if [ -z "$SAGE_LOCAL" ] ; then
    5    echo "SAGE_LOCAL undefined ... exiting";
    6    echo "Maybe run 'sage -sh'?"
    7    exit 1
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo >&2 "SAGE_LOCAL undefined ... exiting"
     5    echo >&2 "Maybe run 'sage --sh'?"
     6    exit 1
    87fi
    98
    10 # Force an exit on all errors. However, note it will be desirable to unset
    11 # this sometimes, as you might want to test for a particular error and exit
    12 # with a message. You can't do that with 'set -e'. So use 'set +e' to unset it
     9cd src
    1310
    14 set -e
    15 
     11# Apply patches.  See SPKG.txt for information about what each patch
     12# does.
     13for patch in ../patches/*.patch; do
     14    [ -r "$patch" ] || continue  # Skip non-existing or non-readable patches
     15    patch -p1 <"$patch"
     16    if [ $? -ne 0 ]; then
     17        echo >&2 "Error applying '$patch'"
     18        exit 1
     19    fi
     20done
    1621
    1722# Compile for 64-bit if SAGE64 is set to 'yes'
    1823if [ "x$SAGE64" = "xyes" ] ; then
    19    CFLAGS="$CFLAGS -m64 "
    20    CXXFLAGS="$CXXFLAGS -m64 "
    21    FFLAGS="$FFLAGS -m64 "
     24    CFLAGS="$CFLAGS -m64 "
    2225fi
    2326
    24 # If SAGE_DEBUG is set either unset (the default), set to '1', 'yes', or 'TRUE'
    25 # then build with debugging information. Otherwise, don't add debugging
    26 # information.
    2727
    28 # Since both the Sun and GNU compilers accept -g to give debugging information,
    29 # there is no need to do anything specific to one compiler or the other.
    30 
    31 if [ "x$SAGE_DEBUG" = "x" ] || [ "x$SAGE_DEBUG" = "x1" ] ; then
    32   echo "Code will be built with debugging information present. Set 'SAGE_DEBUG' to '0' if you don't want that."
    33   CFLAGS="$CFLAGS -g "
    34   CXXFLAGS="$CXXFLAGS -g "
    35   FFLAGS="$FFLAGS -g "
    36 elif [ "x$SAGE_DEBUG" = "xyes" ] || [ "x$SAGE_DEBUG" = "xTRUE" ] ; then
    37   echo "Code will be built with debugging information present. Set 'SAGE_DEBUG' to '0' if you don't want that."
    38   CFLAGS="$CFLAGS -g "
    39   CXXFLAGS="$CXXFLAGS -g "
    40   FFLAGS="$FFLAGS -g "
     28# Build with -O0 if debugging requested
     29if [ "$SAGE_DEBUG" = "yes" ]; then
     30    CFLAGS="-g -O0 $CFLAGS"
     31else
     32    CFLAGS="-g -O2 $CFLAGS"
    4133fi
    4234
    43 export CFLAGS="$CFLAGS -O2 "
    44 export CXXFLAGS="$CXXFLAGS -O2 "
    45 export CPPFLAGS="$CPPFLAGS -I $SAGE_LOCAL/include"
    46 export LDFLAGS="$LDFLAGS -I $SAGE_LOCAL/lib"
     35export CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include"
     36export LDFLAGS="$LDFLAGS -L$SAGE_LOCAL/lib"
     37export CFLAGS
    4738
    48 # There is no Fortran code in sqlite, but if FC is not set, there
    49 # there are annoying messages showing the use of the GNU fortran compiler
    50 # even if SAGE_FORTRAN is set to another compiler. This just stops that.
    51 export FC=$SAGE_FORTRAN
    52 export F77=$SAGE_FORTRAN
     39# Old OS X systems need -DSQLITE_WITHOUT_ZONEMALLOC
     40if uname -sr |grep 'Darwin [0-8][.]' >/dev/null; then
     41    export CPPFLAGS="$CPPFLAGS -DSQLITE_WITHOUT_ZONEMALLOC"
     42fi
    5343
    54 cd src
    55 
    56 echo "Building sqlite using CC=$CC"
    57 echo "                      CCX=$CXX"
    58 echo "                      SAGE_FORTRAN=$SAGE_FORTRAN"
    59 echo "                      F77=$F77"
    60 echo "                      FC=$FC"
    61 echo "                      CFLAGS=$CFLAGS"
    62 echo "                      CXXFLAGS=$CXXFLAGS"
    63 echo "                      FFLAGS=$FFLAGS"
    64 echo "                      CPPFLAGS=$CPPFLAGS"
    65 echo "                      LDFLAGS=$LDFLAGS"
    66 
    67 # Disable exit on error, since the necessary checks for errors
    68 # are below.
    69 
    70 set +e
    7144
    7245./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib"
    73 
    7446if [ $? -ne 0 ]; then
    75     echo "Error configuring sqlite"
     47    echo >&2 "Error configuring sqlite."
    7648    exit 1
    7749fi
    7850
    79 make
    80 
     51$MAKE
    8152if [ $? -ne 0 ]; then
    82     echo "Error making sqlite"
     53    echo >&2 "Error making sqlite."
    8354    exit 1
    8455fi
    8556
    86 make install
    87 
     57$MAKE install
    8858if [ $? -ne 0 ]; then
    89     echo "Error installing sqlite"
     59    echo >&2 "Error installing sqlite."
    9060    exit 1
    9161fi