scripts/build/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Jun 20 10:58:45 2008 +0000 (2008-06-20)
changeset 598 a2b23333b17a
parent 595 3ea35558d659
child 602 1968d150a34f
permissions -rw-r--r--
Really don't re-build MPFR autotools files at each run.

/trunk/scripts/build/debug/300-gdb.sh | 8 6 2 0 ++++++--
/trunk/scripts/build/mpfr.sh | 10 7 3 0 +++++++---
2 files changed, 13 insertions(+), 5 deletions(-)
     1 # This file adds the functions to build the MPFR library
     2 # Copyright 2008 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then
     6 
     7 do_print_filename() {
     8     [ "${CT_CC_GCC_GMP_MPFR}" = "y" ] || return 0
     9     echo "mpfr-${CT_MPFR_VERSION}"
    10 }
    11 
    12 # Download MPFR
    13 do_mpfr_get() {
    14     CT_GetFile "${CT_MPFR_FILE}" http://www.mpfr.org/mpfr-current/          \
    15                                  http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
    16 }
    17 
    18 # Extract MPFR
    19 do_mpfr_extract() {
    20     CT_ExtractAndPatch "${CT_MPFR_FILE}"
    21 
    22     # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
    23     # same version number. Unfortunately, some tarballs of MPFR are not
    24     # built sanely, and thus ./configure fails on Gentoo.
    25     # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
    26     # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
    27     # This hack is not bad per se, but the MPFR guys would be better not to
    28     # do that in the future...
    29     CT_Pushd "${CT_SRC_DIR}/${CT_MPFR_FILE}"
    30     if [ ! -f .autotools.ct-ng ]; then
    31         CT_DoLog EXTRA "Re-building autotools files"
    32         autoreconf -fi  2>&1 |CT_DoLog ALL
    33         libtoolize -f   2>&1 |CT_DoLog ALL
    34         touch .autotools.ct-ng
    35     fi
    36     CT_Popd
    37 }
    38 
    39 do_mpfr() {
    40     mkdir -p "${CT_BUILD_DIR}/build-mpfr"
    41     cd "${CT_BUILD_DIR}/build-mpfr"
    42 
    43     CT_DoStep INFO "Installing MPFR"
    44 
    45     CT_DoLog EXTRA "Configuring MPFR"
    46     CFLAGS="${CT_CFLAGS_FOR_HOST}"                          \
    47     "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure"               \
    48         --build=${CT_BUILD}                                 \
    49         --host=${CT_HOST}                                   \
    50         --prefix="${CT_PREFIX_DIR}"                         \
    51         --enable-thread-safe                                \
    52         --disable-shared --enable-static                    \
    53         --with-gmp="${CT_PREFIX_DIR}"                       2>&1 |CT_DoLog ALL
    54 
    55     CT_DoLog EXTRA "Building MPFR"
    56     make ${PARALLELMFLAGS}  2>&1 |CT_DoLog ALL
    57 
    58     if [ "${CT_MPFR_CHECK}" = "y" ]; then
    59         CT_DoLog EXTRA "Checking MPFR"
    60         make -s check       2>&1 |CT_DoLog ALL
    61     fi
    62 
    63     CT_DoLog EXTRA "Installing MPFR"
    64     make install            2>&1 |CT_DoLog ALL
    65 
    66     CT_EndStep
    67 }
    68 
    69 else # No MPFR
    70 
    71 do_print_filename() { :; }
    72 do_mpfr_get() { :; }
    73 do_mpfr_extract() { :; }
    74 do_mpfr() { :; }
    75 
    76 fi