scripts/build/companion_libs/cloog.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 2071 5526fb72a893
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@1380
     1
# This file adds the functions to build the CLooG library
yann@1380
     2
# Copyright 2009 Yann E. MORIN
yann@1380
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1380
     4
yann@1380
     5
do_cloog_get() { :; }
yann@1380
     6
do_cloog_extract() { :; }
yann@1380
     7
do_cloog() { :; }
yann@1380
     8
do_cloog_target() { :; }
yann@1380
     9
yann@1380
    10
# Overide functions depending on configuration
yann@1808
    11
if [ "${CT_CLOOG}" = "y" ]; then
yann@1380
    12
yann@1380
    13
# Download CLooG
yann@1380
    14
do_cloog_get() {
yann@1380
    15
    CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}"  \
yann@1380
    16
        ftp://gcc.gnu.org/pub/gcc/infrastructure
yann@1380
    17
}
yann@1380
    18
yann@1380
    19
# Extract CLooG
yann@1380
    20
do_cloog_extract() {
yann@1530
    21
    local _t
yann@1530
    22
yann@1380
    23
    CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
yann@1530
    24
yann@1530
    25
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1530
    26
    # while versions 0.15.4 onward do have the version in the dirname.
yann@1530
    27
    case "${CT_CLOOG_VERSION}" in
yann@1530
    28
        0.15.3) _t="";;
yann@1530
    29
        *)      _t="-${CT_CLOOG_VERSION}";;
yann@1530
    30
    esac
yann@1530
    31
    CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
yann@1901
    32
    CT_Patch nochdir "cloog-ppl" "${CT_CLOOG_VERSION}"
yann@1380
    33
    CT_Popd
yann@1380
    34
}
yann@1380
    35
yann@1380
    36
do_cloog() {
yann@1537
    37
    local _t
yann@1892
    38
    local cloog_LDFLAGS
yann@1892
    39
    local -a cloog_opts
yann@1537
    40
yann@1537
    41
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1537
    42
    # while versions 0.15.4 onward do have the version in the dirname.
yann@1537
    43
    case "${CT_CLOOG_VERSION}" in
yann@1537
    44
        0.15.3) _t="";;
yann@1537
    45
        *)      _t="-${CT_CLOOG_VERSION}";;
yann@1537
    46
    esac
yann@1537
    47
yann@1380
    48
    mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    49
    cd "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    50
yann@1380
    51
    CT_DoStep INFO "Installing CLooG/ppl"
yann@1380
    52
yann@1380
    53
    CT_DoLog EXTRA "Configuring CLooG/ppl"
yann@1892
    54
yann@1892
    55
    if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
yann@1892
    56
        cloog_opts+=( --enable-shared --disable-static )
yann@1892
    57
    else
yann@1892
    58
        cloog_opts+=( --disable-shared --enable-static )
yann@1892
    59
        cloog_LDFLAGS='-lstdc++'
yann@1892
    60
    fi
yann@1892
    61
yann@1537
    62
    CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
yann@1892
    63
    LDFLAGS="${cloog_LDFLAGS}"                  \
yann@1537
    64
    CT_DoExecLog ALL                            \
yann@1537
    65
    "${CT_SRC_DIR}/cloog-ppl${_t}/configure"    \
yann@1537
    66
        --build=${CT_BUILD}                     \
yann@1537
    67
        --host=${CT_HOST}                       \
yann@1893
    68
        --prefix="${CT_COMPLIBS_DIR}"           \
yann@1893
    69
        --with-gmp="${CT_COMPLIBS_DIR}"         \
yann@1893
    70
        --with-ppl="${CT_COMPLIBS_DIR}"         \
yann@1892
    71
        --with-bits=gmp                         \
yann@1892
    72
        "${cloog_opts[@]}"
yann@1380
    73
yann@1380
    74
    CT_DoLog EXTRA "Building CLooG/ppl"
yann@1380
    75
    CT_DoExecLog ALL make ${PARALLELMFLAGS}
yann@1380
    76
yann@1890
    77
    if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
yann@1380
    78
        CT_DoLog EXTRA "Checking CLooG/ppl"
yann@1380
    79
        CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
yann@1380
    80
    fi
yann@1380
    81
yann@1380
    82
    CT_DoLog EXTRA "Installing CLooG/ppl"
yann@1380
    83
    CT_DoExecLog ALL make install
yann@1380
    84
yann@1397
    85
    # Remove spuriously installed file
yann@1397
    86
    CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/cloog"
yann@1397
    87
yann@1380
    88
    CT_EndStep
yann@1380
    89
}
yann@1380
    90
yann@1808
    91
fi # CT_CLOOG