scripts/build/companion_libs/mpc.sh
author Remy Bohmer <linux@bohmer.net>
Sun Jul 11 22:23:34 2010 +0200 (2010-07-11)
changeset 2021 3e52a1510f87
parent 1893 f5dab3c43abf
child 2099 1bb063c8a0ca
permissions -rw-r--r--
debug/gdb: Fix compilation for Mingw hosts

GDB requires PDcurses instead of ncurses while running on Windows.
So, do not always compile ncurses in case GDB needs to build.

PDcurses is provided by an earlier build step and is not described in
this file.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
[yann.morin.1998@anciense.nib.fr: we already have a way to detect ncurses usage]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     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