scripts/build/companion_libs/gmp.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:43:07 2011 +0200 (2011-07-17)
changeset 2893 a8a65758664f
parent 2346 ab441b3f8ea1
child 2927 ddaae597fd7c
permissions -rw-r--r--
cc/gcc: do not use the core pass-2 to build the baremetal compiler

In case we build a baremetal compiler, use the standard passes:
- core_cc is used to build the C library;
- as such, it is meant to run on build, not host;
- the final compiler is meant to run on host;

As the current final compiler step can not build a baremetal compiler,
call the core backend from the final step.

NB: Currently, newlib is built during the start_files pass, so we have
to have a core compiler by then... Once we can build the baremetal
compiler from the final cc step, then we can move the newlib build to
the proper step, and then get rid of the core pass-1 static compiler...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
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
yann@602
     9
# Overide functions depending on configuration
yann@2099
    10
if [ "${CT_GMP}" = "y" ]; then
yann@468
    11
yann@466
    12
# Download GMP
yann@466
    13
do_gmp_get() {
yann@1119
    14
    CT_GetFile "gmp-${CT_GMP_VERSION}" {ftp,http}://{ftp.sunet.se/pub,ftp.gnu.org}/gnu/gmp
yann@466
    15
}
yann@466
    16
yann@466
    17
# Extract GMP
yann@466
    18
do_gmp_extract() {
yann@1126
    19
    CT_Extract "gmp-${CT_GMP_VERSION}"
yann@1901
    20
    CT_Patch "gmp" "${CT_GMP_VERSION}"
yann@466
    21
}
yann@466
    22
yann@466
    23
do_gmp() {
yann@466
    24
    mkdir -p "${CT_BUILD_DIR}/build-gmp"
yann@466
    25
    cd "${CT_BUILD_DIR}/build-gmp"
yann@466
    26
yann@466
    27
    CT_DoStep INFO "Installing GMP"
yann@466
    28
yann@466
    29
    CT_DoLog EXTRA "Configuring GMP"
yann@1324
    30
yann@2346
    31
    CT_DoExecLog CFG                                \
yann@1383
    32
    CFLAGS="${CT_CFLAGS_FOR_HOST} -fexceptions"     \
yann@1119
    33
    "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
yann@1119
    34
        --build=${CT_BUILD}                         \
yann@1119
    35
        --host=${CT_HOST}                           \
yann@1893
    36
        --prefix="${CT_COMPLIBS_DIR}"               \
yann@1324
    37
        --enable-fft                                \
yann@1324
    38
        --enable-mpbsd                              \
yann@1892
    39
        --enable-cxx                                \
yann@2381
    40
        --disable-shared                            \
yann@2381
    41
        --enable-static
yann@466
    42
yann@466
    43
    CT_DoLog EXTRA "Building GMP"
yann@2275
    44
    CT_DoExecLog ALL make ${JOBSFLAGS}
yann@466
    45
yann@1890
    46
    if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
yann@466
    47
        CT_DoLog EXTRA "Checking GMP"
yann@2275
    48
        CT_DoExecLog ALL make ${JOBSFLAGS} -s check
yann@466
    49
    fi
yann@466
    50
yann@466
    51
    CT_DoLog EXTRA "Installing GMP"
yann@655
    52
    CT_DoExecLog ALL make install
yann@466
    53
yann@466
    54
    CT_EndStep
yann@466
    55
}
yann@468
    56
yann@1810
    57
fi # CT_GMP