scripts/build/companion_libs/gmp.sh
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Mon Feb 13 21:47:25 2012 +0100 (2012-02-13)
changeset 2883 cea814c9932a
parent 2346 ab441b3f8ea1
child 2927 ddaae597fd7c
permissions -rw-r--r--
libc/glibc: do not consume parameters when parsing them

Currently, there are two constructs used to parse arguments in
glibc backends, one that consumes args as they are parsed, and
one that does not.

Always use the construct that does not eat args as they are parsed.

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