Ticket #5847: trac_5847-GMP-ECM-6.3_spkg_update-reviewer.patch

File trac_5847-GMP-ECM-6.3_spkg_update-reviewer.patch, 2.8 KB (added by leif, 9 years ago)

Suggested changes - NOT (yet) a Mercurial patch. (Minor fixes, some comments added, some clean-up.)

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    2020
    2121== Dependencies ==
    2222
    23  * gmp
     23 * GMP/MPIR (Note: Python is *not* required for ordinary builds.)
    2424
    2525== Special Update/Build Instructions ==
    2626
    27 src contains upstream code, no patches were applied.
     27 * src/ contains upstream code, no patches were applied.
     28 * GMP-ECM comes with a self-tuning feature; we could support
     29   that as an option ($SAGE_TUNE_*=yes) in the future.
    2830
    2931== Changelog ==
    3032
  • spkg-check

    diff --git a/spkg-check b/spkg-check
    a b  
     1#!/usr/bin/env bash
     2
     3# Note: Running the test suite should not involve (re)compilation,
     4#       so we don't set CFLAGS et al. here.
     5
    16cd src
    2 make check
     7
     8echo "Running the GMP-ECM test suite..."
     9
     10$MAKE check
    311
    412if [ $? -ne 0 ]; then
    5   echo "There was a problem during the GMP ECM tests."
     13  echo "Error: The GMP-ECM test suite failed."
    614  exit 1
    715fi
    816
     17echo "The GMP-ECM test suite passed."
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
     3# Note that GMP-ECM is written in C (and assembler) - no C++ sources.
     4
    35if [ "$SAGE64" = "yes" ]; then
    4    echo "64 bit build"
    5    CFLAGS="-O2 -g -m64 -fPIC"; export CFLAGS
    6    CXXFLAGS="-O2 -g -m64 -fPIC"; export CXXFLAGS
    7    LDFLAGS="-m64 "; export LDFLAGS
     6    echo "Building a 64-bit version of GMP-ECM"
     7    if [ -z "$CFLAG64" ]; then
     8        CFLAG64=-m64
     9    fi
     10    CFLAGS="$CFLAGS $CFLAG64 -fPIC"; export CFLAGS
     11    LDFLAGS="$CFLAG64"; export LDFLAGS
    812else
    9    CXXFLAGS="$CXXFLAGS -fPIC"; export CXXFLAGS
    10    CFLAGS="$CFLAGS -fPIC"; export CFLAGS
     13    CFLAGS="$CFLAGS -fPIC"; export CFLAGS
    1114fi
    1215
    13 # remove old executable/headers/library
    14 echo "Removing old binary, headers and static library"
     16
     17# Remove old executable/header/libraries/manpage:
     18
     19echo "Removing old binary, header file, manual page and libraries"
    1520rm -f "$SAGE_LOCAL"/bin/ecm
    1621rm -f "$SAGE_LOCAL"/lib/libecm.*
    17 rm -r "$SAGE_LOCAL"/include/ecm.h
     22rm -f "$SAGE_LOCAL"/include/ecm.h
     23rm -f "$SAGE_LOCAL"/share/man/man1/ecm.1
    1824
    1925cd src
    2026
    2127unset RM
    2228
    23 ./configure --with-gmp=$SAGE_LOCAL  --prefix=$SAGE_LOCAL
     29
     30# Note: Building (also) a *shared* library is disabled by default.
     31#       Add "--enable-shared" below if you want it.
     32
     33./configure --with-gmp="$SAGE_LOCAL"  --prefix="$SAGE_LOCAL"
    2434
    2535if [ $? -ne 0 ]; then
    26     echo "There was a problem configuring GMP ECM."
     36    echo "Error configuring GMP-ECM."
    2737    exit 1
    2838fi
    2939
    3040$MAKE
    3141
    3242if [ $? -ne 0 ]; then
    33     echo "There was a problem building GMP ECM."
     43    echo "Error building GMP-ECM."
    3444    exit 1
    3545fi
    3646
     
    3848$MAKE install
    3949
    4050if [ $? -ne 0 ]; then
    41     echo "There was a problem installing GMP ECM (though it appears to have built fine)."
     51    echo "Error installing GMP-ECM (though it appears to have built fine)."
    4252    exit 1
    4353fi