scripts/build/companion_libs/ppl.sh
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Mon Apr 16 15:25:36 2012 +0200 (2012-04-16)
changeset 2941 13e40098fffc
parent 2929 22e495b7bee8
permissions -rw-r--r--
cc/gcc: update Linaro GCC revisions to 2012.04

Update Linaro GCC with the latest available revisions.

The 4.7 revision is also released, but the infrastructure is not yet ready for
it in CT-NG.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
yann@1324
     1
# This file adds the functions to build the PPL library
yann@1324
     2
# Copyright 2009 Yann E. MORIN
yann@1324
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1324
     4
yann@1324
     5
do_ppl_get() { :; }
yann@1324
     6
do_ppl_extract() { :; }
yann@2929
     7
do_ppl_for_build() { :; }
yann@2927
     8
do_ppl_for_host() { :; }
yann@1324
     9
yann@1324
    10
# Overide functions depending on configuration
yann@1808
    11
if [ "${CT_PPL}" = "y" ]; then
yann@1324
    12
yann@1324
    13
# Download PPL
yann@1324
    14
do_ppl_get() {
yann@1324
    15
    CT_GetFile "ppl-${CT_PPL_VERSION}"                                      \
yann@1324
    16
        http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION}  \
yann@1369
    17
        ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION}            \
yann@1369
    18
        ftp://gcc.gnu.org/pub/gcc/infrastructure
yann@1324
    19
}
yann@1324
    20
yann@1324
    21
# Extract PPL
yann@1324
    22
do_ppl_extract() {
yann@1324
    23
    CT_Extract "ppl-${CT_PPL_VERSION}"
yann@1901
    24
    CT_Patch "ppl" "${CT_PPL_VERSION}"
yann@1324
    25
}
yann@1324
    26
yann@2929
    27
# Build PPL for running on build
yann@2929
    28
# - always build statically
yann@2929
    29
# - we do not have build-specific CFLAGS
yann@2929
    30
# - install in build-tools prefix
yann@2929
    31
do_ppl_for_build() {
yann@2929
    32
    local -a ppl_opts
yann@2929
    33
yann@2929
    34
    case "${CT_TOOLCHAIN_TYPE}" in
yann@2929
    35
        native|cross)   return 0;;
yann@2929
    36
    esac
yann@2929
    37
yann@2929
    38
    CT_DoStep INFO "Installing PPL for build"
yann@2929
    39
    CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-build-${CT_BUILD}"
yann@2929
    40
yann@2929
    41
    ppl_opts+=( "host=${CT_BUILD}" )
yann@2929
    42
    ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
yann@2929
    43
    do_ppl_backend "${ppl_opts[@]}"
yann@2929
    44
yann@2929
    45
    CT_Popd
yann@2929
    46
    CT_EndStep
yann@2929
    47
}
yann@2929
    48
yann@2927
    49
# Build PPL for running on host
yann@2927
    50
do_ppl_for_host() {
yann@2927
    51
    local -a ppl_opts
yann@1324
    52
yann@2927
    53
    CT_DoStep INFO "Installing PPL for host"
yann@2927
    54
    CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
yann@2927
    55
yann@2927
    56
    ppl_opts+=( "host=${CT_HOST}" )
yann@2931
    57
    ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
yann@2927
    58
    ppl_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
yann@2927
    59
    do_ppl_backend "${ppl_opts[@]}"
yann@2927
    60
yann@2927
    61
    CT_Popd
yann@2927
    62
    CT_EndStep
yann@2927
    63
}
yann@2927
    64
yann@2927
    65
# Build PPL
yann@2927
    66
#     Parameter     : description               : type      : default
yann@2927
    67
#     host          : machine to run on         : tuple     : (none)
yann@2927
    68
#     prefix        : prefix to install into    : dir       : (none)
yann@2927
    69
#     cflags        : host cflags to use        : string    : (empty)
yann@2927
    70
do_ppl_backend() {
yann@2927
    71
    local host
yann@2927
    72
    local prefix
yann@2927
    73
    local cflags
yann@2927
    74
    local arg
yann@2927
    75
yann@2927
    76
    for arg in "$@"; do
yann@2927
    77
        eval "${arg// /\\ }"
yann@2927
    78
    done
yann@1324
    79
yann@1324
    80
    CT_DoLog EXTRA "Configuring PPL"
yann@1892
    81
yann@2348
    82
    CT_DoExecLog CFG                                \
yann@2927
    83
    CFLAGS="${cflags}"                              \
yann@2927
    84
    CXXFLAGS="${cflags}"                            \
yann@1324
    85
    "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
yann@1324
    86
        --build=${CT_BUILD}                         \
yann@2927
    87
        --host=${host}                              \
yann@2927
    88
        --prefix="${prefix}"                        \
yann@2927
    89
        --with-libgmp-prefix="${prefix}"            \
yann@2927
    90
        --with-libgmpxx-prefix="${prefix}"          \
yann@2927
    91
        --with-gmp-prefix="${prefix}"               \
yann@2364
    92
        --enable-watchdog                           \
yann@1324
    93
        --disable-debugging                         \
yann@1324
    94
        --disable-assertions                        \
yann@1324
    95
        --disable-ppl_lcdd                          \
yann@1892
    96
        --disable-ppl_lpsol                         \
yann@2381
    97
        --disable-shared                            \
anthony@2461
    98
        --enable-interfaces='c c++'                 \
yann@2381
    99
        --enable-static
yann@1324
   100
yann@1324
   101
    # Maybe-options:
yann@1324
   102
    # --enable-optimization=speed  or sspeed (yes, with 2 's')
yann@1324
   103
yann@1324
   104
    CT_DoLog EXTRA "Building PPL"
yann@2275
   105
    CT_DoExecLog ALL make ${JOBSFLAGS}
yann@1324
   106
yann@1890
   107
    if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
yann@1324
   108
        CT_DoLog EXTRA "Checking PPL"
yann@2275
   109
        CT_DoExecLog ALL make ${JOBSFLAGS} -s check
yann@1324
   110
    fi
yann@1324
   111
yann@1324
   112
    CT_DoLog EXTRA "Installing PPL"
yann@1324
   113
    CT_DoExecLog ALL make install
yann@1324
   114
yann@1397
   115
    # Remove spuriously installed file
yann@2927
   116
    CT_DoExecLog ALL rm -f "${prefix}/bin/ppl-config"
yann@1324
   117
}
yann@1324
   118
yann@1808
   119
fi # CT_PPL