scripts/build/companion_libs/gmp.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Mar 28 01:05:18 2011 +0200 (2011-03-28)
changeset 2362 0888065f8c4d
parent 2275 9ab4392430ad
child 2381 0ca0f85a4b2a
permissions -rw-r--r--
cc/gcc: cleanup the _or_later logic

So far, we've had a version always select appropriate _or_later option,
which in turn would select all previous _or_later options.

Because the dependencies on companion libs were cumulative, that was
working OK. But the upcoming 4.6 will no longer depend on libelf, so
we can't keep the cumulative scheme we've been using so far.

Have each release family select the corresponding dependencies, instead
of relying on selecting previous _or_later.

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     local -a gmp_opts
    25 
    26     mkdir -p "${CT_BUILD_DIR}/build-gmp"
    27     cd "${CT_BUILD_DIR}/build-gmp"
    28 
    29     CT_DoStep INFO "Installing GMP"
    30 
    31     CT_DoLog EXTRA "Configuring GMP"
    32 
    33     if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    34         gmp_opts+=( --enable-shared --disable-static )
    35     else
    36         gmp_opts+=( --disable-shared --enable-static )
    37     fi
    38 
    39     CT_DoExecLog CFG                                \
    40     CFLAGS="${CT_CFLAGS_FOR_HOST} -fexceptions"     \
    41     "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
    42         --build=${CT_BUILD}                         \
    43         --host=${CT_HOST}                           \
    44         --prefix="${CT_COMPLIBS_DIR}"               \
    45         --enable-fft                                \
    46         --enable-mpbsd                              \
    47         --enable-cxx                                \
    48         "${gmp_opts[@]}"
    49 
    50     CT_DoLog EXTRA "Building GMP"
    51     CT_DoExecLog ALL make ${JOBSFLAGS}
    52 
    53     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    54         CT_DoLog EXTRA "Checking GMP"
    55         CT_DoExecLog ALL make ${JOBSFLAGS} -s check
    56     fi
    57 
    58     CT_DoLog EXTRA "Installing GMP"
    59     CT_DoExecLog ALL make install
    60 
    61     CT_EndStep
    62 }
    63 
    64 fi # CT_GMP