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