scripts/build/companion_libs/gmp.sh
author Anthony Foiani <anthony.foiani@gmail.com>
Fri Oct 22 22:02:57 2010 +0200 (2010-10-22)
changeset 2154 250cdcc86441
parent 2099 1bb063c8a0ca
child 2275 9ab4392430ad
permissions -rw-r--r--
scripts: add "FILE" and "CFG" debug levels.

I ran into some minor difficulties looking through the build log for a
particular file: I wasn't interested in seeing it unpacked, but only
when it is built or installed. Adding these two levels allows me to
differentiate between those cases.

[Yann E. MORIN: Those are blind log levels, and are used only to search
in the build-log afterward.]

Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com>
     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     CFLAGS="${CT_CFLAGS_FOR_HOST} -fexceptions"     \
    40     CT_DoExecLog CFG                                \
    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 ${PARALLELMFLAGS}
    52 
    53     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    54         CT_DoLog EXTRA "Checking GMP"
    55         CT_DoExecLog ALL make ${PARALLELMFLAGS} -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