scripts/build/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 13 10:32:38 2008 +0000 (2008-07-13)
changeset 645 8e58024f8e37
parent 598 a2b23333b17a
child 656 b43129be0f04
permissions -rw-r--r--
Ioannis E. VENETIS <venetis@mail.capsl.udel.edu> pointed out that GMP and MPFR were not used by gcc.
Turned out that none could use GMP and MPFR as the config option changed its name, but the change was not propagated to all users.

/trunk/scripts/build/binutils.sh | 2 1 1 0 +-
/trunk/scripts/build/debug/300-gdb.sh | 2 1 1 0 +-
/trunk/scripts/build/cc_gcc.sh | 6 3 3 0 +++---
3 files changed, 5 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 do_print_filename() { :; }
     6 do_mpfr_get() { :; }
     7 do_mpfr_extract() { :; }
     8 do_mpfr() { :; }
     9 do_mpfr_target() { :; }
    10 
    11 # Overide function depending on configuration
    12 if [ "${CT_GMP_MPFR}" = "y" ]; then
    13 
    14 do_print_filename() {
    15     [ "${CT_GMP_MPFR}" = "y" ] || return 0
    16     echo "mpfr-${CT_MPFR_VERSION}"
    17 }
    18 
    19 # Download MPFR
    20 do_mpfr_get() {
    21     CT_GetFile "${CT_MPFR_FILE}" http://www.mpfr.org/mpfr-current/          \
    22                                  http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
    23 }
    24 
    25 # Extract MPFR
    26 do_mpfr_extract() {
    27     CT_ExtractAndPatch "${CT_MPFR_FILE}"
    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 not to
    35     # do that in the future...
    36     CT_Pushd "${CT_SRC_DIR}/${CT_MPFR_FILE}"
    37     if [ ! -f .autotools.ct-ng ]; then
    38         CT_DoLog EXTRA "Re-building autotools files"
    39         autoreconf -fi  2>&1 |CT_DoLog ALL
    40         libtoolize -f   2>&1 |CT_DoLog ALL
    41         touch .autotools.ct-ng
    42     fi
    43     CT_Popd
    44 }
    45 
    46 do_mpfr() {
    47     mkdir -p "${CT_BUILD_DIR}/build-mpfr"
    48     cd "${CT_BUILD_DIR}/build-mpfr"
    49 
    50     CT_DoStep INFO "Installing MPFR"
    51 
    52     CT_DoLog EXTRA "Configuring MPFR"
    53     CFLAGS="${CT_CFLAGS_FOR_HOST}"                          \
    54     "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure"               \
    55         --build=${CT_BUILD}                                 \
    56         --host=${CT_HOST}                                   \
    57         --prefix="${CT_PREFIX_DIR}"                         \
    58         --enable-thread-safe                                \
    59         --disable-shared --enable-static                    \
    60         --with-gmp="${CT_PREFIX_DIR}"                       2>&1 |CT_DoLog ALL
    61 
    62     CT_DoLog EXTRA "Building MPFR"
    63     make ${PARALLELMFLAGS}  2>&1 |CT_DoLog ALL
    64 
    65     if [ "${CT_MPFR_CHECK}" = "y" ]; then
    66         CT_DoLog EXTRA "Checking MPFR"
    67         make ${PARALLELMFLAGS} -s check 2>&1 |CT_DoLog ALL
    68     fi
    69 
    70     CT_DoLog EXTRA "Installing MPFR"
    71     make install            2>&1 |CT_DoLog ALL
    72 
    73     CT_EndStep
    74 }
    75 
    76 if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
    77 
    78 do_mpfr_target() {
    79     mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
    80     cd "${CT_BUILD_DIR}/build-mpfr-target"
    81 
    82     CT_DoStep INFO "Installing MPFR for the target"
    83 
    84     CT_DoLog EXTRA "Configuring MPFR"
    85     CFLAGS="${CT_CFLAGS_FOR_TARGET}"                        \
    86     "${CT_SRC_DIR}/${CT_MPFR_FILE}/configure"               \
    87         --build=${CT_BUILD}                                 \
    88         --host=${CT_TARGET}                                 \
    89         --prefix=/usr                                       \
    90         --enable-thread-safe                                \
    91         --disable-shared --enable-static                    \
    92         --with-gmp="${CT_SYSROOT_DIR}/usr"                  2>&1 |CT_DoLog ALL
    93 
    94     CT_DoLog EXTRA "Building MPFR"
    95     make ${PARALLELMFLAGS}  2>&1 |CT_DoLog ALL
    96 
    97     # Not possible to check MPFR while X-compiling
    98 
    99     CT_DoLog EXTRA "Installing MPFR"
   100     make DESTDIR="${CT_SYSROOT_DIR}" install    2>&1 |CT_DoLog ALL
   101 
   102     CT_EndStep
   103 }
   104 
   105 fi # CT_GMP_MPFR_TARGET == y
   106 
   107 fi # CT_GMP_MPFR == y