scripts/build/companion_libs/cloog.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:43:07 2011 +0200 (2011-07-17)
changeset 2893 a8a65758664f
parent 2758 47199f966983
child 2927 ddaae597fd7c
permissions -rw-r--r--
cc/gcc: do not use the core pass-2 to build the baremetal compiler

In case we build a baremetal compiler, use the standard passes:
- core_cc is used to build the C library;
- as such, it is meant to run on build, not host;
- the final compiler is meant to run on host;

As the current final compiler step can not build a baremetal compiler,
call the core backend from the final step.

NB: Currently, newlib is built during the start_files pass, so we have
to have a core compiler by then... Once we can build the baremetal
compiler from the final cc step, then we can move the newlib build to
the proper step, and then get rid of the core pass-1 static compiler...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
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@1530
    22
    # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!)
yann@1530
    23
    # while versions 0.15.4 onward do have the version in the dirname.
yann@2757
    24
    # But, because the infrastructure properly creates the extracted
yann@2757
    25
    # directories (with tar's --strip-components), we can live safely...
yann@2757
    26
    CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}"
yann@2757
    27
    CT_Patch "cloog-ppl" "${CT_CLOOG_VERSION}"
yann@2757
    28
yann@2758
    29
    if [ "${CT_CLOOG_NEEDS_AUTORECONF}" = "y" ]; then
yann@2757
    30
        CT_Pushd "${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
yann@2704
    31
        CT_DoExecLog CFG ./autogen.sh
yann@2757
    32
        CT_Popd
yann@2262
    33
    fi
yann@1380
    34
}
yann@1380
    35
yann@1380
    36
do_cloog() {
yann@2757
    37
    local cloog_src_dir="${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
yann@1537
    38
yann@1380
    39
    mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    40
    cd "${CT_BUILD_DIR}/build-cloog-ppl"
yann@1380
    41
yann@1380
    42
    CT_DoStep INFO "Installing CLooG/ppl"
yann@1380
    43
yann@1380
    44
    CT_DoLog EXTRA "Configuring CLooG/ppl"
yann@1892
    45
yann@2349
    46
    CT_DoExecLog CFG                            \
yann@1537
    47
    CFLAGS="${CT_CFLAGS_FOR_HOST}"              \
benoit@2854
    48
    LIBS="-lm"                                  \
yann@2757
    49
    "${cloog_src_dir}/configure"                \
yann@1537
    50
        --build=${CT_BUILD}                     \
yann@1537
    51
        --host=${CT_HOST}                       \
yann@1893
    52
        --prefix="${CT_COMPLIBS_DIR}"           \
yann@1893
    53
        --with-gmp="${CT_COMPLIBS_DIR}"         \
yann@1893
    54
        --with-ppl="${CT_COMPLIBS_DIR}"         \
yann@1892
    55
        --with-bits=gmp                         \
yann@2381
    56
        --with-host-libstdcxx='-lstdc++'        \
yann@2381
    57
        --disable-shared                        \
yann@2381
    58
        --enable-static
yann@1380
    59
yann@1380
    60
    CT_DoLog EXTRA "Building CLooG/ppl"
yann@2275
    61
    CT_DoExecLog ALL make ${JOBSFLAGS} libcloog.la
yann@1380
    62
yann@1890
    63
    if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
yann@1380
    64
        CT_DoLog EXTRA "Checking CLooG/ppl"
yann@2275
    65
        CT_DoExecLog ALL make ${JOBSFLAGS} -s check
yann@1380
    66
    fi
yann@1380
    67
yann@1380
    68
    CT_DoLog EXTRA "Installing CLooG/ppl"
yann@2199
    69
    CT_DoExecLog ALL make install-libLTLIBRARIES install-pkgincludeHEADERS
yann@1397
    70
yann@1380
    71
    CT_EndStep
yann@1380
    72
}
yann@1380
    73
yann@1808
    74
fi # CT_CLOOG