scripts/build/companion_libs/mpc.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 MPC library
     2 # Copyright 2009 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_mpc_get() { :; }
     6 do_mpc_extract() { :; }
     7 do_mpc() { :; }
     8 
     9 # Overide functions depending on configuration
    10 if [ "${CT_MPC}" = "y" ]; then
    11 
    12 # Download MPC
    13 do_mpc_get() {
    14     CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz      \
    15         http://www.multiprecision.org/mpc/download
    16 }
    17 
    18 # Extract MPC
    19 do_mpc_extract() {
    20     CT_Extract "mpc-${CT_MPC_VERSION}"
    21     CT_Patch "mpc" "${CT_MPC_VERSION}"
    22 }
    23 
    24 do_mpc() {
    25     local -a mpc_opts
    26 
    27     mkdir -p "${CT_BUILD_DIR}/build-mpc"
    28     cd "${CT_BUILD_DIR}/build-mpc"
    29 
    30     CT_DoStep INFO "Installing MPC"
    31 
    32     CT_DoLog EXTRA "Configuring MPC"
    33 
    34     if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    35         mpc_opts+=( --enable-shared --disable-static )
    36     else
    37         mpc_opts+=( --disable-shared --enable-static )
    38     fi
    39 
    40     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
    41     CT_DoExecLog CFG                                \
    42     "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \
    43         --build=${CT_BUILD}                         \
    44         --host=${CT_HOST}                           \
    45         --prefix="${CT_COMPLIBS_DIR}"               \
    46         --with-gmp="${CT_COMPLIBS_DIR}"             \
    47         --with-mpfr="${CT_COMPLIBS_DIR}"            \
    48         "${mpc_opts[@]}"
    49 
    50     CT_DoLog EXTRA "Building MPC"
    51     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    52 
    53     if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
    54         CT_DoLog EXTRA "Checking MPC"
    55         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    56     fi
    57 
    58     CT_DoLog EXTRA "Installing MPC"
    59     CT_DoExecLog ALL make install
    60 
    61     CT_EndStep
    62 }
    63 
    64 fi # CT_MPC