scripts/build/companion_libs/mpc.sh
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
parent 1893 f5dab3c43abf
child 2099 1bb063c8a0ca
permissions -rw-r--r--
scripts: add option to strip all toolchain executables

To reduce filesizes of the toolchain and even improve build times
of projects to be build with this toolchain it is usefull to strip
the delivered toolchain executables. Since it is not likely that we
will debug the toolchain executables itself we do not need the
debug information inside the executables itself.

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