scripts/build/companion_libs/gmp.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon May 25 17:26:21 2009 +0000 (2009-05-25)
branchgcc-4.4
changeset 1383 46658e3fc781
parent 1378 ad34196543eb
child 1386 7995942261f2
permissions -rw-r--r--
/devel/gcc-4.4:
- GMP: unconditionnaly build the C++ wrappers and use exceptions

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