scripts/build/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jun 19 22:06:42 2008 +0000 (2008-06-19)
branch1.1
changeset 588 2209aaba05ab
parent 525 2d349a79c40d
child 592 9b95711d0005
permissions -rw-r--r--
Backport #718 from trunk:
Fix building MPFR on distro that have strict sanity checks on libtool.m4 and ltmain.sh versions mismatch. UNTESTED!

/branches/1.1/scripts/build/mpfr.sh | 11 11 0 0 +++++++++++
1 file changed, 11 insertions(+)
     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 }
    16 
    17 # Extract MPFR
    18 do_mpfr_extract() {
    19     CT_ExtractAndPatch "${CT_MPFR_FILE}"
    20 }
    21 
    22 do_mpfr() {
    23     mkdir -p "${CT_BUILD_DIR}/build-mpfr"
    24     cd "${CT_BUILD_DIR}/build-mpfr"
    25 
    26     CT_DoStep INFO "Installing MPFR"
    27 
    28     # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
    29     # same version number. Unfortunately, some tarballs of MPFR are not
    30     # built sanely, and thus ./configure fails on Gentoo.
    31     # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
    32     # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
    33     # This hack is not bad per se, but the MPFR guys would be better to not
    34     # do that in the future...
    35     CT_DoLog EXTRA "Re-building configuration files"
    36     autoreconf -fi  2>&1 |CT_DoLog ALL
    37     libtoolize      2>&1 |CT_DoLog ALL
    38 
    39     CT_DoLog EXTRA "Configuring MPFR"
    40     CFLAGS="${CT_CFLAGS_FOR_HOST}"                          \
    41     "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure"               \
    42         --build=${CT_BUILD}                                 \
    43         --host=${CT_HOST}                                   \
    44         --prefix="${CT_PREFIX_DIR}"                         \
    45         --enable-thread-safe                                \
    46         --disable-shared --enable-static                    \
    47         --with-gmp="${CT_PREFIX_DIR}"                       2>&1 |CT_DoLog ALL
    48 
    49     CT_DoLog EXTRA "Building MPFR"
    50     make ${PARALLELMFLAGS}  2>&1 |CT_DoLog ALL
    51 
    52     if [ "${CT_MPFR_CHECK}" = "y" ]; then
    53         CT_DoLog EXTRA "Checking MPFR"
    54         make -s check       2>&1 |CT_DoLog ALL
    55     fi
    56 
    57     CT_DoLog EXTRA "Installing MPFR"
    58     make install            2>&1 |CT_DoLog ALL
    59 
    60     CT_EndStep
    61 }
    62 
    63 else # No MPFR
    64 
    65 do_print_filename() { :; }
    66 do_mpfr_get() { :; }
    67 do_mpfr_extract() { :; }
    68 do_mpfr() { :; }
    69 
    70 fi