scripts/build/companion_libs/mpc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Jul 28 23:55:10 2010 +0200 (2010-07-28)
changeset 2043 efb1058baa31
parent 1893 f5dab3c43abf
child 2099 1bb063c8a0ca
permissions -rw-r--r--
cc/gcc: add option to enable/disable libmudflap

For some scenarii, libmudflap is not very usefull
or can break the build. Make in an optioon that
defaults to 'N' to be on the safe side.

For the core gcc-s, there is absolutely no need
to build libmidflap.

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