scripts/build/companion_libs/cloog.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 13 12:25:33 2009 +0200 (2009-09-13)
changeset 1537 a53a5e1d61db
parent 1530 fafe0dd00c66
child 1761 88020b2c3246
permissions -rw-r--r--
comp-libs/cloog: fix building

For CLooG/PPL 0.15.3, the directory name was simply cloog-ppl.
For any later versions, the driectory name does have the version, such as
cloog-ppl-0.15.4.
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@1384
    11
if [ "${CT_PPL_CLOOG_MPC}" = "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@1380
    32
    CT_Patch "cloog-ppl-${CT_CLOOG_VERSION}" nochdir
yann@1380
    33
    CT_Popd
yann@1380
    34
}
yann@1380
    35
yann@1380
    36
do_cloog() {
yann@1537
    37
    local _t
yann@1537
    38
yann@1537
    39
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1537
    40
    # while versions 0.15.4 onward do have the version in the dirname.
yann@1537
    41
    case "${CT_CLOOG_VERSION}" in
yann@1537
    42
        0.15.3) _t="";;
yann@1537
    43
        *)      _t="-${CT_CLOOG_VERSION}";;
yann@1537
    44
    esac
yann@1537
    45
yann@1380
    46
    mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    47
    cd "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    48
yann@1380
    49
    CT_DoStep INFO "Installing CLooG/ppl"
yann@1380
    50
yann@1380
    51
    CT_DoLog EXTRA "Configuring CLooG/ppl"
yann@1537
    52
    CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
yann@1537
    53
    CT_DoExecLog ALL                            \
yann@1537
    54
    "${CT_SRC_DIR}/cloog-ppl${_t}/configure"    \
yann@1537
    55
        --build=${CT_BUILD}                     \
yann@1537
    56
        --host=${CT_HOST}                       \
yann@1537
    57
        --prefix="${CT_PREFIX_DIR}"             \
yann@1537
    58
        --with-gmp="${CT_PREFIX_DIR}"           \
yann@1537
    59
        --with-ppl="${CT_PREFIX_DIR}"           \
yann@1537
    60
        --enable-shared                         \
yann@1537
    61
        --disable-static                        \
yann@1380
    62
        --with-bits=gmp
yann@1380
    63
yann@1380
    64
    CT_DoLog EXTRA "Building CLooG/ppl"
yann@1380
    65
    CT_DoExecLog ALL make ${PARALLELMFLAGS}
yann@1380
    66
yann@1386
    67
    if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
yann@1380
    68
        CT_DoLog EXTRA "Checking CLooG/ppl"
yann@1380
    69
        CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
yann@1380
    70
    fi
yann@1380
    71
yann@1380
    72
    CT_DoLog EXTRA "Installing CLooG/ppl"
yann@1380
    73
    CT_DoExecLog ALL make install
yann@1380
    74
yann@1397
    75
    # Remove spuriously installed file
yann@1397
    76
    CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/cloog"
yann@1397
    77
yann@1380
    78
    CT_EndStep
yann@1380
    79
}
yann@1380
    80
yann@1384
    81
fi # CT_PPL_CLOOG_MPC