scripts/build/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jun 19 21:54:57 2008 +0000 (2008-06-19)
changeset 584 b46de4c38396
parent 524 5f7fec79ca88
child 591 1854f2c508a8
permissions -rw-r--r--
Fix building MPFR on distro that have strict sanity checks on libtool.m4 and ltmain.sh versions mismatch. UNTESTED!

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