scripts/build/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jan 05 23:02:43 2009 +0000 (2009-01-05)
changeset 1126 1ab3d2e08c8b
parent 1119 4e7562023f3e
child 1205 ba2189b34eac
permissions -rw-r--r--
Split CT_ExtractAndPatch in two: CT_Extract and CT_Patch:
- it is unworkable to have CT_ExtactAndPAtch cope with all those silly glibc addons:
- they can have 'short' (as 'ports') or 'long' (as glibc-ports-2.7) names
- patches are against eithe the short or long name, but non-uniformly use one or the other
- it is the reposibility of the component (glibc in this case) to handle corner cases such as those
- update all components to use the new functions

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