scripts/build/companion_libs/gmp.sh
author Kalle Kankare <kalle.kankare@vincit.fi>
Fri Dec 03 12:36:44 2010 +0100 (2010-12-03)
changeset 2216 81b4c0efa46f
parent 2099 1bb063c8a0ca
child 2275 9ab4392430ad
permissions -rw-r--r--
complibs/libelf: use host compiler

It appears, that the configure scripts of libelf versions 0.8.13 and
0.8.12 do not honour the --host option. The compiler must be given as an
environment variable or the process will use the command "gcc" as the
compiler.

It seems that this is already done in the function do_libelf_target in
scripts/build/companion_libs/libelf.sh, but not in function do_libelf.
     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