scripts/build/gmp.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
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 GMP library
     2 # Copyright 2008 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_gmp_get() { :; }
     6 do_gmp_extract() { :; }
     7 do_gmp() { :; }
     8 do_gmp_target() { :; }
     9 
    10 # Overide functions depending on configuration
    11 if [ "${CT_GMP_MPFR}" = "y" ]; then
    12 
    13 # Download GMP
    14 do_gmp_get() {
    15     CT_GetFile "gmp-${CT_GMP_VERSION}" {ftp,http}://{ftp.sunet.se/pub,ftp.gnu.org}/gnu/gmp
    16 }
    17 
    18 # Extract GMP
    19 do_gmp_extract() {
    20     CT_Extract "gmp-${CT_GMP_VERSION}"
    21     CT_Patch "gmp-${CT_GMP_VERSION}"
    22 }
    23 
    24 do_gmp() {
    25     mkdir -p "${CT_BUILD_DIR}/build-gmp"
    26     cd "${CT_BUILD_DIR}/build-gmp"
    27 
    28     CT_DoStep INFO "Installing GMP"
    29 
    30     CT_DoLog EXTRA "Configuring GMP"
    31     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    32     CT_DoExecLog ALL                                \
    33     "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
    34         --build=${CT_BUILD}                         \
    35         --host=${CT_HOST}                           \
    36         --prefix="${CT_PREFIX_DIR}"                 \
    37         --disable-shared --enable-static            \
    38         --enable-fft --enable-mpbsd
    39 
    40     CT_DoLog EXTRA "Building GMP"
    41     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    42 
    43     if [ "${CT_GMP_CHECK}" = "y" ]; then
    44         CT_DoLog EXTRA "Checking GMP"
    45         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    46     fi
    47 
    48     CT_DoLog EXTRA "Installing GMP"
    49     CT_DoExecLog ALL make install
    50 
    51     CT_EndStep
    52 }
    53 
    54 if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then
    55 
    56 do_gmp_target() {
    57     mkdir -p "${CT_BUILD_DIR}/build-gmp-target"
    58     cd "${CT_BUILD_DIR}/build-gmp-target"
    59 
    60     CT_DoStep INFO "Installing GMP for the target"
    61 
    62     CT_DoLog EXTRA "Configuring GMP"
    63     CFLAGS="${CT_CFLAGS_FOR_TARGET}"                \
    64     CT_DoExecLog ALL                                \
    65     "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
    66         --build=${CT_BUILD}                         \
    67         --host=${CT_TARGET}                         \
    68         --prefix=/usr                               \
    69         --disable-shared --enable-static            \
    70         --enable-fft --enable-mpbsd
    71 
    72     CT_DoLog EXTRA "Building GMP"
    73     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    74 
    75     # Not possible to check MPFR while X-compiling
    76 
    77     CT_DoLog EXTRA "Installing GMP"
    78     CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
    79 
    80     CT_EndStep
    81 }
    82 
    83 fi # CT_GMP_MPFR_TARGET == y
    84 
    85 fi # CT_GMP_MPFR == y