scripts/build/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 04 14:25:58 2009 +0000 (2009-01-04)
changeset 1119 4e7562023f3e
parent 1112 c72aecd1a9ef
child 1126 1ab3d2e08c8b
permissions -rw-r--r--
Get rid of CT_GMP_FILE and CT_MPFR_FILE.

/trunk/scripts/build/gmp.sh | 32 16 16 0 ++++++++++++++++----------------
/trunk/scripts/build/mpfr.sh | 38 19 19 0 +++++++++++++++++++-------------------
/trunk/scripts/crosstool.sh | 2 0 2 0 --
3 files changed, 35 insertions(+), 37 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_mpfr_get() { :; }
     6 do_mpfr_extract() { :; }
     7 do_mpfr() { :; }
     8 do_mpfr_target() { :; }
     9 
    10 # Overide function depending on configuration
    11 if [ "${CT_GMP_MPFR}" = "y" ]; then
    12 
    13 # Download MPFR
    14 do_mpfr_get() {
    15     CT_GetFile "mpfr-${CT_MPFR_VERSION}" http://www.mpfr.org/mpfr-current/  \
    16                                  http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
    17 }
    18 
    19 # Extract MPFR
    20 do_mpfr_extract() {
    21     CT_ExtractAndPatch "mpfr-${CT_MPFR_VERSION}"
    22 
    23     # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
    24     # same version number. Unfortunately, some tarballs of MPFR are not
    25     # built sanely, and thus ./configure fails on Gentoo.
    26     # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
    27     # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
    28     # This hack is not bad per se, but the MPFR guys would be better not to
    29     # do that in the future...
    30     CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
    31     if [ ! -f .autotools.ct-ng ]; then
    32         CT_DoLog DEBUG "Re-building autotools files"
    33         CT_DoExecLog ALL autoreconf -fi
    34         # Starting with libtool-1.9f, config.{guess,sub} are no longer
    35         # installed without -i, but starting with libtool-2.2.6, they
    36         # are no longer removed without -i. Sight... Just use -i with
    37         # libtool >=2
    38         # See: http://sourceware.org/ml/crossgcc/2008-11/msg00046.html
    39         # and: http://sourceware.org/ml/crossgcc/2008-11/msg00048.html
    40         libtoolize_opt=
    41         case "$(libtoolize --version |head -n 1 |gawk '{ print $(NF); }')" in
    42             0.*)    ;;
    43             1.*)    ;;
    44             *)      libtoolize_opt=-i;;
    45         esac
    46         CT_DoExecLog ALL libtoolize -f ${libtoolize_opt}
    47         touch .autotools.ct-ng
    48     fi
    49     CT_Popd
    50 }
    51 
    52 do_mpfr() {
    53     mkdir -p "${CT_BUILD_DIR}/build-mpfr"
    54     cd "${CT_BUILD_DIR}/build-mpfr"
    55 
    56     CT_DoStep INFO "Installing MPFR"
    57 
    58     CT_DoLog EXTRA "Configuring MPFR"
    59     CFLAGS="${CT_CFLAGS_FOR_HOST}"                      \
    60     CT_DoExecLog ALL                                    \
    61     "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure"   \
    62         --build=${CT_BUILD}                             \
    63         --host=${CT_HOST}                               \
    64         --prefix="${CT_PREFIX_DIR}"                     \
    65         --enable-thread-safe                            \
    66         --disable-shared --enable-static                \
    67         --with-gmp="${CT_PREFIX_DIR}"
    68 
    69     CT_DoLog EXTRA "Building MPFR"
    70     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    71 
    72     if [ "${CT_MPFR_CHECK}" = "y" ]; then
    73         CT_DoLog EXTRA "Checking MPFR"
    74         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    75     fi
    76 
    77     CT_DoLog EXTRA "Installing MPFR"
    78     CT_DoExecLog ALL make install
    79 
    80     CT_EndStep
    81 }
    82 
    83 if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
    84 
    85 do_mpfr_target() {
    86     mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
    87     cd "${CT_BUILD_DIR}/build-mpfr-target"
    88 
    89     CT_DoStep INFO "Installing MPFR for the target"
    90 
    91     CT_DoLog EXTRA "Configuring MPFR"
    92     CFLAGS="${CT_CFLAGS_FOR_TARGET}"                    \
    93     CT_DoExecLog ALL                                    \
    94     "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure"   \
    95         --build=${CT_BUILD}                             \
    96         --host=${CT_TARGET}                             \
    97         --prefix=/usr                                   \
    98         --enable-thread-safe                            \
    99         --disable-shared --enable-static                \
   100         --with-gmp="${CT_SYSROOT_DIR}/usr"
   101 
   102     CT_DoLog EXTRA "Building MPFR"
   103     CT_DoExecLog ALL make ${PARALLELMFLAGS}
   104 
   105     # Not possible to check MPFR while X-compiling
   106 
   107     CT_DoLog EXTRA "Installing MPFR"
   108     CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
   109 
   110     CT_EndStep
   111 }
   112 
   113 fi # CT_GMP_MPFR_TARGET == y
   114 
   115 fi # CT_GMP_MPFR == y