scripts/build/companion_libs/cloog.sh
author Kalle Kankare <kalle.kankare@vincit.fi>
Fri Dec 03 12:36:44 2010 +0100 (2010-12-03)
changeset 2216 81b4c0efa46f
parent 2199 ab0759ba292c
child 2262 32c7bbfa3f65
permissions -rw-r--r--
complibs/libelf: use host compiler

It appears, that the configure scripts of libelf versions 0.8.13 and
0.8.12 do not honour the --host option. The compiler must be given as an
environment variable or the process will use the command "gcc" as the
compiler.

It seems that this is already done in the function do_libelf_target in
scripts/build/companion_libs/libelf.sh, but not in function do_libelf.
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
yann@1380
     9
# Overide functions depending on configuration
yann@1808
    10
if [ "${CT_CLOOG}" = "y" ]; then
yann@1380
    11
yann@1380
    12
# Download CLooG
yann@1380
    13
do_cloog_get() {
yann@1380
    14
    CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}"  \
yann@1380
    15
        ftp://gcc.gnu.org/pub/gcc/infrastructure
yann@1380
    16
}
yann@1380
    17
yann@1380
    18
# Extract CLooG
yann@1380
    19
do_cloog_extract() {
yann@1530
    20
    local _t
yann@1530
    21
yann@1380
    22
    CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
yann@1530
    23
yann@1530
    24
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1530
    25
    # while versions 0.15.4 onward do have the version in the dirname.
yann@1530
    26
    case "${CT_CLOOG_VERSION}" in
yann@1530
    27
        0.15.3) _t="";;
yann@1530
    28
        *)      _t="-${CT_CLOOG_VERSION}";;
yann@1530
    29
    esac
yann@1530
    30
    CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
yann@1901
    31
    CT_Patch nochdir "cloog-ppl" "${CT_CLOOG_VERSION}"
yann@1380
    32
    CT_Popd
yann@1380
    33
}
yann@1380
    34
yann@1380
    35
do_cloog() {
yann@1537
    36
    local _t
yann@1892
    37
    local cloog_LDFLAGS
yann@1892
    38
    local -a cloog_opts
yann@1537
    39
yann@1537
    40
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1537
    41
    # while versions 0.15.4 onward do have the version in the dirname.
yann@1537
    42
    case "${CT_CLOOG_VERSION}" in
yann@1537
    43
        0.15.3) _t="";;
yann@1537
    44
        *)      _t="-${CT_CLOOG_VERSION}";;
yann@1537
    45
    esac
yann@1537
    46
yann@1380
    47
    mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    48
    cd "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    49
yann@1380
    50
    CT_DoStep INFO "Installing CLooG/ppl"
yann@1380
    51
yann@1380
    52
    CT_DoLog EXTRA "Configuring CLooG/ppl"
yann@1892
    53
yann@1892
    54
    if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
yann@1892
    55
        cloog_opts+=( --enable-shared --disable-static )
yann@1892
    56
    else
yann@1892
    57
        cloog_opts+=( --disable-shared --enable-static )
bpringle@2206
    58
        cloog_opts+=( --with-host-libstdcxx='-lstdc++' )
bpringle@2206
    59
        cloog_LDFLAGS='-lm'
yann@1892
    60
    fi
yann@1892
    61
yann@1537
    62
    CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
yann@1892
    63
    LDFLAGS="${cloog_LDFLAGS}"                  \
anthony@2154
    64
    CT_DoExecLog CFG                            \
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@2199
    75
    CT_DoExecLog ALL make ${PARALLELMFLAGS} libcloog.la
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@2199
    83
    CT_DoExecLog ALL make install-libLTLIBRARIES install-pkgincludeHEADERS
yann@1397
    84
yann@1380
    85
    CT_EndStep
yann@1380
    86
}
yann@1380
    87
yann@1808
    88
fi # CT_CLOOG